Fixed Panel layout

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@114711 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-05-08 14:01:07 +00:00
parent 997d4d7f96
commit f614d40f30
20 changed files with 1262 additions and 385 deletions

View File

@ -27,15 +27,17 @@
<!-- <entry-point
class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' /> -->
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
<!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" />
<!-- Specify the paths for translatable code -->
<source path='client' />

View File

@ -63,12 +63,10 @@ public class ColumnExpressionPanel extends FramedPanel {
private static final String RULE_PLACE_HOLDER_ID = "Column";
private enum ColumnExpressionPanelType {
MultiColumnFilter, ColumnFilter, RowDeleteByExpression, Template, Rule;
ColumnFilter, RowDeleteByExpression, Template, Rule;
}
private static final String WIDTH_MULTI = "642px";
private static final String HEIGHT_MULTI = "290px";
private static final String WIDTH = "648px";
private static final String WIDTH = "658px";
private static final String HEIGHT = "364px";
private static final String RULE_HEIGHT = "388px";
@ -77,7 +75,6 @@ public class ColumnExpressionPanel extends FramedPanel {
private TemplateColumnExpressionDialog parentTemplateDialog;
private ColumnFilterDialog parentFilterDialog;
private RowsDeleteByExpressionDialog parentRowsDeleteByExpressionDialog;
private MultiColumnFilterTabPanel parentMultiColumnFilterTabPanel;
private ColumnData column;
private ArrayList<ColumnData> columns;
@ -100,26 +97,7 @@ public class ColumnExpressionPanel extends FramedPanel {
private FieldLabel comboDataTypeLabel;
/**
*
* @param parentMultiColumnFilterTabPanel
* @param column
* @param eventBus
*/
public ColumnExpressionPanel(
MultiColumnFilterTabPanel parentMultiColumnFilterTabPanel,
ColumnData column, EventBus eventBus) {
super();
setWidth(WIDTH_MULTI);
setHeight(HEIGHT_MULTI);
type = ColumnExpressionPanelType.MultiColumnFilter;
this.parentMultiColumnFilterTabPanel = parentMultiColumnFilterTabPanel;
this.column = column;
this.columns = null;
Log.debug("Column:" + column);
createOnMultiColumnFilter();
}
/**
*
@ -992,16 +970,7 @@ public class ColumnExpressionPanel extends FramedPanel {
notExp);
break;
case MultiColumnFilter:
try {
exp = conditionWidget.getExpression();
} catch (ConditionTypeMapException e) {
Log.debug(e.getLocalizedMessage());
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return;
}
parentMultiColumnFilterTabPanel.applyFilter(column, exp);
break;
default:
break;
}
@ -1022,8 +991,6 @@ public class ColumnExpressionPanel extends FramedPanel {
case RowDeleteByExpression:
parentRowsDeleteByExpressionDialog.close();
break;
case MultiColumnFilter:
break;
default:
break;
}

View File

@ -1,21 +1,16 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.expression.ConditionOnMultiColumnWidget;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.TabResourceType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
@ -29,9 +24,7 @@ import com.sencha.gxt.widget.core.client.container.Viewport;
*
*/
public class ExpressionWidgetEntry implements EntryPoint {
private EventBus eventBus;
private TRId trId;
private ArrayList<ColumnData> columns;
private static final String JSP_TAG_ID = "tdp";
public void onModuleLoad() {
@ -45,9 +38,10 @@ public class ExpressionWidgetEntry implements EntryPoint {
// TabularResource: [ id=86, type=STANDARD, lastTable=[ id=1159,
// type=Generic]]
// EventBus eventBus= new SimpleEventBus();
EventBus eventBus= new SimpleEventBus();
trId = new TRId("86", TabResourceType.STANDARD, "1159");
// String columnName="zwqvvx";
String columnName="zwqvvx";
// Column Expression Dialog
// ColumnExpressionDialog expressionDialog=new
@ -57,9 +51,9 @@ public class ExpressionWidgetEntry implements EntryPoint {
// Column Filter Dialog
// id=2, tableId=8, tableType=Generic
// ColumnFilterDialog columnFilterDialog=new ColumnFilterDialog(trId,
// columnName, eventBus);
// columnFilterDialog.show();
ColumnFilterDialog columnFilterDialog=new ColumnFilterDialog(trId,
columnName, eventBus);
columnFilterDialog.show();
// Multi Column Filter Dialog
// MultiColumnFilterDialog multiColumnFilterDialog= new
@ -67,9 +61,9 @@ public class ExpressionWidgetEntry implements EntryPoint {
// multiColumnFilterDialog.show();
// Replace Column By Expression Dialog
// ReplaceColumnByExpressionDialog replaceColumnByExpression= new
// ReplaceColumnByExpressionDialog(trId, columnName, eventBus);
// replaceColumnByExpression.show();
//ReplaceColumnByExpressionDialog replaceColumnByExpression= new
//ReplaceColumnByExpressionDialog(trId, columnName, eventBus);
//replaceColumnByExpression.show();
// HelpReplaceColumnByExpressionDialog
// HelpReplaceColumnByExpressionDialog help= new
@ -77,29 +71,19 @@ public class ExpressionWidgetEntry implements EntryPoint {
// help.show();
// Replace Expression Dialog
// ColumnMockUp columnMockUp=new ColumnMockUp(null, null, "TestMock",
// ColumnTypeCode.ATTRIBUTE, ColumnDataType.Text,"");
// ReplaceExpressionDialog replaceExpressionDialog=new
// ReplaceExpressionDialog(columnMockUp,trId,eventBus);
// replaceExpressionDialog.show();
retrieveColumns();
//ColumnMockUp columnMockUp=new ColumnMockUp(null, null, "TestMock",
//ColumnTypeCode.ATTRIBUTE, ColumnDataType.Text,"");
//ReplaceExpressionDialog replaceExpressionDialog=new
//ReplaceExpressionDialog(columnMockUp,trId,eventBus);
//replaceExpressionDialog.show();
/*MultiColumnFilterDialog cond = new MultiColumnFilterDialog(trId, eventBus);
cond.show();
*/
}
private void create() {
try {
ConditionOnMultiColumnWidget cond = new ConditionOnMultiColumnWidget(
columns);
startInDevMode(cond);
} catch (Throwable e) {
Log.error("Errore: " + e.getLocalizedMessage());
e.printStackTrace();
}
}
private void startInDevMode(ConditionOnMultiColumnWidget cond) {
protected void startInDevMode(ConditionOnMultiColumnWidget cond) {
try {
RootPanel root = RootPanel.get(JSP_TAG_ID);
@ -160,37 +144,5 @@ public class ExpressionWidgetEntry implements EntryPoint {
}
private void retrieveColumns() {
TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
}
}
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.debug("Retrived column: " + result);
columns = result;
create();
}
});
}
}

View File

@ -0,0 +1,830 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.expression.ConditionOnMultiColumnWidget;
import org.gcube.portlets.user.td.expressionwidget.client.notification.ExpressionWrapperNotification;
import org.gcube.portlets.user.td.expressionwidget.client.properties.ColumnDataTypeProperties;
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnDataTypeElement;
import org.gcube.portlets.user.td.expressionwidget.client.store.ColumnDataTypeStore;
import org.gcube.portlets.user.td.expressionwidget.shared.exception.ConditionTypeMapException;
import org.gcube.portlets.user.td.expressionwidget.shared.model.logical.C_Not;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleScopeType;
import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDBaseColumnRuleType;
import org.gcube.portlets.user.td.gwtservice.shared.rule.type.TDRuleColumnType;
import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.expression.C_ExpressionContainer;
import org.gcube.portlets.user.td.widgetcommonevent.client.expression.ExpressionWrapper;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnMockUp;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
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.cell.core.client.form.ComboBoxCell.TriggerAction;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ListStore;
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;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
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.FieldSet;
import com.sencha.gxt.widget.core.client.form.TextArea;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.info.Info;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MultiColumnExpressionPanel extends FramedPanel {
private static final String RULE_DESCRIPTION_HEIGHT = "44px";
private static final String RULE_PLACE_HOLDER_ID = "Column";
private enum MultiColumnExpressionPanelType {
ColumnFilter, RowDeleteByExpression, Template, Rule;
}
private static final String WIDTH = "888px";
private static final String HEIGHT = "352px";
private static final String RULE_HEIGHT = "388px";
private MultiColumnExpressionPanelType type;
private TemplateColumnExpressionDialog parentTemplateDialog;
private MultiColumnFilterDialog parentMultiFilterDialog;
private RowsDeleteByExpressionDialog parentRowsDeleteByExpressionDialog;
private ColumnData column;
private ArrayList<ColumnData> columns;
private TextButton btnApply;
private TextButton btnClose;
private FieldSet conditionsField;
private ConditionOnMultiColumnWidget conditionWidget;
private ComboBox<ColumnData> comboCols;
private RuleDialog parentRuleDialog;
private RuleDescriptionData initialRuleDescriptionData;
private TextField ruleName;
private TextArea ruleDescription;
private ComboBox<ColumnDataTypeElement> comboDataType;
private FieldLabel comboDataTypeLabel;
/**
*
* @param parentMultiColumnFilterDialog
* @param column
* @param columns
* @param eventBus
*/
public MultiColumnExpressionPanel(MultiColumnFilterDialog parentMultiColumnFilterDialog,
ArrayList<ColumnData> columns, EventBus eventBus) {
super();
setWidth(WIDTH);
setHeight(HEIGHT);
type = MultiColumnExpressionPanelType.ColumnFilter;
this.parentMultiFilterDialog = parentMultiColumnFilterDialog;
this.columns = columns;
Log.debug("Column:" + column);
createOnFilter();
}
/**
*
* @param parentRowsDeleteByExpressionDialog
* @param column
* @param columns
* @param eventBus
*/
public MultiColumnExpressionPanel(
RowsDeleteByExpressionDialog parentRowsDeleteByExpressionDialog,
ColumnData column, ArrayList<ColumnData> columns, EventBus eventBus) {
super();
setWidth(WIDTH);
setHeight(RULE_HEIGHT);
type = MultiColumnExpressionPanelType.RowDeleteByExpression;
this.parentRowsDeleteByExpressionDialog = parentRowsDeleteByExpressionDialog;
this.column = column;
this.columns = columns;
Log.debug("Column:" + column);
createOnRowsDeleteByExpression();
}
/**
*
* @param parentColumnExpressionDialog
* @param column
* @param eventBus
*/
public MultiColumnExpressionPanel(
TemplateColumnExpressionDialog parentColumnExpressionDialog,
ColumnData column, EventBus eventBus) {
super();
setWidth(WIDTH);
setHeight(HEIGHT);
type = MultiColumnExpressionPanelType.Template;
this.parentTemplateDialog = parentColumnExpressionDialog;
this.column = column;
this.columns = null;
Log.debug("Column:" + column);
createOnTemplate();
}
/**
*
* @param parentRuleDialog
* @param eventBus
*/
public MultiColumnExpressionPanel(RuleDialog parentRuleDialog, EventBus eventBus) {
super();
setWidth(WIDTH);
setHeight(HEIGHT);
type = MultiColumnExpressionPanelType.Rule;
this.parentRuleDialog = parentRuleDialog;
this.column = null;
this.columns = null;
Log.debug("Column:" + column);
createOnRule();
}
public MultiColumnExpressionPanel(RuleDialog parentRuleDialog,
RuleDescriptionData ruleDescriptionData, EventBus eventBus) {
super();
setWidth(WIDTH);
setHeight(HEIGHT);
type = MultiColumnExpressionPanelType.Rule;
this.parentRuleDialog = parentRuleDialog;
this.initialRuleDescriptionData = ruleDescriptionData;
this.column = null;
this.columns = null;
Log.debug("Column:" + column);
createOnRule();
}
protected void createOnRule() {
forceLayoutOnResize = true;
setBodyBorder(false);
setHeaderVisible(false);
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
basicLayout.setAdjustForScroll(true);
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
flowButton.setPack(BoxLayoutPack.CENTER);
conditionsField = new FieldSet();
conditionsField.setHeadingText("Conditions");
conditionsField.setCollapsible(false);
conditionWidget = new ConditionOnMultiColumnWidget(columns);
Log.debug("ConditionWidget" + conditionWidget);
conditionsField.add(conditionWidget);
btnApply = new TextButton("Save");
btnApply.setIcon(ExpressionResources.INSTANCE.ruleColumnAdd());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Save rule");
btnApply.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Save");
applySeleceted();
}
});
btnClose = new TextButton("Close");
btnClose.setIcon(ExpressionResources.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Cancel rule");
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Close");
close();
}
});
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
basicLayout.add(conditionsField, new VerticalLayoutData(1, -1,
new Margins(1)));
basicLayout.add(flowButton, new VerticalLayoutData(1, 36, new Margins(
5, 2, 5, 2)));
add(basicLayout);
if (initialRuleDescriptionData == null) {
conditionWidget.disable();
} else {
updateCondition();
}
}
@SuppressWarnings("unused")
private void createColumnMockUp(VerticalLayoutContainer propertiesLayout) {
ruleName = new TextField();
ruleName.setToolTip("Rule Name");
if (initialRuleDescriptionData != null) {
ruleName.setValue(initialRuleDescriptionData.getName());
}
FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Rule Name");
ruleDescription = new TextArea();
ruleDescription.setHeight(RULE_DESCRIPTION_HEIGHT);
ruleDescription.setToolTip("Rule Description");
if (initialRuleDescriptionData != null) {
ruleDescription.setValue(initialRuleDescriptionData
.getDescription());
}
FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription,
"Rule Description");
// comboDataType
ColumnDataTypeProperties propsDataType = GWT
.create(ColumnDataTypeProperties.class);
ListStore<ColumnDataTypeElement> storeComboDataType = new ListStore<ColumnDataTypeElement>(
propsDataType.id());
storeComboDataType.addAll(ColumnDataTypeStore.getAttributeType());
comboDataType = new ComboBox<ColumnDataTypeElement>(
storeComboDataType, propsDataType.label());
Log.trace("ComboDataType created");
addHandlersForComboAttributeType(propsDataType.label());
comboDataType.setEmptyText("Select a column type...");
comboDataType.setWidth(191);
comboDataType.setTypeAhead(true);
comboDataType.setTriggerAction(TriggerAction.ALL);
if (initialRuleDescriptionData != null) {
Log.debug("Initial RuleDescriptionData: "
+ initialRuleDescriptionData);
ColumnDataType cdt = retrieveColumnDataType();
if (cdt != null) {
Log.debug("Retrieved column data type: " + cdt);
ColumnDataTypeElement cdte = ColumnDataTypeStore
.selectedAttributeElement(cdt);
if (cdte != null) {
comboDataType.setValue(cdte);
}
} else {
Log.debug("Retrieved column data type null");
}
}
comboDataTypeLabel = new FieldLabel(comboDataType,
"Data Type");
propertiesLayout.add(ruleNameLabel, new VerticalLayoutData(1, -1,
new Margins(0)));
propertiesLayout.add(ruleDescriptionLabel, new VerticalLayoutData(1,
-1, new Margins(0)));
propertiesLayout.add(comboDataTypeLabel, new VerticalLayoutData(1,
-1, new Margins(0)));
}
private ColumnDataType retrieveColumnDataType() {
TDRuleColumnType tdRuleColumnType = initialRuleDescriptionData
.getTdRuleColumnType();
if (tdRuleColumnType instanceof TDBaseColumnRuleType) {
TDBaseColumnRuleType tdBaseColumnRuleType = (TDBaseColumnRuleType) tdRuleColumnType;
return tdBaseColumnRuleType.getColumnDataType();
}
return null;
}
protected void addHandlersForComboAttributeType(
final LabelProvider<ColumnDataTypeElement> labelProvider) {
comboDataType
.addSelectionHandler(new SelectionHandler<ColumnDataTypeElement>() {
public void onSelection(
SelectionEvent<ColumnDataTypeElement> event) {
Info.display(
"Attribute Type Selected",
"You selected "
+ (event.getSelectedItem() == null ? "nothing"
: labelProvider.getLabel(event
.getSelectedItem())
+ "!"));
Log.debug("ComboAttributeType selected: "
+ event.getSelectedItem());
ColumnDataTypeElement attributeType = event
.getSelectedItem();
updateDataType(attributeType.getType());
}
});
}
protected void updateCondition() {
ColumnMockUp columnMockUp = retrieveColumnMockUp();
if (columnMockUp != null) {
column = new ColumnData();
column.setId(columnMockUp.getId());
column.setColumnId(columnMockUp.getColumnId());
column.setLabel(columnMockUp.getLabel());
column.setDataTypeName(columnMockUp.getColumnDataType().toString());
conditionWidget.update(columns);
conditionWidget.enable();
} else {
conditionWidget.disable();
}
forceLayout();
}
protected ColumnMockUp retrieveColumnMockUp() {
ColumnMockUp columnMockUp = null;
ColumnDataTypeElement columnDataTypeElement = comboDataType
.getCurrentValue();
if (columnDataTypeElement != null) {
ColumnDataType dataType = columnDataTypeElement.getType();
if (dataType != null) {
columnMockUp = new ColumnMockUp(null, RULE_PLACE_HOLDER_ID,
dataType, RULE_PLACE_HOLDER_ID);
} else {
}
} else {
}
return columnMockUp;
}
protected ColumnMockUp checkEnterData() {
ColumnMockUp columnMockUp = null;
String ruleNameS = ruleName.getCurrentValue();
if (ruleNameS != null && !ruleNameS.isEmpty()) {
String ruleDescriptionS = ruleDescription.getCurrentValue();
if (ruleDescriptionS != null && !ruleDescriptionS.isEmpty()) {
ColumnDataTypeElement columnDataTypeElement = comboDataType
.getCurrentValue();
if (columnDataTypeElement != null) {
ColumnDataType dataType = columnDataTypeElement.getType();
if (dataType != null) {
columnMockUp = new ColumnMockUp(null,
RULE_PLACE_HOLDER_ID, dataType,
RULE_PLACE_HOLDER_ID);
} else {
UtilsGXT3.alert("Attention",
"Column data type not selected!");
}
} else {
UtilsGXT3.alert("Attention",
"Column data type not selected!");
}
} else {
UtilsGXT3.alert("Attention",
"Enter a valid description for the rule!");
}
} else {
UtilsGXT3.alert("Attention", "Enter a valid name for the rule!");
}
return columnMockUp;
}
protected RuleDescriptionData retrieveRuleDescriptionData(C_Expression exp) {
ColumnMockUp columnMockUp = checkEnterData();
if (columnMockUp != null) {
if (exp != null) {
String ruleNameS = ruleName.getCurrentValue();
String ruleDescriptionS = ruleDescription.getCurrentValue();
TDBaseColumnRuleType tdBaseColumnRule = new TDBaseColumnRuleType(
columnMockUp.getColumnDataType());
RuleDescriptionData ruleDescriptionData = new RuleDescriptionData(
0, ruleNameS, ruleDescriptionS, null, null,
RuleScopeType.COLUMN, tdBaseColumnRule, exp);
return ruleDescriptionData;
} else {
UtilsGXT3.alert("Attention", "Enter a valid condition!");
return null;
}
} else {
return null;
}
}
protected void updateDataType(ColumnDataType type) {
Log.debug("Update ColumnDataType: " + type);
updateCondition();
}
protected void createOnTemplate() {
// Important: fixed rendering of widgets
forceLayoutOnResize = true;
setBodyBorder(false);
setHeaderVisible(false);
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
basicLayout.setAdjustForScroll(true);
// basicLayout.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
flowButton.setPack(BoxLayoutPack.CENTER);
conditionsField = new FieldSet();
conditionsField.setHeadingText("Conditions");
conditionsField.setCollapsible(false);
conditionWidget = new ConditionOnMultiColumnWidget(columns);
Log.debug("ConditionWidget" + conditionWidget);
conditionsField.add(conditionWidget);
btnApply = new TextButton("Apply");
btnApply.setIcon(ExpressionResources.INSTANCE.apply());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Apply rule");
btnApply.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Apply");
applySeleceted();
}
});
btnClose = new TextButton("Close");
btnClose.setIcon(ExpressionResources.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Cancel rule");
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Close");
close();
}
});
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
basicLayout.add(conditionsField, new VerticalLayoutData(1, -1,
new Margins(1)));
basicLayout.add(flowButton, new VerticalLayoutData(1, 36, new Margins(
5, 2, 5, 2)));
add(basicLayout);
}
protected void createOnFilter() {
forceLayoutOnResize = true;
setBodyBorder(false);
setHeaderVisible(false);
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
basicLayout.setAdjustForScroll(false);
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
flowButton.setPack(BoxLayoutPack.CENTER);
conditionsField = new FieldSet();
conditionsField.setHeadingText("Conditions");
conditionsField.setCollapsible(false);
conditionWidget = new ConditionOnMultiColumnWidget(columns);
Log.debug("ConditionWidget" + conditionWidget);
conditionsField.add(conditionWidget);
btnApply = new TextButton("Apply");
btnApply.setIcon(ExpressionResources.INSTANCE.applyFilter());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Apply Filter");
btnApply.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Apply");
applySeleceted();
}
});
if (column == null) {
btnApply.disable();
}
btnClose = new TextButton("Close");
btnClose.setIcon(ExpressionResources.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Cancel filter");
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Close");
close();
}
});
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
basicLayout.add(conditionsField, new VerticalLayoutData(1, -1,
new Margins(1)));
basicLayout.add(flowButton, new VerticalLayoutData(1, 36, new Margins(
5, 2, 5, 2)));
add(basicLayout);
}
protected void createOnRowsDeleteByExpression() {
forceLayoutOnResize = true;
setBodyBorder(false);
setHeaderVisible(false);
VerticalLayoutContainer basicLayout = new VerticalLayoutContainer();
basicLayout.setAdjustForScroll(true);
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
flowButton.setPack(BoxLayoutPack.CENTER);
//
conditionsField = new FieldSet();
conditionsField.setHeadingText("Conditions");
conditionsField.setCollapsible(false);
conditionWidget = new ConditionOnMultiColumnWidget(columns);
Log.debug("ConditionWidget" + conditionWidget);
conditionsField.add(conditionWidget);
btnApply = new TextButton("Delete");
btnApply.setIcon(ExpressionResources.INSTANCE
.tableRowDeleteByExpression());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Delete rows");
btnApply.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Delete");
applySeleceted();
}
});
if (column == null) {
btnApply.disable();
}
btnClose = new TextButton("Close");
btnClose.setIcon(ExpressionResources.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Cancel filter");
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Close");
close();
}
});
flowButton.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
basicLayout.add(conditionsField, new VerticalLayoutData(1, -1,
new Margins(1)));
basicLayout.add(flowButton, new VerticalLayoutData(1, 36, new Margins(
5, 2, 5, 2)));
add(basicLayout);
}
protected void setSelectedColumn() {
if (column == null) {
} else {
ColumnTypeCode typeCode = ColumnTypeCode
.getColumnTypeCodeFromId(column.getTypeCode());
HTML errorMessage;
if (typeCode == null) {
errorMessage = new HTML(
"This column has column data type null!");
UtilsGXT3.alert("Error",
"This column has column data type null!!");
return;
}
switch (typeCode) {
case ANNOTATION:
case ATTRIBUTE:
case CODE:
case CODEDESCRIPTION:
case CODENAME:
case MEASURE:
comboCols.setValue(column);
break;
case DIMENSION:
case TIMEDIMENSION:
errorMessage = new HTML(
"This type of column is not supported for now!");
add(errorMessage);
UtilsGXT3.alert("Error",
"This type of column is not supported for now!");
break;
default:
errorMessage = new HTML(
"This type of column is not supported for now!");
add(errorMessage);
UtilsGXT3.alert("Error",
"This type of column is not supported for now!");
break;
}
}
}
protected SelectionHandler<ColumnData> comboColsSelection() {
SelectionHandler<ColumnData> selectionHandler = new SelectionHandler<ColumnData>() {
@Override
public void onSelection(SelectionEvent<ColumnData> event) {
if (event.getSelectedItem() != null) {
ColumnData col = event.getSelectedItem();
Log.debug("Col selected:" + col.toString());
column = col;
btnApply.enable();
conditionWidget.update(columns);
} else {
column = null;
btnApply.disable();
conditionWidget.update(null);
}
}
};
return selectionHandler;
}
protected void applySeleceted() {
Log.debug("Apply: " + column);
C_Expression exp;
C_ExpressionContainer condContainer = null;
ExpressionWrapper exWrapper = null;
switch (type) {
case Template:
try {
exp = conditionWidget.getExpression();
} catch (ConditionTypeMapException e) {
Log.debug(e.getLocalizedMessage());
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return;
}
condContainer = new C_ExpressionContainer();
condContainer.setId(C_ExpressionContainer.Contains.C_Expression);
condContainer.setExp(exp);
condContainer.setReadableExpression(conditionWidget
.getReadableExpression());
exWrapper = new ExpressionWrapper(column.getTrId(), column,
condContainer);
ExpressionWrapperNotification expressionWrapperNotification = new ExpressionWrapperNotification(
exWrapper);
Log.debug("Notification: " + expressionWrapperNotification);
parentTemplateDialog.onExpression(expressionWrapperNotification);
break;
case Rule:
if (!conditionWidget.isEnabled()) {
UtilsGXT3.alert("Attention", "Fill all field!");
return;
}
try {
exp = conditionWidget.getExpression();
} catch (ConditionTypeMapException e) {
Log.debug(e.getLocalizedMessage());
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return;
}
RuleDescriptionData ruleDescriptionData = retrieveRuleDescriptionData(exp);
if (ruleDescriptionData != null) {
parentRuleDialog.addRule(ruleDescriptionData);
}
break;
case ColumnFilter:
try {
exp = conditionWidget.getExpression();
} catch (ConditionTypeMapException e) {
Log.debug(e.getLocalizedMessage());
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return;
}
parentMultiFilterDialog.applyFilter(column, exp);
break;
case RowDeleteByExpression:
try {
exp = conditionWidget.getExpression();
} catch (ConditionTypeMapException e) {
Log.debug(e.getLocalizedMessage());
UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return;
}
C_Expression notExp = new C_Not(exp);
parentRowsDeleteByExpressionDialog.deleteRowsByExpression(column,
notExp);
break;
default:
break;
}
}
protected void close() {
switch (type) {
case Template:
parentTemplateDialog.close();
break;
case Rule:
parentRuleDialog.close();
break;
case ColumnFilter:
parentMultiFilterDialog.close();
break;
case RowDeleteByExpression:
parentRowsDeleteByExpressionDialog.close();
break;
default:
break;
}
}
}

View File

@ -1,53 +1,75 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.resources.ExpressionResources;
import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceAsync;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.FilterColumnSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.OperationResult;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MultiColumnFilterDialog extends Window {
protected String WIDTH = "660px";
protected String HEIGHT = "480px";
protected C_Expression exp = null;
protected TRId trId;
protected EventBus eventBus;
public class MultiColumnFilterDialog extends Window implements MonitorDialogListener {
private static final String WIDTH = "900px";
private static final String HEIGHT = "388px";
private MultiColumnExpressionPanel multiColumnExpressionPanel;
private C_Expression exp = null;
private TRId trId;
private ColumnData column = null;
private String columnLocalId = null;
private ArrayList<ColumnData> columns=null;
private ArrayList<ColumnData> removableColumn=null;
private EventBus eventBus;
private FilterColumnSession filterColumnSession;
public MultiColumnFilterDialog(TRId trId, EventBus eventBus) {
initWindow();
this.eventBus = eventBus;
this.trId = trId;
initWindow();
create();
loadColumns();
}
protected void create(){
final MultiColumnFilterPanel mcfPanel=new MultiColumnFilterPanel(this, trId,eventBus);
add(mcfPanel);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Filter");
setHeadingText("New Filter");
setClosable(true);
getHeader().setIcon(ExpressionResources.INSTANCE.filter());
}
/**
* {@inheritDoc}
*/
@ -57,16 +79,182 @@ public class MultiColumnFilterDialog extends Window {
closeBtn.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
close();
}
});
}
protected void create() {
multiColumnExpressionPanel = new MultiColumnExpressionPanel(this, columns,
eventBus);
add(multiColumnExpressionPanel);
}
public C_Expression getExpression() {
return exp;
}
protected void setExpression(C_Expression exp) {
Log.debug("New Expression set:" + exp.toString());
this.exp = exp;
}
protected void applyFilter(ColumnData column,C_Expression exp) {
this.exp = exp;
this.column= column;
callApplyFilter();
}
protected void loadColumns() {
TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
caught.getMessage());
}
}
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.debug("Retrived column: " + result);
columns = result;
sanitizesColumns();
create();
}
});
}
protected void sanitizesColumns() {
removableColumn=new ArrayList<ColumnData>();
for(ColumnData c:columns){
if(c.getTypeCode().compareTo(ColumnTypeCode.DIMENSION.toString())==0||
c.getTypeCode().compareTo(ColumnTypeCode.TIMEDIMENSION.toString())==0 ){
removableColumn.add(c);
} else {
if(columnLocalId!=null && c.getColumnId().compareTo(columnLocalId)==0){
column=c;
}
}
}
columns.removeAll(removableColumn);
}
protected void callApplyFilter() {
filterColumnSession = new FilterColumnSession(column, exp);
Log.debug(filterColumnSession.toString());
ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession,
new AsyncCallback<String>() {
@Override
public void onSuccess(String taskId) {
Log.debug("Submitted column filter");
openMonitorDialog(taskId);
}
@Override
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
caught.getLocalizedMessage());
} else {
Log.error("Error submitting the column filter: "
+ caught.getLocalizedMessage());
caught.printStackTrace();
UtilsGXT3
.alert("Error submitting the column filter",
caught.getLocalizedMessage());
}
}
}
}
});
}
protected void close() {
hide();
}
// /
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);
monitorDialog.addProgressDialogListener(this);
monitorDialog.show();
}
@Override
public void operationComplete(OperationResult operationResult) {
ChangeTableWhy why = ChangeTableWhy.TABLEUPDATED;
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.COLUMNFILTER, operationResult.getTrId(), why);
eventBus.fireEvent(changeTableRequestEvent);
close();
}
@Override
public void operationFailed(Throwable caught, String reason, String details) {
UtilsGXT3.alert(reason, details);
close();
}
@Override
public void operationStopped(OperationResult operationResult, String reason, String details) {
ChangeTableWhy why = ChangeTableWhy.TABLECURATION;
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.COLUMNFILTER, operationResult.getTrId(), why);
eventBus.fireEvent(changeTableRequestEvent);
close();
}
@Override
public void operationAborted() {
close();
}
@Override
public void operationPutInBackground() {
close();
}
}

View File

@ -1,111 +0,0 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.expressionwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent;
import com.sencha.gxt.widget.core.client.event.BeforeShowEvent.BeforeShowHandler;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MultiColumnFilterPanel extends SimplePanel {
protected String WIDTH = "648px";
protected String HEIGHT = "444px";
protected TRId trId;
protected ArrayList<ColumnData> columns;
protected EventBus eventBus;
protected MultiColumnFilterDialog multiColumnFilterDialog;
public MultiColumnFilterPanel(
MultiColumnFilterDialog multiColumnFilterDialog, TRId trId,
EventBus eventBus) {
super();
Log.debug("Create MultiColumnFilterPanel");
setHeight(HEIGHT);
setWidth(WIDTH);
this.multiColumnFilterDialog = multiColumnFilterDialog;
this.trId = trId;
this.eventBus = eventBus;
UtilsGXT3.mask(this.getElement());
load(trId);
}
protected void create() {
UtilsGXT3.umask(this.getElement());
VerticalLayoutContainer vl = new VerticalLayoutContainer();
vl.setBorders(false);
final MultiColumnFilterTabPanel mcfTabPanel = new MultiColumnFilterTabPanel(
this, eventBus);
vl.add(mcfTabPanel);
mcfTabPanel.addBeforeShowHandler(new BeforeShowHandler() {
public void onBeforeShow(BeforeShowEvent event) {
mcfTabPanel.forceLayout();
}
});
final SimplePanel bo = new SimplePanel();
bo.add(new HTML("Expression"));
vl.add(bo);
add(vl);
}
protected void load(TRId trId) {
TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<ColumnData>>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving columns: "
+ caught.getMessage());
UtilsGXT3.alert("Error",
"Error retrieving columns: "+caught.getMessage());
}
}
}
@Override
public void onSuccess(ArrayList<ColumnData> result) {
Log.debug("Retrived column: " + result);
columns = result;
create();
}
});
}
}

View File

@ -1,91 +0,0 @@
package org.gcube.portlets.user.td.expressionwidget.client;
import java.util.ArrayList;
import java.util.HashMap;
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
import com.allen_sauer.gwt.log.client.Log;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.TabItemConfig;
import com.sencha.gxt.widget.core.client.TabPanel;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MultiColumnFilterTabPanel extends TabPanel {
protected String WIDTH = "648px";
protected String HEIGHT = "290px";
protected EventBus eventBus;
protected MultiColumnFilterPanel multiColumnFilterPanel;
protected ArrayList<ColumnData> columns;
protected HashMap<ColumnData, C_Expression> cexpressionList;
public MultiColumnFilterTabPanel(
MultiColumnFilterPanel multiColumnFilterPanel, EventBus eventBus) {
super();
Log.debug("Create MultiColumnFilterTabPanel");
setHeight(HEIGHT);
setWidth(WIDTH);
this.multiColumnFilterPanel = multiColumnFilterPanel;
this.eventBus = eventBus;
this.columns = multiColumnFilterPanel.columns;
setBodyBorder(false);
setBorders(false);
setAnimScroll(true);
setTabScroll(true);
setCloseContextMenu(false);
startTabs();
}
public void startTabs() {
Log.debug("Start MultiColumnFilterTabPanel Tabs");
addFilterColumnsPanel();
setActiveWidget(getWidget(0));
}
protected void addFilterColumnsPanel() {
cexpressionList = new HashMap<ColumnData, C_Expression>();
TabItemConfig columnFilterItemConf;
ColumnExpressionPanel columnExpressionPanel;
for (ColumnData col : columns) {
columnFilterItemConf = new TabItemConfig(col.getLabel(), false);
if (col.getTypeCode().compareTo(
ColumnTypeCode.ANNOTATION.toString()) == 0
|| col.getTypeCode().compareTo(
ColumnTypeCode.ATTRIBUTE.toString()) == 0
|| col.getTypeCode().compareTo(
ColumnTypeCode.CODE.toString()) == 0
|| col.getTypeCode().compareTo(
ColumnTypeCode.CODEDESCRIPTION.toString()) == 0
|| col.getTypeCode().compareTo(
ColumnTypeCode.CODENAME.toString()) == 0
|| col.getTypeCode().compareTo(
ColumnTypeCode.MEASURE.toString()) == 0) {
columnExpressionPanel = new ColumnExpressionPanel(this, col,
eventBus);
add(columnExpressionPanel, columnFilterItemConf);
} else {
}
}
};
protected void applyFilter(ColumnData column, C_Expression exp) {
cexpressionList.put(column, exp);
}
}

View File

@ -40,7 +40,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class ReplaceColumnByExpressionDialog extends Window implements
MonitorDialogListener {
private static final String WIDTH = "880px";
private static final String WIDTH = "890px";
private static final String HEIGHT = "490px";
// private static final String HEIGHT_REDUCE = "404px";

View File

@ -65,7 +65,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
private static final String GEOMETRY_REGEXPR = "(\\s*POINT\\s*\\(\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*\\)\\s*$)"
+ "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)";
private static final String WIDTH = "868px";
private static final String WIDTH = "878px";
private static final String HEIGHT = "454px";
private static final String HEIGHT_REDUCE = "368px";
private static final String PARENT_HEIGHT = "490px";
@ -74,7 +74,7 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
private static final String CONDITIONWIDTH = "818px";
private static final String CONDITIONHEIGHT = "120px";
private static final String CONDITION_LAYOUT_WIDTH = "818px";
private static final String REPLACEWIDTH = "832px";
private static final String REPLACEWIDTH = "842px";
private static final String REPLACEHEIGHT = "120px";
private static final String ALL_ROWS_FIELD_WIDTH = "832px";

View File

@ -33,7 +33,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class ReplaceExpressionDialog extends Window implements
HasExpressionWrapperNotificationListener {
private static final String WIDTH = "880px";
private static final String WIDTH = "890px";
private static final String HEIGHT = "360px";
private ArrayList<ExpressionWrapperNotificationListener> listeners;
private ColumnData column;

View File

@ -49,13 +49,13 @@ public class ReplaceExpressionPanel extends FramedPanel {
private static final String GEOMETRY_REGEXPR = "(\\s*POINT\\s*\\(\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*\\)\\s*$)"
+ "|(\\s*LINESTRING\\s*\\((\\s*(-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*,)+\\s*((-)?\\d+(\\.\\d+)?\\s+(-)?\\d+(\\.\\d+)?\\s*)\\)\\s*$)";
private static final String WIDTH = "868px";
private static final String WIDTH = "878px";
private static final String HEIGHT = "324px";
private static final String HEIGHT_REDUCE = "238px";
private static final String PARENT_HEIGHT = "360px";
private static final String PARENT_HEIGHT_REDUCE = "274px";
private static final String REPLACEWIDTH = "832px";
private static final String REPLACEWIDTH = "842px";
private static final String REPLACEHEIGHT = "120px";
private EventBus eventBus;

View File

@ -28,7 +28,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class RuleDialog extends Window implements
HasRuleDialogNotificationListener {
private static final String WIDTH = "660px";
private static final String WIDTH = "670px";
private static final String HEIGHT = "460px";
private ColumnExpressionPanel columnExpressionPanel;
private EventBus eventBus;

View File

@ -36,7 +36,7 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*/
public class TemplateColumnExpressionDialog extends Window implements
HasExpressionWrapperNotificationListener {
private static final String WIDTH = "660px";
private static final String WIDTH = "670px";
private static final String HEIGHT = "426px";
private ArrayList<ExpressionWrapperNotificationListener> listeners;
private ColumnExpressionPanel columnExpressionPanel;

View File

@ -8,8 +8,10 @@ import java.util.List;
import org.gcube.portlets.user.td.expressionwidget.client.custom.IconButton;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.ArgType;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.ArgTypePropertiesCombo;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.DepthOfExpressionElement;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.DepthOfExpressionStore;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.DepthOfExpressionType;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.DepthOfExpressionTypePropertiesCombo;
import org.gcube.portlets.user.td.expressionwidget.client.multicolumn.DepthOfExpressionElementPropertiesCombo;
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;
@ -34,6 +36,7 @@ import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.ui.HTML;
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;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
@ -56,14 +59,14 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
private static final String SIGN = "ConditionOnMultiColumns";
private static final String HEIGHT = "210px";
private static final String HEIGHT = "268px";
private static final String WIDTH = "612px";
private static final String COMBO_DEPTH_WIDTH = "64px";
private static final String COMBO_FIRST_ELEMENT_COLUMN_WIDTH = "150px";
private static final String COMBO_OPERATOR_WIDTH = "150px";
private static final String COMBO_FIRST_ARG_TYPE_WIDTH = "120px";
private static final String COMBO_OPERATOR_WIDTH = "130px";
private static final String COMBO_FIRST_ARG_TYPE_WIDTH = "80px";
private static final String COMBO_FIRST_ARG_COLUMN_WIDTH = "150px";
private static final String COMBO_SECOND_ARG_TYPE_WIDTH = "120px";
private static final String COMBO_SECOND_ARG_TYPE_WIDTH = "80px";
private static final String COMBO_SECOND_ARG_COLUMN_WIDTH = "150px";
private static final String COMBO_THRESHOLD_WIDTH = "50px";
@ -146,7 +149,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
itemIdBtnDel = "BtnDel" + SIGN;
vert = new VerticalLayoutContainer();
// vert.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1
vert.setScrollMode(ScrollMode.AUTO);// Set In GXT 3.0.1
vert.setAdjustForScroll(true);
setup();
@ -159,16 +162,16 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
// Combo Depth
DepthOfExpressionTypePropertiesCombo propsDepth = GWT
.create(DepthOfExpressionTypePropertiesCombo.class);
DepthOfExpressionElementPropertiesCombo propsDepth = GWT
.create(DepthOfExpressionElementPropertiesCombo.class);
Log.debug("Props: " + propsDepth);
final ListStore<DepthOfExpressionType> storeDepth = new ListStore<DepthOfExpressionType>(
final ListStore<DepthOfExpressionElement> storeDepth = new ListStore<DepthOfExpressionElement>(
propsDepth.id());
storeDepth.addAll(DepthOfExpressionType.asList());
storeDepth.addAll(DepthOfExpressionStore.getDepthFirstRow());
Log.debug("StoreDepth: " + storeDepth);
Log.debug("StoreDepth created");
final ComboBox<DepthOfExpressionType> comboDepth = new ComboBox<DepthOfExpressionType>(
final ComboBox<DepthOfExpressionElement> comboDepth = new ComboBox<DepthOfExpressionElement>(
storeDepth, propsDepth.label());
Log.debug("Combo Depth created");
@ -235,7 +238,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
Log.debug("Combo FirstArgType created");
comboFirstArgType.setEmptyText("Select a column...");
comboFirstArgType.setEmptyText("Type...");
comboFirstArgType.setItemId(itemIdFirstArgType);
comboFirstArgType.setWidth(COMBO_FIRST_ARG_TYPE_WIDTH);
comboFirstArgType.setEditable(false);
@ -286,7 +289,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
Log.debug("Combo SecondArgType created");
comboSecondArgType.setEmptyText("Select a column...");
comboSecondArgType.setEmptyText("Type...");
comboSecondArgType.setItemId(itemIdSecondArgType);
comboSecondArgType.setWidth(COMBO_SECOND_ARG_TYPE_WIDTH);
comboSecondArgType.setEditable(false);
@ -380,18 +383,20 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
// Handlers
comboDepth
.addSelectionHandler(new SelectionHandler<DepthOfExpressionType>() {
.addSelectionHandler(new SelectionHandler<DepthOfExpressionElement>() {
@Override
public void onSelection(
SelectionEvent<DepthOfExpressionType> event) {
SelectionEvent<DepthOfExpressionElement> event) {
if (event.getSelectedItem() != null) {
@SuppressWarnings("unchecked")
ComboBox<DepthOfExpressionType> source = (ComboBox<DepthOfExpressionType>) event
ComboBox<DepthOfExpressionElement> source = (ComboBox<DepthOfExpressionElement>) event
.getSource();
DepthOfExpressionType depth = event
DepthOfExpressionElement depthElement = event
.getSelectedItem();
DepthOfExpressionType depth = depthElement.getType();
if (depth == null) {
Log.debug("Depth Selected: null");
@ -906,7 +911,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
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)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
addBeforeShowHandler(new BeforeShowEvent.BeforeShowHandler() {
@ -923,16 +928,16 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
// Combo Depth
DepthOfExpressionTypePropertiesCombo propsDepth = GWT
.create(DepthOfExpressionTypePropertiesCombo.class);
DepthOfExpressionElementPropertiesCombo propsDepth = GWT
.create(DepthOfExpressionElementPropertiesCombo.class);
Log.debug("Props: " + propsDepth);
final ListStore<DepthOfExpressionType> storeDepth = new ListStore<DepthOfExpressionType>(
final ListStore<DepthOfExpressionElement> storeDepth = new ListStore<DepthOfExpressionElement>(
propsDepth.id());
storeDepth.addAll(DepthOfExpressionType.asList());
storeDepth.addAll(DepthOfExpressionStore.getDepthOtherRows());
Log.debug("StoreDepth: " + storeDepth);
Log.debug("StoreDepth created");
final ComboBox<DepthOfExpressionType> comboDepth = new ComboBox<DepthOfExpressionType>(
final ComboBox<DepthOfExpressionElement> comboDepth = new ComboBox<DepthOfExpressionElement>(
storeDepth, propsDepth.label());
Log.debug("Combo Depth created");
@ -997,7 +1002,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
Log.debug("Combo FirstArgType created");
comboFirstArgType.setEmptyText("Select a column...");
comboFirstArgType.setEmptyText("Type...");
comboFirstArgType.setItemId(itemIdFirstArgType);
comboFirstArgType.setWidth(COMBO_FIRST_ARG_TYPE_WIDTH);
comboFirstArgType.setEditable(false);
@ -1048,7 +1053,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
Log.debug("Combo SecondArgType created");
comboSecondArgType.setEmptyText("Select a column...");
comboSecondArgType.setEmptyText("Type...");
comboSecondArgType.setItemId(itemIdSecondArgType);
comboSecondArgType.setWidth(COMBO_SECOND_ARG_TYPE_WIDTH);
comboSecondArgType.setEditable(false);
@ -1142,18 +1147,21 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
// Handlers
comboDepth
.addSelectionHandler(new SelectionHandler<DepthOfExpressionType>() {
.addSelectionHandler(new SelectionHandler<DepthOfExpressionElement>() {
@Override
public void onSelection(
SelectionEvent<DepthOfExpressionType> event) {
SelectionEvent<DepthOfExpressionElement> event) {
if (event.getSelectedItem() != null) {
@SuppressWarnings("unchecked")
ComboBox<DepthOfExpressionType> source = (ComboBox<DepthOfExpressionType>) event
ComboBox<DepthOfExpressionElement> source = (ComboBox<DepthOfExpressionElement>) event
.getSource();
DepthOfExpressionType depth = event
DepthOfExpressionElement depthElement = event
.getSelectedItem();
DepthOfExpressionType depth = depthElement.getType();
if (depth == null) {
Log.debug("Depth Selected: null");
@ -1668,7 +1676,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
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)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
}
@ -1680,7 +1688,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
}
private void removeCondition(ComboBox<DepthOfExpressionType> source) {
private void removeCondition(ComboBox<DepthOfExpressionElement> source) {
HBoxLayoutContainer horiz = (HBoxLayoutContainer) source.getParent();
int index = vert.getWidgetIndex(horiz);
Log.debug("No concat for index: " + index);
@ -1691,7 +1699,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
}
}
private boolean existCondition(ComboBox<DepthOfExpressionType> source) {
private boolean existCondition(ComboBox<DepthOfExpressionElement> source) {
boolean exist = false;
HBoxLayoutContainer horiz = (HBoxLayoutContainer) source.getParent();
int index = vert.getWidgetIndex(horiz);

View File

@ -30,6 +30,7 @@ import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
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;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.core.client.util.ToggleGroup;
import com.sencha.gxt.data.shared.ListStore;
@ -147,10 +148,12 @@ public class ConditionWidget extends SimpleContainer {
groupMatch.add(radioAny);
groupMatch.setValue(radioAll);
vert = new VerticalLayoutContainer();
// vert.setScrollMode(ScrollMode.AUTO); Set In GXT 3.0.1
vert.setAdjustForScroll(true);
vert = new VerticalLayoutContainer();
vert.setScrollMode(ScrollMode.AUTO);// Set In GXT 3.0.1
vert.setAdjustForScroll(true);
setup();
baseLayout.add(vert, new VerticalLayoutData(1, 1, new Margins(0)));
@ -426,7 +429,7 @@ public class ConditionWidget extends SimpleContainer {
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)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
addBeforeShowHandler(new BeforeShowEvent.BeforeShowHandler() {
@ -705,7 +708,7 @@ public class ConditionWidget extends SimpleContainer {
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)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
}

View File

@ -30,6 +30,7 @@ import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
@ -271,8 +272,10 @@ public class ReplaceWidget extends SimpleContainer {
itemIdHoriz = "Horiz" + sign;
vert = new VerticalLayoutContainer();
// vert.setScrollMode(ScrollMode.AUTO); Set in GXT 3.0.1
vert.setScrollMode(ScrollMode.AUTO);// Set In GXT 3.0.1
vert.setAdjustForScroll(true);
final HBoxLayoutContainer horiz = new HBoxLayoutContainer();
final TextField firstArg = new TextField();
@ -596,7 +599,7 @@ public class ReplaceWidget extends SimpleContainer {
horiz.add(firstArg, new BoxLayoutData(new Margins(0)));
horiz.add(secondArg, new BoxLayoutData(new Margins(0)));
horiz.setItemId(itemIdHoriz);
vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
add(vert, new MarginData(0));
@ -933,7 +936,7 @@ public class ReplaceWidget extends SimpleContainer {
horiz.add(firstArg, new BoxLayoutData(new Margins(0)));
horiz.add(secondArg, new BoxLayoutData(new Margins(0)));
horiz.setItemId(itemIdHoriz);
vert.add(horiz, new VerticalLayoutData(-1, -1, new Margins(1)));
vert.add(horiz, new VerticalLayoutData(1, -1, new Margins(1)));
firstArg.setVisible(true);
secondArg.setVisible(false);

View File

@ -0,0 +1,57 @@
package org.gcube.portlets.user.td.expressionwidget.client.multicolumn;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DepthOfExpressionElement {
private int id; // For insert in table only
private DepthOfExpressionType type;
private String label;
public DepthOfExpressionElement() {
super();
}
public DepthOfExpressionElement(int id, DepthOfExpressionType type,
String label) {
super();
this.id = id;
this.type = type;
this.label = label;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public DepthOfExpressionType getType() {
return type;
}
public void setType(DepthOfExpressionType type) {
this.type = type;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
@Override
public String toString() {
return "DepthOfExpressionElement [id=" + id + ", type=" + type
+ ", label=" + label + "]";
}
}

View File

@ -11,13 +11,13 @@ import com.sencha.gxt.data.shared.PropertyAccess;
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface DepthOfExpressionTypePropertiesCombo extends
PropertyAccess<DepthOfExpressionType> {
public interface DepthOfExpressionElementPropertiesCombo extends
PropertyAccess<DepthOfExpressionElement> {
@Path("name")
ModelKeyProvider<DepthOfExpressionType> id();
@Path("id")
ModelKeyProvider<DepthOfExpressionElement> id();
LabelProvider<DepthOfExpressionType> label();
LabelProvider<DepthOfExpressionElement> label();
}

View File

@ -0,0 +1,68 @@
package org.gcube.portlets.user.td.expressionwidget.client.multicolumn;
import java.io.Serializable;
import java.util.ArrayList;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DepthOfExpressionStore implements Serializable {
private static final long serialVersionUID = -1908324094430432681L;
private static ArrayList<DepthOfExpressionElement> store;
private static DepthOfExpressionElement bottomFirstElement = new DepthOfExpressionElement(
0, DepthOfExpressionType.BOTTOM,
DepthOfExpressionType.BOTTOM.getLabel());
private static DepthOfExpressionElement startAndFirstElement = new DepthOfExpressionElement(
1, DepthOfExpressionType.STARTAND,
DepthOfExpressionType.STARTAND.getLabel());
private static DepthOfExpressionElement startOrFirstElement = new DepthOfExpressionElement(
2, DepthOfExpressionType.STARTOR,
DepthOfExpressionType.STARTOR.getLabel());
private static DepthOfExpressionElement commaOtherElement = new DepthOfExpressionElement(
0, DepthOfExpressionType.COMMA,
DepthOfExpressionType.COMMA.getLabel());
private static DepthOfExpressionElement startAndOtherElement = new DepthOfExpressionElement(
1, DepthOfExpressionType.STARTAND, ", And[");
private static DepthOfExpressionElement startOrOtherElement = new DepthOfExpressionElement(
2, DepthOfExpressionType.STARTOR, ", Or(");
private static DepthOfExpressionElement endAndOtherElement = new DepthOfExpressionElement(
3, DepthOfExpressionType.ENDAND,
DepthOfExpressionType.ENDAND.getLabel());
private static DepthOfExpressionElement endOrOtherElement = new DepthOfExpressionElement(
4, DepthOfExpressionType.ENDOR,
DepthOfExpressionType.ENDOR.getLabel());
public static ArrayList<DepthOfExpressionElement> getDepthFirstRow() {
store = new ArrayList<DepthOfExpressionElement>();
store.add(bottomFirstElement);
store.add(startAndFirstElement);
store.add(startOrFirstElement);
return store;
}
public static ArrayList<DepthOfExpressionElement> getDepthOtherRows() {
store = new ArrayList<DepthOfExpressionElement>();
store.add(commaOtherElement);
store.add(startAndOtherElement);
store.add(endAndOtherElement);
store.add(startOrOtherElement);
store.add(endOrOtherElement);
return store;
}
public static ArrayList<DepthOfExpressionElement> getDepthSecondArgRow() {
store = new ArrayList<DepthOfExpressionElement>();
store.add(commaOtherElement);
store.add(startAndOtherElement);
store.add(endAndOtherElement);
return store;
}
}

View File

@ -38,6 +38,7 @@
<set-property name="log_GWTLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" /> -->
<set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" />