Updated Column Expression Panel
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@90349 82a268e6-3cf1-43bd-a215-b396298e98cf
|
@ -0,0 +1,32 @@
|
|||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||
Compiling...
|
||||
20% complete (ETR: 18 seconds)
|
||||
20% complete (ETR: 18 seconds)
|
||||
20% complete (ETR: 18 seconds)
|
||||
30% complete (ETR: 15 seconds)
|
||||
40% complete (ETR: 13 seconds)
|
||||
50% complete (ETR: 10 seconds)
|
||||
60% complete (ETR: 7 seconds)
|
||||
70% complete (ETR: 4 seconds)
|
||||
80% complete (ETR: 3 seconds)
|
||||
90% complete (ETR: 1 seconds)
|
||||
100% complete (ETR: 0 seconds)
|
||||
Compilation completed in 19.83 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
||||
Public resources found in...
|
||||
Translatable source found in...
|
||||
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||
Compiling...
|
||||
Compilation completed in 0.00 seconds
|
||||
Removing invalidated units
|
||||
Finding entry point classes
|
|
@ -1,23 +1,26 @@
|
|||
package org.gcube.portlets.user.td.expressionwidget.client;
|
||||
|
||||
import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.widget.client.TextButton;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.CellButtonBase;
|
||||
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;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldSet;
|
||||
import com.sencha.gxt.widget.core.client.form.TextArea;
|
||||
|
@ -116,28 +119,42 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
||||
TextButton save = new TextButton("Save");
|
||||
save.setTitle("Save rule");
|
||||
save.addClickHandler(new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
TextButton btnSave = new TextButton("Save");
|
||||
btnSave.setIcon(ExpressionResources.INSTANCE.save());
|
||||
btnSave.setIconAlign(IconAlign.RIGHT);
|
||||
btnSave.setTitle("Save rule");
|
||||
btnSave.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Save");
|
||||
saveRule();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
TextButton cancel = new TextButton("Cancel");
|
||||
cancel.setTitle("Cancel rule");
|
||||
cancel.addClickHandler(new ClickHandler() {
|
||||
|
||||
CellButtonBase<?> btnClose = new TextButton("Close");
|
||||
btnClose.setIcon(ExpressionResources.INSTANCE.close());
|
||||
btnClose.setIconAlign(IconAlign.RIGHT);
|
||||
btnClose.setTitle("Cancel rule");
|
||||
btnClose.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Close");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*btnClose.addClickHandler(new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
Log.debug("Pressed Cancel");
|
||||
cancelRule();
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
flowButton.add(save, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
flowButton.add(cancel, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
flowButton.add(btnSave, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
basicLayout.add(properties, new VerticalLayoutData(-1, -1, new Margins(
|
||||
1)));
|
||||
|
@ -173,7 +190,7 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
protected void saveRule() {
|
||||
//conditionWidget.getVert();
|
||||
conditionWidget.getVert();
|
||||
}
|
||||
|
||||
protected void cancelRule() {
|
||||
|
|
|
@ -9,11 +9,16 @@ import org.gcube.portlets.user.td.expressionwidget.client.operation.OperationsSt
|
|||
import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.cell.client.SafeHtmlCell;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.IsWidget;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
||||
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||
|
@ -25,6 +30,7 @@ import com.sencha.gxt.widget.core.client.container.SimpleContainer;
|
|||
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.form.ComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
|
||||
/**
|
||||
|
@ -84,15 +90,28 @@ public class ConditionWidget extends SimpleContainer {
|
|||
vert = new VerticalLayoutContainer();
|
||||
vert.setScrollMode(ScrollMode.AUTO);
|
||||
vert.setAdjustForScroll(true);
|
||||
|
||||
HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
setup();
|
||||
}
|
||||
|
||||
protected void setup(){
|
||||
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
|
||||
|
||||
final TextField firstArg = new TextField();
|
||||
firstArg.setVisible(false);
|
||||
|
||||
|
||||
final HTML andText=new HTML("<div style='vertical-align:middle; margin-left:2px;margin-right:2px;margin-top:4px;'>and</div>");
|
||||
andText.setVisible(false);
|
||||
|
||||
final TextField secondArg = new TextField();
|
||||
secondArg.setVisible(false);
|
||||
|
||||
/*
|
||||
final FieldLabel labelAnd=new FieldLabel(secondArg,"and");
|
||||
labelAnd.setLabelSeparator("");
|
||||
labelAnd.setLabelPad(0);
|
||||
labelAnd.setVisible(false);
|
||||
*/
|
||||
|
||||
final IconButton btnAdd = new IconButton();
|
||||
btnAdd.setItemId(itemIdBtnAdd);
|
||||
btnAdd.setIcon(ExpressionResources.INSTANCE.add());
|
||||
|
@ -105,7 +124,24 @@ public class ConditionWidget extends SimpleContainer {
|
|||
}
|
||||
});
|
||||
btnAdd.setVisible(false);
|
||||
|
||||
final IconButton btnDel = new IconButton();
|
||||
btnAdd.setItemId(itemIdBtnDel);
|
||||
btnDel.setIcon(ExpressionResources.INSTANCE.delete());
|
||||
btnDel.addClickHandler(new ClickHandler() {
|
||||
|
||||
public void onClick(ClickEvent event) {
|
||||
Log.debug("Clicked btnDel");
|
||||
vert.remove(horiz);
|
||||
if(vert.getWidgetCount()==0){
|
||||
setup();
|
||||
}
|
||||
thisCont.forceLayout();
|
||||
|
||||
}
|
||||
});
|
||||
btnDel.setVisible(false);
|
||||
|
||||
OperationProperties props = GWT.create(OperationProperties.class);
|
||||
ListStore<Operation> storeOp = new ListStore<Operation>(props.id());
|
||||
storeOp.addAll(OperationsStore.getAll(dataTypeName));
|
||||
|
@ -155,16 +191,21 @@ public class ConditionWidget extends SimpleContainer {
|
|||
case NOT_IN:
|
||||
firstArg.setVisible(true);
|
||||
btnAdd.setVisible(true);
|
||||
btnDel.setVisible(true);
|
||||
break;
|
||||
case BETWEEN:
|
||||
case NOT_BETWEEN:
|
||||
firstArg.setVisible(true);
|
||||
andText.setVisible(true);
|
||||
secondArg.setVisible(true);
|
||||
btnAdd.setVisible(true);
|
||||
btnDel.setVisible(true);
|
||||
break;
|
||||
case IS_NULL:
|
||||
case IS_NOT_NULL:
|
||||
btnAdd.setVisible(true);
|
||||
btnDel.setVisible(true);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -227,8 +268,10 @@ public class ConditionWidget extends SimpleContainer {
|
|||
|
||||
horiz.add(comboOp, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(firstArg, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(andText, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(secondArg, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 0, 2, 0)));
|
||||
horiz.add(btnDel, new BoxLayoutData(new Margins(2, 0, 2, 0)));
|
||||
|
||||
vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1)));
|
||||
|
||||
|
@ -260,10 +303,19 @@ public class ConditionWidget extends SimpleContainer {
|
|||
|
||||
final TextField firstArg = new TextField();
|
||||
firstArg.setVisible(false);
|
||||
|
||||
|
||||
final HTML andText=new HTML("<div style='vertical-align:middle; margin-left:2px;margin-right:2px;margin-top:4px;'>and</div>");
|
||||
andText.setVisible(false);
|
||||
|
||||
final TextField secondArg = new TextField();
|
||||
secondArg.setVisible(false);
|
||||
|
||||
|
||||
/*final FieldLabel labelAnd=new FieldLabel(secondArg,"and");
|
||||
labelAnd.setLabelSeparator("");
|
||||
labelAnd.setLabelPad(0);
|
||||
labelAnd.setVisible(false);
|
||||
*/
|
||||
|
||||
final IconButton btnAdd = new IconButton();
|
||||
btnAdd.setItemId(itemIdBtnAdd);
|
||||
btnAdd.setIcon(ExpressionResources.INSTANCE.add());
|
||||
|
@ -272,10 +324,8 @@ public class ConditionWidget extends SimpleContainer {
|
|||
public void onClick(ClickEvent event) {
|
||||
Log.debug("Clicked btnAdd");
|
||||
addCondition();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
btnAdd.setVisible(false);
|
||||
|
||||
final IconButton btnDel = new IconButton();
|
||||
|
@ -286,7 +336,10 @@ public class ConditionWidget extends SimpleContainer {
|
|||
public void onClick(ClickEvent event) {
|
||||
Log.debug("Clicked btnDel");
|
||||
vert.remove(horiz);
|
||||
|
||||
if(vert.getWidgetCount()==0){
|
||||
setup();
|
||||
}
|
||||
thisCont.forceLayout();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -324,6 +377,7 @@ public class ConditionWidget extends SimpleContainer {
|
|||
case BETWEEN:
|
||||
case NOT_BETWEEN:
|
||||
firstArg.setVisible(true);
|
||||
andText.setVisible(true);
|
||||
secondArg.setVisible(true);
|
||||
btnAdd.setVisible(true);
|
||||
break;
|
||||
|
@ -350,6 +404,7 @@ public class ConditionWidget extends SimpleContainer {
|
|||
|
||||
horiz.add(comboOp, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(firstArg, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(andText, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(secondArg, new BoxLayoutData(new Margins(0)));
|
||||
horiz.add(btnAdd, new BoxLayoutData(new Margins(2, 0, 2, 0)));
|
||||
horiz.add(btnDel, new BoxLayoutData(new Margins(2, 0, 2, 0)));
|
||||
|
|
|
@ -23,4 +23,12 @@ public interface ExpressionResources extends ClientBundle {
|
|||
@Source("delete.png")
|
||||
ImageResource delete();
|
||||
|
||||
@Source("disk.png")
|
||||
ImageResource save();
|
||||
|
||||
@Source("close-red.png")
|
||||
ImageResource close();
|
||||
|
||||
|
||||
|
||||
}
|
After Width: | Height: | Size: 693 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 886 B |
After Width: | Height: | Size: 693 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 886 B |