Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@90361 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-01-22 11:19:59 +00:00
parent ee34e3d721
commit 659ae53b5c
9 changed files with 195 additions and 25 deletions

View File

@ -30,3 +30,35 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
50% complete (ETR: 6 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 13.85 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

View File

@ -7,6 +7,9 @@
<dependent-module archiveName="tabular-data-gwt-service-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-gwt-service/tabular-data-gwt-service">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-model-3.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-model/tabular-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="tabular-data-widget-common-event-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/tabular-data-widget-common-event/tabular-data-widget-common-event">
<dependency-type>uses</dependency-type>
</dependent-module>

View File

@ -1,26 +1,30 @@
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.shared.tr.ColumnData;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnDataType;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnTypeCode;
import org.gcube.portlets.user.td.expressionwidget.shared.model.Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.sencha.gxt.widget.core.client.Window;
public class ColumnExpressionDialog extends Window {
protected String WIDTH = "640px";
protected String HEIGHT = "520px";
protected String WIDTH = "650px";
protected String HEIGHT = "530px";
protected ColumnExpressionPanel columnExpressionPanel;
protected Expression exp=null;
public ColumnExpressionDialog(String columnId, String columnTypeCode,
String dataTypeName) {
public ColumnExpressionDialog(String columnId, ColumnTypeCode columnTypeCode,
ColumnDataType dataTypeName) {
setBodyBorder(false);
setWidth(WIDTH);
setHeight(HEIGHT);
setResize(true);
setResizable(false);
setHeadingText("New Rule");
getHeader().setIcon(ExpressionResources.INSTANCE.rule());
columnExpressionPanel=new ColumnExpressionPanel(columnId, columnTypeCode,dataTypeName);
columnExpressionPanel=new ColumnExpressionPanel(this, columnId, columnTypeCode,dataTypeName);
add(columnExpressionPanel);
}
@ -29,12 +33,19 @@ public class ColumnExpressionDialog extends Window {
setBodyBorder(false);
setWidth(WIDTH);
setHeight(HEIGHT);
setResize(true);
setResizable(false);
setHeadingText("New Rule");
getHeader().setIcon(ExpressionResources.INSTANCE.rule());
columnExpressionPanel=new ColumnExpressionPanel(trId, columnName);
columnExpressionPanel=new ColumnExpressionPanel(this, trId, columnName);
add(columnExpressionPanel);
}
public Expression getExpression(){
return exp;
}
public void setExpression(Expression exp){
this.exp=exp;
}
}

View File

@ -1,6 +1,9 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnDataType;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnTypeCode;
import org.gcube.portlets.user.td.expressionwidget.shared.model.Expression;
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;
@ -11,7 +14,6 @@ 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.Window;
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;
@ -37,23 +39,25 @@ public class ColumnExpressionPanel extends FramedPanel {
protected String WIDTH = "640px";
protected String HEIGHT = "520px";
protected ColumnExpressionDialog parent;
protected TRId trId;
protected String columnName = null;
protected ColumnData column;
protected ConditionWidget conditionWidget;
/**
*
* @param columnTypeCode
* @param dataTypeName
*/
public ColumnExpressionPanel(String columnId, String columnTypeCode,
String dataTypeName) {
public ColumnExpressionPanel(ColumnExpressionDialog parent, String columnId, ColumnTypeCode columnTypeCode,
ColumnDataType dataTypeName) {
this.parent=parent;
column = new ColumnData();
column.setColumnId(columnId);
column.setDataTypeName(dataTypeName);
column.setTypeCode(columnTypeCode);
column.setDataTypeName(dataTypeName.toString());
column.setTypeCode(columnTypeCode.toString());
create();
}
@ -62,7 +66,8 @@ public class ColumnExpressionPanel extends FramedPanel {
* @param trId
* @param columnName
*/
public ColumnExpressionPanel(TRId trId, String columnName) {
public ColumnExpressionPanel(ColumnExpressionDialog parent, TRId trId, String columnName) {
this.parent=parent;
this.trId = trId;
this.columnName = columnName;
load(trId, columnName);
@ -194,7 +199,8 @@ public class ColumnExpressionPanel extends FramedPanel {
}
protected void saveRule() {
conditionWidget.getVert();
Expression exp=conditionWidget.getExpression();
parent.setExpression(exp);
}
protected void cancelRule() {

View File

@ -7,6 +7,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.operation.Operation;
import org.gcube.portlets.user.td.expressionwidget.client.operation.OperationProperties;
import org.gcube.portlets.user.td.expressionwidget.client.operation.OperationsStore;
import org.gcube.portlets.user.td.expressionwidget.client.resource.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.shared.model.Expression;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
@ -71,6 +72,7 @@ public class ConditionWidget extends SimpleContainer {
Radio radioAll = new Radio();
radioAll.setBoxLabel("All conditions");
radioAll.setValue(true);
Radio radioAny = new Radio();
radioAny.setBoxLabel("Any condition");
@ -359,7 +361,9 @@ public class ConditionWidget extends SimpleContainer {
}
public void getVert() {
public Expression getExpression() {
Expression exp=null;
Iterator<Widget> iteratorVert = vert.iterator();
while (iteratorVert.hasNext()) {
HBoxLayoutContainer horiz = (HBoxLayoutContainer) iteratorVert
@ -371,5 +375,6 @@ public class ConditionWidget extends SimpleContainer {
Log.debug("combo:" + comboOp.getCurrentValue().toString());
}
return exp;
}
}

View File

@ -2,7 +2,8 @@ package org.gcube.portlets.user.td.expressionwidget.client;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnDataType;
import org.gcube.portlets.user.td.expressionwidget.shared.column.ColumnTypeCode;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
@ -12,13 +13,9 @@ public class ExpressionWidgetEntry implements EntryPoint {
public void onModuleLoad() {
TRId trId=new TRId();
//For example Tabular Resource 1 and table 1
trId.setId("1");
trId.setTableId("1");
ColumnExpressionPanel expressionPanel=new ColumnExpressionPanel("0", "Attribute", "Integer");
RootPanel.get().add(expressionPanel);
ColumnExpressionDialog expressionDialog=new ColumnExpressionDialog("0", ColumnTypeCode.ATTRIBUTE, ColumnDataType.Integer);
RootPanel.get().add(expressionDialog);
Log.info("Hello!");
}

View File

@ -0,0 +1,45 @@
package org.gcube.portlets.user.td.expressionwidget.shared.column;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum ColumnDataType {
Boolean("Boolean"),
Geometry("Geometry"),
Integer("Integer"),
Numeric("Numeric"),
Text("Text");
/**
* @param text
*/
private ColumnDataType(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
public List<String> getColumnDataTypes(){
List<String> types=new ArrayList<String>();
types.add(Boolean.toString());
types.add(Geometry.toString());
types.add(Integer.toString());
types.add(Numeric.toString());
types.add(Text.toString());
return types;
}
}

View File

@ -0,0 +1,66 @@
package org.gcube.portlets.user.td.expressionwidget.shared.column;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public enum ColumnTypeCode {
ANNOTATION("ANNOTATION"),
ATTRIBUTE("ATTRIBUTE"),
CODE("CODE"),
CODEDESCRIPTION("CODEDESCRIPTION"),
CODENAME("CODENAME"),
DIMENSION("DIMENSION"),
MEASURE("MESAURE"),
TIMEDIMENSION("TIMEDIMENSION");
/**
* @param text
*/
private ColumnTypeCode(final String id) {
this.id = id;
}
private final String id;
@Override
public String toString() {
return id;
}
public List<String> getColumnDataTypes(){
List<String> types=new ArrayList<String>();
types.add(ANNOTATION.toString());
types.add(ATTRIBUTE.toString());
types.add(CODE.toString());
types.add(CODEDESCRIPTION.toString());
types.add(CODENAME.toString());
types.add(DIMENSION.toString());
types.add(MEASURE.toString());
types.add(TIMEDIMENSION.toString());
return types;
}
public List<String> getColumnDataTypesLabel(){
List<String> types=new ArrayList<String>();
types.add("Annotation");
types.add("Attribute");
types.add("Code");
types.add("Code Description");
types.add("Code Name");
types.add("Dimension");
types.add("Measure");
types.add("Time Dimension");
return types;
}
}

View File

@ -0,0 +1,5 @@
package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf;
public class ConstantList {
}