Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@91786 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-17 15:22:15 +00:00
parent 7aabcf2fd6
commit 6e9ef3b4ae
6 changed files with 27 additions and 27 deletions

View File

@ -24,7 +24,7 @@
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> --> <!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> -->
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />
<source path='shared' /> <source path='shared' />

View File

@ -29,13 +29,7 @@ public class ColumnExpressionDialog extends Window {
public ColumnExpressionDialog(String columnId, public ColumnExpressionDialog(String columnId,
ColumnTypeCode columnTypeCode, ColumnDataType dataTypeName, ColumnTypeCode columnTypeCode, ColumnDataType dataTypeName,
EventBus eventBus) { EventBus eventBus) {
setWidth(WIDTH); initWindow();
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("New Rule");
getHeader().setIcon(ExpressionResources.INSTANCE.rule());
this.eventBus = eventBus; this.eventBus = eventBus;
column = new ColumnData(); column = new ColumnData();
column.setColumnId(columnId); column.setColumnId(columnId);
@ -47,18 +41,23 @@ public class ColumnExpressionDialog extends Window {
public ColumnExpressionDialog(TRId trId, String columnName, public ColumnExpressionDialog(TRId trId, String columnName,
EventBus eventBus) { EventBus eventBus) {
initWindow();
this.eventBus = eventBus;
this.trId = trId;
this.columnName = columnName;
load(trId, columnName);
}
protected void initWindow(){
setWidth(WIDTH); setWidth(WIDTH);
setHeight(HEIGHT); setHeight(HEIGHT);
setBodyBorder(false); setBodyBorder(false);
setResizable(false); setResizable(false);
setHeadingText("New Rule"); setHeadingText("New Rule");
setClosable(false);
getHeader().setIcon(ExpressionResources.INSTANCE.rule()); getHeader().setIcon(ExpressionResources.INSTANCE.rule());
this.eventBus = eventBus;
this.trId = trId;
this.columnName = columnName;
load(trId, columnName);
} }
protected void create() { protected void create() {
@ -114,13 +113,7 @@ public class ColumnExpressionDialog extends Window {
} }
@Override
public void hide() {
ExpressionEvent expressionEvent= new ExpressionEvent(ExpressionType.EXPRESSIONNULL);
Log.debug(expressionEvent.toString());
eventBus.fireEvent(expressionEvent);
hide(null);
}

View File

@ -185,8 +185,10 @@ public class ColumnExpressionPanel extends FramedPanel {
expressionEvent.setColumnId(column.getColumnId()); expressionEvent.setColumnId(column.getColumnId());
expressionEvent.setColumnName(column.getName()); expressionEvent.setColumnName(column.getName());
Log.debug(expressionEvent.toString()); Log.debug(expressionEvent.toString());
eventBus.fireEvent(expressionEvent);
parent.hide(); parent.hide();
eventBus.fireEvent(expressionEvent);
} }
protected void saveRule() { protected void saveRule() {
@ -201,8 +203,9 @@ public class ColumnExpressionPanel extends FramedPanel {
protected void close() { protected void close() {
ExpressionEvent expressionEvent= new ExpressionEvent(ExpressionType.EXPRESSIONNULL); ExpressionEvent expressionEvent= new ExpressionEvent(ExpressionType.EXPRESSIONNULL);
Log.debug(expressionEvent.toString()); Log.debug(expressionEvent.toString());
eventBus.fireEvent(expressionEvent);
parent.hide(); parent.hide();
eventBus.fireEvent(expressionEvent);
} }

View File

@ -89,6 +89,8 @@ public class ConditionWidget extends SimpleContainer {
groupMatch = new ToggleGroup(); groupMatch = new ToggleGroup();
groupMatch.add(radioAll); groupMatch.add(radioAll);
groupMatch.add(radioAny); groupMatch.add(radioAny);
groupMatch.setValue(radioAll);
vert = new VerticalLayoutContainer(); vert = new VerticalLayoutContainer();
vert.setScrollMode(ScrollMode.AUTO); vert.setScrollMode(ScrollMode.AUTO);
@ -388,14 +390,16 @@ public class ConditionWidget extends SimpleContainer {
Log.debug(expression.toString()); Log.debug(expression.toString());
arguments.add(expression); arguments.add(expression);
} }
Log.debug("Expression Arguments Calculated: " +arguments.size());
if (arguments.size() > 0) { if (arguments.size() > 0) {
if (arguments.size() == 1) { if (arguments.size() == 1) {
exp = arguments.get(0); exp = arguments.get(0);
} else { } else {
Radio radio = (Radio) groupMatch.getValue(); Radio radio = (Radio) groupMatch.getValue();
Log.debug("Match:"+radio);
if (radio.getName().compareTo("All") == 0) { if (radio.getName().compareTo("All") == 0) {
} else {
exp = mapOp.createC_And(arguments); exp = mapOp.createC_And(arguments);
} else {
if (radio.getName().compareTo("Any") == 0) { if (radio.getName().compareTo("Any") == 0) {
exp = mapOp.createC_Or(arguments); exp = mapOp.createC_Or(arguments);
} else { } else {
@ -405,7 +409,7 @@ public class ConditionWidget extends SimpleContainer {
} }
} }
Log.debug("C_Expression" + exp); Log.debug("C_Expression:" + exp.toString());
return exp; return exp;
} }

View File

@ -7,7 +7,6 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeC
import com.allen_sauer.gwt.log.client.Log; import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.web.bindery.event.shared.EventBus; import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus; import com.google.web.bindery.event.shared.SimpleEventBus;
@ -20,7 +19,8 @@ public class ExpressionWidgetEntry implements EntryPoint {
EventBus eventBus= new SimpleEventBus(); EventBus eventBus= new SimpleEventBus();
ColumnExpressionDialog expressionDialog=new ColumnExpressionDialog("1", ColumnTypeCode.ATTRIBUTE, ColumnDataType.Integer, eventBus); ColumnExpressionDialog expressionDialog=new ColumnExpressionDialog("1", ColumnTypeCode.ATTRIBUTE, ColumnDataType.Integer, eventBus);
RootPanel.get().add(expressionDialog); expressionDialog.show();
//RootPanel.get().add(expressionDialog);
Log.info("Hello!"); Log.info("Hello!");
} }

View File

@ -23,7 +23,7 @@
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> --> <!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> -->
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />