diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplaceDialog.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplaceDialog.java index b0d4f20..14dd1b7 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplaceDialog.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplaceDialog.java @@ -28,7 +28,7 @@ public class BatchReplaceDialog extends Window { this.columnName=columnName; initWindow(); - BatchReplacePanel batchRepalcePanel= new BatchReplacePanel(trId,columnName,eventBus); + BatchReplacePanel batchRepalcePanel= new BatchReplacePanel(this, trId,columnName,eventBus); add(batchRepalcePanel); } diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplacePanel.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplacePanel.java index 28b0165..eb3c1a3 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplacePanel.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/batch/BatchReplacePanel.java @@ -22,6 +22,7 @@ import com.google.gwt.safecss.shared.SafeStylesBuilder; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.HTML; import com.google.web.bindery.event.shared.EventBus; +import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign; import com.sencha.gxt.core.client.IdentityValueProvider; import com.sencha.gxt.core.client.Style.SelectionMode; import com.sencha.gxt.core.client.resources.ThemeStyles; @@ -37,6 +38,11 @@ import com.sencha.gxt.data.shared.loader.ListLoadResultBean; import com.sencha.gxt.data.shared.loader.ListLoader; import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding; import com.sencha.gxt.widget.core.client.FramedPanel; +import com.sencha.gxt.widget.core.client.button.TextButton; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData; +import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; +import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer; +import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; import com.sencha.gxt.widget.core.client.event.SelectEvent; @@ -64,16 +70,21 @@ public class BatchReplacePanel extends FramedPanel { protected TRId trId; protected String columnName; protected ColumnData column; - + protected BatchReplaceDialog batchReplaceDialog; + protected static final String DON_T_REPLACE = "Don't replace"; + private TextButton btnApply; + private TextButton btnClose; + protected ListLoader> loader; protected Grid grid; protected ListStore store; protected HTML info; - public BatchReplacePanel(TRId trId, String columnName, EventBus eventBus) { + public BatchReplacePanel(BatchReplaceDialog batchReplaceDialog, TRId trId, String columnName, EventBus eventBus) { + this.batchReplaceDialog=batchReplaceDialog; Log.debug("BatchReplacePanel:["+trId+", columnName:"+columnName+"]"); setWidth(WIDTH); setHeight(HEIGHT); @@ -157,12 +168,6 @@ public class BatchReplacePanel extends FramedPanel { }); - - - - - - RpcProxy> proxy = new RpcProxy>() { @@ -198,7 +203,7 @@ public class BatchReplacePanel extends FramedPanel { number.initPlugin(grid); // grid.getView().setAutoExpandColumn(labelCol); // grid.setHeight(360); - grid.setHeight("454px"); + grid.setHeight("418px"); grid.getView().setStripeRows(true); grid.getView().setColumnLines(true); grid.getView().setAutoFill(true); @@ -215,10 +220,46 @@ public class BatchReplacePanel extends FramedPanel { toolBar.addStyleName(ThemeStyles.getStyle().borderTop()); toolBar.getElement().getStyle().setProperty("borderBottom", "none"); + btnApply = new TextButton("Save"); + btnApply.setIcon(ResourceBundle.INSTANCE.save()); + btnApply.setIconAlign(IconAlign.RIGHT); + btnApply.setTitle("Apply Filter"); + btnApply.addSelectHandler(new SelectHandler() { + + public void onSelect(SelectEvent event) { + Log.debug("Pressed Apply"); + save(); + + } + }); + + btnClose = new TextButton("Close"); + btnClose.setIcon(ResourceBundle.INSTANCE.close()); + btnClose.setIconAlign(IconAlign.RIGHT); + btnClose.setTitle("Cancel filter"); + btnClose.addSelectHandler(new SelectHandler() { + + public void onSelect(SelectEvent event) { + Log.debug("Pressed Close"); + close(); + } + }); + + HBoxLayoutContainer flowButton = new HBoxLayoutContainer(); + flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE); + flowButton.setPack(BoxLayoutPack.CENTER); + + flowButton + .add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4))); + flowButton + .add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4))); + + VerticalLayoutContainer v = new VerticalLayoutContainer(); v.add(grid, new VerticalLayoutData(-1, -1, new Margins(0))); v.add(toolBar,new VerticalLayoutData(1, 25, new Margins(0))); - + v.add(flowButton, new VerticalLayoutData(-1, 36, new Margins( + 5, 2, 5, 2))); add(v); @@ -330,7 +371,13 @@ public class BatchReplacePanel extends FramedPanel { return data; } + protected void save(){ + + } + protected void close(){ + batchReplaceDialog.close(); + } } diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/ResourceBundle.java index ccecdd4..d793995 100644 --- a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/ResourceBundle.java +++ b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/ResourceBundle.java @@ -39,5 +39,20 @@ public interface ResourceBundle extends ClientBundle { @Source("column-values_32.png") ImageResource replace32(); + + @Source("close-red.png") + ImageResource close(); + + @Source("close-red_32.png") + ImageResource close32(); + + @Source("disk.png") + ImageResource save(); + + @Source("disk_32.png") + ImageResource save32(); + + + } \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png new file mode 100644 index 0000000..978f945 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png new file mode 100644 index 0000000..8e877f1 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png new file mode 100644 index 0000000..9cce534 Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png differ diff --git a/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png new file mode 100644 index 0000000..fbb32bc Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png new file mode 100644 index 0000000..978f945 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png new file mode 100644 index 0000000..8e877f1 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/close-red_32.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png new file mode 100644 index 0000000..9cce534 Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk.png differ diff --git a/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png new file mode 100644 index 0000000..fbb32bc Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/columnwidget/client/resources/disk_32.png differ