Updated Rules

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114285 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-21 11:37:02 +00:00
parent 0e993650c0
commit 12619508bf
39 changed files with 418 additions and 227 deletions

View File

@ -159,13 +159,24 @@ public interface TabularDataResources extends ClientBundle {
@Source("rule-share_32.png") @Source("rule-share_32.png")
ImageResource ruleShare32(); ImageResource ruleShare32();
@Source("rule-column-add.png")
ImageResource ruleColumnAdd();
@Source("rule-column-add_32.png")
ImageResource ruleColumnAdd32();
@Source("rules.png") @Source("rule-column-apply.png")
ImageResource rules(); ImageResource ruleColumnApply();
@Source("rule-column-apply_32.png")
ImageResource ruleColumnApply32();
@Source("rule-tabularresource.png")
ImageResource ruleTabularResource();
@Source("rule-tabularresource_32.png")
ImageResource ruleTabularResource32();
@Source("rules_32.png")
ImageResource rules32();
@Source("table-filter_32.png") @Source("table-filter_32.png")
ImageResource filter32(); ImageResource filter32();

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -41,8 +41,8 @@ public class RuleToolBar {
private TextButton ruleOpenButton; private TextButton ruleOpenButton;
private TextButton ruleDeleteButton; private TextButton ruleDeleteButton;
private TextButton ruleApplyButton; private TextButton ruleApplyButton;
//private TextButton ruleShareButton;
// private TextButton ruleShareButton;
public RuleToolBar(EventBus eventBus) { public RuleToolBar(EventBus eventBus) {
this.eventBus = eventBus; this.eventBus = eventBus;
@ -71,24 +71,6 @@ public class RuleToolBar {
FlexTable ruleLayout = new FlexTable(); FlexTable ruleLayout = new FlexTable();
rulesGroup.add(ruleLayout); rulesGroup.add(ruleLayout);
ruleNewButton = new TextButton(msgs.ruleNewButton(),
TabularDataResources.INSTANCE.ruleAdd32());
ruleNewButton.enable();
ruleNewButton.setToolTip(msgs.ruleNewButtonToolTip());
ruleNewButton.setScale(ButtonScale.LARGE);
ruleNewButton.setIconAlign(IconAlign.TOP);
ruleNewButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
ruleNewButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(
RibbonType.RULE_NEW));
}
});
ruleLayout.setWidget(0, 0, ruleNewButton);
ruleLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
ruleOpenButton = new TextButton(msgs.ruleOpenButton(), ruleOpenButton = new TextButton(msgs.ruleOpenButton(),
TabularDataResources.INSTANCE.ruleEdit32()); TabularDataResources.INSTANCE.ruleEdit32());
ruleOpenButton.enable(); ruleOpenButton.enable();
@ -99,14 +81,12 @@ public class RuleToolBar {
ruleOpenButton.addSelectHandler(new SelectHandler() { ruleOpenButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent( eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_MODIFY));
RibbonType.RULE_MODIFY));
} }
}); });
ruleLayout.setWidget(0, 1, ruleOpenButton); ruleLayout.setWidget(0, 0, ruleOpenButton);
ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2); ruleLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(), ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(),
TabularDataResources.INSTANCE.ruleDelete32()); TabularDataResources.INSTANCE.ruleDelete32());
@ -118,17 +98,64 @@ public class RuleToolBar {
ruleDeleteButton.addSelectHandler(new SelectHandler() { ruleDeleteButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) { public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent( eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_DELETE));
RibbonType.RULE_DELETE));
} }
}); });
ruleLayout.setWidget(0, 2, ruleDeleteButton); ruleLayout.setWidget(0, 1, ruleDeleteButton);
ruleLayout.getFlexCellFormatter().setRowSpan(0, 2, 2); ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
/*
* ruleShareButton = new TextButton(msgs.ruleShareButton(),
* TabularDataResources.INSTANCE.ruleShare32());
* ruleShareButton.enable();
* ruleShareButton.setScale(ButtonScale.LARGE);
* ruleShareButton.setIconAlign(IconAlign.TOP);
* ruleShareButton.setToolTip(msgs.ruleShareButtonToolTip());
* ruleShareButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
* ruleShareButton.addSelectHandler(new SelectHandler() {
*
* public void onSelect(SelectEvent event) { eventBus.fireEvent(new
* RibbonEvent(RibbonType.RULE_SHARE)); } });
*
* ruleLayout.setWidget(0, 3, ruleShareButton);
* ruleLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
*/
cleanCells(ruleLayout.getElement());
// Column Rules
ButtonGroup ruleOnColumnGroup = new ButtonGroup();
ruleOnColumnGroup.setId("On Column");
ruleOnColumnGroup.setStyleName("ribbon");
ruleOnColumnGroup.setHeadingText(msgs.ruleOnColumnGroupHeadingText());
toolBar.add(ruleOnColumnGroup);
FlexTable ruleOnColumnLayout = new FlexTable();
ruleOnColumnGroup.add(ruleOnColumnLayout);
ruleNewButton = new TextButton(msgs.ruleNewButton(),
TabularDataResources.INSTANCE.ruleColumnAdd32());
ruleNewButton.enable();
ruleNewButton.setToolTip(msgs.ruleNewButtonToolTip());
ruleNewButton.setScale(ButtonScale.LARGE);
ruleNewButton.setIconAlign(IconAlign.TOP);
ruleNewButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
ruleNewButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_NEW));
}
});
ruleOnColumnLayout.setWidget(0, 0, ruleNewButton);
ruleOnColumnLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
ruleApplyButton = new TextButton(msgs.ruleApplyButton(), ruleApplyButton = new TextButton(msgs.ruleApplyButton(),
TabularDataResources.INSTANCE.ruleApply32()); TabularDataResources.INSTANCE.ruleColumnApply32());
ruleApplyButton.disable(); ruleApplyButton.disable();
ruleApplyButton.setScale(ButtonScale.LARGE); ruleApplyButton.setScale(ButtonScale.LARGE);
ruleApplyButton.setIconAlign(IconAlign.TOP); ruleApplyButton.setIconAlign(IconAlign.TOP);
@ -141,27 +168,8 @@ public class RuleToolBar {
} }
}); });
ruleLayout.setWidget(0, 3, ruleApplyButton); ruleOnColumnLayout.setWidget(0, 1, ruleApplyButton);
ruleLayout.getFlexCellFormatter().setRowSpan(0, 3, 2); ruleOnColumnLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
/*
ruleShareButton = new TextButton(msgs.ruleShareButton(),
TabularDataResources.INSTANCE.ruleShare32());
ruleShareButton.enable();
ruleShareButton.setScale(ButtonScale.LARGE);
ruleShareButton.setIconAlign(IconAlign.TOP);
ruleShareButton.setToolTip(msgs.ruleShareButtonToolTip());
ruleShareButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
ruleShareButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_SHARE));
}
});
ruleLayout.setWidget(0, 4, ruleShareButton);
ruleLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
*/
cleanCells(ruleLayout.getElement()); cleanCells(ruleLayout.getElement());

View File

@ -13,12 +13,6 @@ public interface RuleToolBarMessages extends Messages {
@DefaultMessage("Manage") @DefaultMessage("Manage")
String ruleGroupHeadingText(); String ruleGroupHeadingText();
@DefaultMessage("New")
String ruleNewButton();
@DefaultMessage("New")
String ruleNewButtonToolTip();
@DefaultMessage("Open") @DefaultMessage("Open")
String ruleOpenButton(); String ruleOpenButton();
@ -31,12 +25,6 @@ public interface RuleToolBarMessages extends Messages {
@DefaultMessage("Delete") @DefaultMessage("Delete")
String ruleDeleteButtonToolTip(); String ruleDeleteButtonToolTip();
@DefaultMessage("Apply")
String ruleApplyButton();
@DefaultMessage("Apply")
String ruleApplyButtonToolTip();
@DefaultMessage("Share") @DefaultMessage("Share")
String ruleShareButton(); String ruleShareButton();
@ -44,4 +32,22 @@ public interface RuleToolBarMessages extends Messages {
String ruleShareButtonToolTip(); String ruleShareButtonToolTip();
@DefaultMessage("On Column")
String ruleOnColumnGroupHeadingText();
@DefaultMessage("New")
String ruleNewButton();
@DefaultMessage("New")
String ruleNewButtonToolTip();
@DefaultMessage("Apply")
String ruleApplyButton();
@DefaultMessage("Apply")
String ruleApplyButtonToolTip();
} }

View File

@ -5,7 +5,7 @@ import org.gcube.portlets.user.td.expressionwidget.client.rpc.ExpressionServiceA
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException; 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.TDGWTIsLockedException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RulesOnColumnApplySession; import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyColumnRulesSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener; import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
@ -40,9 +40,9 @@ public class RuleApplyDialog extends Window implements
this.eventBus = eventBus; this.eventBus = eventBus;
initWindow(); initWindow();
RuleApplyPanel templateApplyPanel = new RuleApplyPanel(this, RuleApplyPanel ruleApplyPanel = new RuleApplyPanel(this,
trId, eventBus); trId, eventBus);
add(templateApplyPanel); add(ruleApplyPanel);
} }
protected void initWindow() { protected void initWindow() {
@ -50,11 +50,11 @@ public class RuleApplyDialog extends Window implements
setHeight(HEIGHT); setHeight(HEIGHT);
setBodyBorder(false); setBodyBorder(false);
setResizable(false); setResizable(false);
setHeadingText("Apply Template"); setHeadingText("Apply Column Rule");
setClosable(true); setClosable(true);
setModal(true); setModal(true);
forceLayoutOnResize = true; forceLayoutOnResize = true;
getHeader().setIcon(TabularDataResources.INSTANCE.ruleApply()); getHeader().setIcon(TabularDataResources.INSTANCE.ruleColumnApply());
} }
@ -78,8 +78,8 @@ public class RuleApplyDialog extends Window implements
hide(); hide();
} }
protected void applyRules(RulesOnColumnApplySession ruleOnColumnApplySession) { protected void applyRules(ApplyColumnRulesSession applyColumnRulesSession) {
ExpressionServiceAsync.INSTANCE.startRulesOnColumnApply(ruleOnColumnApplySession, new AsyncCallback<String>() { ExpressionServiceAsync.INSTANCE.startApplyColumnRules(applyColumnRulesSession, new AsyncCallback<String>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {

View File

@ -11,8 +11,8 @@ 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.TDGWTIsFinalException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; 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.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.rule.ApplyColumnRulesSession;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData; import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RulesOnColumnApplySession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3; import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent; 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.client.type.SessionExpiredType;
@ -36,12 +36,15 @@ import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.dnd.core.client.GridDragSource; import com.sencha.gxt.dnd.core.client.GridDragSource;
import com.sencha.gxt.dnd.core.client.GridDropTarget; import com.sencha.gxt.dnd.core.client.GridDropTarget;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;
import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton; 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.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; 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;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; 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.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -49,12 +52,17 @@ 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.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel; 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.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.grid.ColumnConfig; import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel; import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid; import com.sencha.gxt.widget.core.client.grid.Grid;
import com.sencha.gxt.widget.core.client.grid.filters.GridFilters; import com.sencha.gxt.widget.core.client.grid.filters.GridFilters;
import com.sencha.gxt.widget.core.client.grid.filters.StringFilter; import com.sencha.gxt.widget.core.client.grid.filters.StringFilter;
import com.sencha.gxt.widget.core.client.info.Info; import com.sencha.gxt.widget.core.client.info.Info;
import com.sencha.gxt.widget.core.client.menu.Item;
import com.sencha.gxt.widget.core.client.menu.Menu;
import com.sencha.gxt.widget.core.client.menu.MenuItem;
/** /**
* *
@ -82,7 +90,6 @@ public class RuleApplyPanel extends FramedPanel {
private ArrayList<RuleDescriptionData> applicableRules; private ArrayList<RuleDescriptionData> applicableRules;
private ArrayList<RuleDescriptionData> appliesRules; private ArrayList<RuleDescriptionData> appliesRules;
private TextButton btnApply; private TextButton btnApply;
private TextButton btnClose; private TextButton btnClose;
@ -92,15 +99,13 @@ public class RuleApplyPanel extends FramedPanel {
private ListStore<RuleDescriptionData> appliesRulesStore; private ListStore<RuleDescriptionData> appliesRulesStore;
private Grid<RuleDescriptionData> gridAppliesRules; private Grid<RuleDescriptionData> gridAppliesRules;
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) { public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
this.parent = parent; this.parent = parent;
this.trId = trId; this.trId = trId;
applicableRules = new ArrayList<RuleDescriptionData>(); applicableRules = new ArrayList<RuleDescriptionData>();
appliesRules = new ArrayList<RuleDescriptionData>(); appliesRules = new ArrayList<RuleDescriptionData>();
Log.debug("TemplateApplyPanel"); Log.debug("RuleApplyPanel");
setWidth(WIDTH); setWidth(WIDTH);
setHeight(HEIGHT); setHeight(HEIGHT);
setHeaderVisible(false); setHeaderVisible(false);
@ -191,11 +196,6 @@ public class RuleApplyPanel extends FramedPanel {
new VerticalLayoutData(1, -1, new Margins(0))); new VerticalLayoutData(1, -1, new Margins(0)));
// Rules // Rules
// IdentityValueProvider<RuleDescriptionData> identity = new
// IdentityValueProvider<RuleDescriptionData>();
// CheckBoxSelectionModel<RuleDescriptionData> sm = new
// CheckBoxSelectionModel<RuleDescriptionData>(
// identity);
RuleDescriptionDataProperties propsRules = GWT RuleDescriptionDataProperties propsRules = GWT
.create(RuleDescriptionDataProperties.class); .create(RuleDescriptionDataProperties.class);
@ -213,6 +213,8 @@ public class RuleApplyPanel extends FramedPanel {
} }
}); });
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
propsRules.description(), 120, "Description"); propsRules.description(), 120, "Description");
descriptionCol.setCell(new AbstractCell<String>() { descriptionCol.setCell(new AbstractCell<String>() {
@ -259,9 +261,10 @@ public class RuleApplyPanel extends FramedPanel {
ColumnModel<RuleDescriptionData> cm = new ColumnModel<RuleDescriptionData>( ColumnModel<RuleDescriptionData> cm = new ColumnModel<RuleDescriptionData>(
l); l);
StringFilter<RuleDescriptionData> nameFilter = new StringFilter<RuleDescriptionData>(propsRules.name()); StringFilter<RuleDescriptionData> nameFilter = new StringFilter<RuleDescriptionData>(
StringFilter<RuleDescriptionData> descriptionFilter = new StringFilter<RuleDescriptionData>(propsRules.description()); propsRules.name());
StringFilter<RuleDescriptionData> descriptionFilter = new StringFilter<RuleDescriptionData>(
propsRules.description());
// Applicable Rules // Applicable Rules
applicableRulesStore = new ListStore<RuleDescriptionData>( applicableRulesStore = new ListStore<RuleDescriptionData>(
@ -279,20 +282,18 @@ public class RuleApplyPanel extends FramedPanel {
gridApplicableRules.setColumnResize(true); gridApplicableRules.setColumnResize(true);
gridApplicableRules.getView().setAutoExpandColumn(descriptionCol); gridApplicableRules.getView().setAutoExpandColumn(descriptionCol);
GridFilters<RuleDescriptionData> filtersApplicableRules = new GridFilters<RuleDescriptionData>(); GridFilters<RuleDescriptionData> filtersApplicableRules = new GridFilters<RuleDescriptionData>();
filtersApplicableRules.initPlugin(gridApplicableRules); filtersApplicableRules.initPlugin(gridApplicableRules);
filtersApplicableRules.setLocal(true); filtersApplicableRules.setLocal(true);
filtersApplicableRules.addFilter(nameFilter); filtersApplicableRules.addFilter(nameFilter);
filtersApplicableRules.addFilter(descriptionFilter); filtersApplicableRules.addFilter(descriptionFilter);
createContextMenu(gridApplicableRules);
// Applies Rules // Applies Rules
appliesRulesStore = new ListStore<RuleDescriptionData>( appliesRulesStore = new ListStore<RuleDescriptionData>(propsRules.id());
propsRules.id());
gridAppliesRules = new Grid<RuleDescriptionData>( gridAppliesRules = new Grid<RuleDescriptionData>(appliesRulesStore, cm);
appliesRulesStore, cm);
gridAppliesRules.setHeight(RULES_GRID_HEIGHT); gridAppliesRules.setHeight(RULES_GRID_HEIGHT);
gridAppliesRules.getView().setStripeRows(true); gridAppliesRules.getView().setStripeRows(true);
gridAppliesRules.getView().setColumnLines(true); gridAppliesRules.getView().setColumnLines(true);
@ -309,34 +310,36 @@ public class RuleApplyPanel extends FramedPanel {
filtersAppliesRules.addFilter(nameFilter); filtersAppliesRules.addFilter(nameFilter);
filtersAppliesRules.addFilter(descriptionFilter); filtersAppliesRules.addFilter(descriptionFilter);
// createContextMenu(gridAppliesRules);
new GridDragSource<RuleDescriptionData>(gridApplicableRules).setGroup(SET_RULES);
new GridDragSource<RuleDescriptionData>(gridAppliesRules).setGroup(SET_RULES);
new GridDropTarget<RuleDescriptionData>(gridApplicableRules).setGroup(SET_RULES);
new GridDropTarget<RuleDescriptionData>(gridAppliesRules).setGroup(SET_RULES);
// //
FieldLabel rulesApplicableLabel = new FieldLabel(gridApplicableRules, "Applicable Rules");
new GridDragSource<RuleDescriptionData>(gridApplicableRules)
.setGroup(SET_RULES);
new GridDragSource<RuleDescriptionData>(gridAppliesRules)
.setGroup(SET_RULES);
new GridDropTarget<RuleDescriptionData>(gridApplicableRules)
.setGroup(SET_RULES);
new GridDropTarget<RuleDescriptionData>(gridAppliesRules)
.setGroup(SET_RULES);
//
FieldLabel rulesApplicableLabel = new FieldLabel(gridApplicableRules,
"Applicable Rules");
configurationFieldSetLayout.add(rulesApplicableLabel, configurationFieldSetLayout.add(rulesApplicableLabel,
new VerticalLayoutData(1, -1, new Margins(0))); new VerticalLayoutData(1, -1, new Margins(0)));
FieldLabel rulesAppliesLabel = new FieldLabel(gridAppliesRules,
FieldLabel rulesAppliesLabel = new FieldLabel(gridAppliesRules, "Applies Rules"); "Applies Rules");
configurationFieldSetLayout.add(rulesAppliesLabel, configurationFieldSetLayout.add(rulesAppliesLabel,
new VerticalLayoutData(1, -1, new Margins(0))); new VerticalLayoutData(1, -1, new Margins(0)));
// Button // Button
btnApply = new TextButton("Apply"); btnApply = new TextButton("Apply");
btnApply.setIcon(TabularDataResources.INSTANCE.ruleApply()); btnApply.setIcon(TabularDataResources.INSTANCE.ruleColumnApply());
btnApply.setIconAlign(IconAlign.RIGHT); btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Apply Template"); btnApply.setToolTip("Apply Template");
btnApply.addSelectHandler(new SelectHandler() { btnApply.addSelectHandler(new SelectHandler() {
@ -399,7 +402,6 @@ public class RuleApplyPanel extends FramedPanel {
column = columnData; column = columnData;
getApplicableBaseColumnRules(); getApplicableBaseColumnRules();
} }
protected void getApplicableBaseColumnRules() { protected void getApplicableBaseColumnRules() {
@ -448,7 +450,6 @@ public class RuleApplyPanel extends FramedPanel {
"Error retrieving applicable rules"); "Error retrieving applicable rules");
} }
} }
@Override @Override
@ -456,9 +457,13 @@ public class RuleApplyPanel extends FramedPanel {
Log.trace("loaded " + result.size() + " Rules"); Log.trace("loaded " + result.size() + " Rules");
appliesRules = result; appliesRules = result;
applicableRulesStore.clear(); applicableRulesStore.clear();
applicableRulesStore.addAll(applicableRules); applicableRulesStore
.addAll(new ArrayList<RuleDescriptionData>(
applicableRules));
appliesRulesStore.clear(); appliesRulesStore.clear();
appliesRulesStore.addAll(appliesRules); appliesRulesStore
.addAll(new ArrayList<RuleDescriptionData>(
appliesRules));
forceLayout(); forceLayout();
} }
@ -474,12 +479,26 @@ public class RuleApplyPanel extends FramedPanel {
} }
protected void apply() { protected void apply() {
ArrayList<RuleDescriptionData> selectedRules = getSelectedItems();
ColumnData column = comboColumns.getCurrentValue(); ColumnData column = comboColumns.getCurrentValue();
if (column != null) { if (column != null) {
RulesOnColumnApplySession rulesOnColumnApplySession = new RulesOnColumnApplySession( ArrayList<RuleDescriptionData> selectedRules = getSelectedItems();
trId, column, selectedRules); ArrayList<RuleDescriptionData> rulesToBeApplied = new ArrayList<RuleDescriptionData>();
parent.applyRules(rulesOnColumnApplySession); for (RuleDescriptionData ruleSelected : selectedRules) {
boolean ruleApplied = false;
for (RuleDescriptionData ruleAlreadyApplied : appliesRules) {
if (ruleSelected.getId() == ruleAlreadyApplied.getId()) {
ruleApplied = true;
break;
}
}
if (ruleApplied == false) {
rulesToBeApplied.add(ruleSelected);
}
}
ApplyColumnRulesSession applyColumnRulesSession = new ApplyColumnRulesSession(
trId, column, rulesToBeApplied);
parent.applyRules(applyColumnRulesSession);
} else { } else {
Log.error("No column selected"); Log.error("No column selected");
UtilsGXT3.alert("Attention", "Select a column"); UtilsGXT3.alert("Attention", "Select a column");
@ -490,4 +509,96 @@ public class RuleApplyPanel extends FramedPanel {
parent.close(); parent.close();
} }
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setHeadingText("Info Rule");
infoRuleDialog.getHeader().setIcon(
TabularDataResources.INSTANCE.information());
infoRuleDialog.setPredefinedButtons(PredefinedButton.OK);
FieldSet configurationFieldSet = new FieldSet();
configurationFieldSet.setHeadingText("Configuration");
configurationFieldSet.setCollapsible(false);
configurationFieldSet.setBorders(true);
VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer();
configurationFieldSet.add(configurationFieldSetLayout,
new MarginData(0));
TextField ruleName = new TextField();
ruleName.setToolTip("Rule Name");
ruleName.setValue(rule.getName());
ruleName.setReadOnly(true);
FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Name");
configurationFieldSetLayout.add(ruleNameLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField ruleScope = new TextField();
ruleScope.setToolTip("Rule Scope");
ruleScope.setValue(rule.getScopeLabel());
ruleScope.setReadOnly(true);
FieldLabel ruleScopeLabel = new FieldLabel(ruleScope, "Scope");
configurationFieldSetLayout.add(ruleScopeLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleDescription = new TextArea();
ruleDescription.setToolTip("Rule Description");
ruleDescription.setValue(rule.getDescription());
ruleDescription.setReadOnly(true);
FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription,
"Description");
configurationFieldSetLayout.add(ruleDescriptionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
TextField ruleOwner = new TextField();
ruleOwner.setToolTip("Rule Owner");
ruleOwner.setValue(rule.getOwner());
ruleOwner.setReadOnly(true);
FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner");
configurationFieldSetLayout.add(ruleOwnerLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleExpression = new TextArea();
ruleExpression.setToolTip("Rule Expression");
ruleExpression.setValue(rule.getReadableExpression());
ruleExpression.setReadOnly(true);
ruleExpression.setHeight("82px");
FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression,
"Expression");
configurationFieldSetLayout.add(ruleExpressionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
infoRuleDialog.add(configurationFieldSet, new MarginData(0));
infoRuleDialog.setHideOnButtonClick(true);
infoRuleDialog.setButtonAlign(BoxLayoutPack.CENTER);
infoRuleDialog.setWidth(500);
infoRuleDialog.show();
}
protected void createContextMenu(final Grid<RuleDescriptionData> grid) {
Menu contextMenu = new Menu();
MenuItem infoItem = new MenuItem();
infoItem.setText("Info");
infoItem.setIcon(TabularDataResources.INSTANCE.information());
infoItem.addSelectionHandler(new SelectionHandler<Item>() {
@Override
public void onSelection(SelectionEvent<Item> event) {
RuleDescriptionData selected = grid.getSelectionModel()
.getSelectedItem();
Log.debug(selected.toString());
requestInfo(selected);
}
});
contextMenu.add(infoItem);
grid.setContextMenu(contextMenu);
}
} }

View File

@ -27,14 +27,15 @@ public class RuleDeleteDialog extends Window {
private static final String WIDTH = "720px"; private static final String WIDTH = "720px";
private static final String HEIGHT = "530px"; private static final String HEIGHT = "530px";
private EventBus eventBus; private EventBus eventBus;
private RuleDeletePanel ruleDeletePanel;
public RuleDeleteDialog(EventBus eventBus) { public RuleDeleteDialog(EventBus eventBus) {
this.eventBus = eventBus; this.eventBus = eventBus;
initWindow(); initWindow();
RuleDeletePanel templateDeletePanel = new RuleDeletePanel(this, ruleDeletePanel = new RuleDeletePanel(this,
eventBus); eventBus);
add(templateDeletePanel); add(ruleDeletePanel);
} }
protected void initWindow() { protected void initWindow() {
@ -80,7 +81,7 @@ public class RuleDeleteDialog extends Window {
public void onSuccess(Void v) { public void onSuccess(Void v) {
Log.debug("Rule is deleted!"); Log.debug("Rule is deleted!");
UtilsGXT3.info("Delete Rule", "The rule is deleted!"); UtilsGXT3.info("Delete Rule", "The rule is deleted!");
ruleDeletePanel.gridReload();
} }
@Override @Override

View File

@ -43,14 +43,14 @@ import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
import com.sencha.gxt.data.shared.loader.ListLoader; import com.sencha.gxt.data.shared.loader.ListLoader;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding; import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.widget.core.client.Dialog; import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton; 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.BoxLayoutData;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack; 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;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign; import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; 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.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.SelectEvent; import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -81,7 +81,6 @@ public class RuleDeletePanel extends FramedPanel {
private EventBus eventBus; private EventBus eventBus;
private RuleDeleteDialog parent; private RuleDeleteDialog parent;
private TextButton btnDelete; private TextButton btnDelete;
private TextButton btnClose; private TextButton btnClose;
@ -134,6 +133,19 @@ public class RuleDeletePanel extends FramedPanel {
} }
}); });
ColumnConfig<RuleDescriptionData, String> scopeCol = new ColumnConfig<RuleDescriptionData, String>(
props.scopeLabel(), 40, "Scope");
nameCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleDeleteTemplates ruleDeleteTemplates = GWT
.create(RuleDeleteTemplates.class);
sb.append(ruleDeleteTemplates.format(value));
}
});
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
props.description(), 120, "Description"); props.description(), 120, "Description");
descriptionCol.setCell(new AbstractCell<String>() { descriptionCol.setCell(new AbstractCell<String>() {
@ -173,6 +185,7 @@ public class RuleDeletePanel extends FramedPanel {
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>(); List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol); l.add(nameCol);
l.add(scopeCol);
l.add(descriptionCol); l.add(descriptionCol);
l.add(ownerCol); l.add(ownerCol);
l.add(readableExpressionCol); l.add(readableExpressionCol);
@ -392,48 +405,61 @@ public class RuleDeletePanel extends FramedPanel {
final Dialog infoRuleDialog = new Dialog(); final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setHeadingText("Info Rule"); infoRuleDialog.setHeadingText("Info Rule");
infoRuleDialog.getHeader().setIcon(TabularDataResources.INSTANCE.information()); infoRuleDialog.getHeader().setIcon(
TabularDataResources.INSTANCE.information());
infoRuleDialog.setPredefinedButtons(PredefinedButton.OK); infoRuleDialog.setPredefinedButtons(PredefinedButton.OK);
FieldSet configurationFieldSet = new FieldSet(); FieldSet configurationFieldSet = new FieldSet();
configurationFieldSet.setHeadingText("Configuration"); configurationFieldSet.setHeadingText("Configuration");
configurationFieldSet.setCollapsible(false); configurationFieldSet.setCollapsible(false);
configurationFieldSet.setBorders(true); configurationFieldSet.setBorders(true);
VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer(); VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer();
configurationFieldSet.add(configurationFieldSetLayout, new MarginData(0)); configurationFieldSet.add(configurationFieldSetLayout,
new MarginData(0));
TextField ruleName = new TextField(); TextField ruleName = new TextField();
ruleName.setToolTip("Rule Name"); ruleName.setToolTip("Rule Name");
ruleName.setValue(rule.getName()); ruleName.setValue(rule.getName());
ruleName.setReadOnly(true); ruleName.setReadOnly(true);
FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Name"); FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Name");
configurationFieldSetLayout.add(ruleNameLabel,new VerticalLayoutData(1, -1, new Margins(0))); configurationFieldSetLayout.add(ruleNameLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField ruleScope = new TextField();
ruleScope.setToolTip("Rule Scope");
ruleScope.setValue(rule.getScopeLabel());
ruleScope.setReadOnly(true);
FieldLabel ruleScopeLabel = new FieldLabel(ruleScope, "Scope");
configurationFieldSetLayout.add(ruleScopeLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleDescription = new TextArea(); TextArea ruleDescription = new TextArea();
ruleDescription.setToolTip("Rule Description"); ruleDescription.setToolTip("Rule Description");
ruleDescription.setValue(rule.getDescription()); ruleDescription.setValue(rule.getDescription());
ruleDescription.setReadOnly(true); ruleDescription.setReadOnly(true);
FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription, "Description"); FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription,
configurationFieldSetLayout.add(ruleDescriptionLabel,new VerticalLayoutData(1, -1, new Margins(0))); "Description");
configurationFieldSetLayout.add(ruleDescriptionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
TextField ruleOwner = new TextField(); TextField ruleOwner = new TextField();
ruleOwner.setToolTip("Rule Owner"); ruleOwner.setToolTip("Rule Owner");
ruleOwner.setValue(rule.getOwner()); ruleOwner.setValue(rule.getOwner());
ruleOwner.setReadOnly(true); ruleOwner.setReadOnly(true);
FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner"); FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner");
configurationFieldSetLayout.add(ruleOwnerLabel,new VerticalLayoutData(1, -1, new Margins(0))); configurationFieldSetLayout.add(ruleOwnerLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleExpression = new TextArea(); TextArea ruleExpression = new TextArea();
ruleExpression.setToolTip("Rule Expression"); ruleExpression.setToolTip("Rule Expression");
ruleExpression.setValue(rule.getReadableExpression()); ruleExpression.setValue(rule.getReadableExpression());
ruleExpression.setReadOnly(true); ruleExpression.setReadOnly(true);
ruleExpression.setHeight("82px"); ruleExpression.setHeight("82px");
FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression, "Expression"); FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression,
configurationFieldSetLayout.add(ruleExpressionLabel,new VerticalLayoutData(1, -1, new Margins(0))); "Expression");
configurationFieldSetLayout.add(ruleExpressionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
infoRuleDialog.add(configurationFieldSet, new MarginData(0)); infoRuleDialog.add(configurationFieldSet, new MarginData(0));
infoRuleDialog.setHideOnButtonClick(true); infoRuleDialog.setHideOnButtonClick(true);
@ -444,7 +470,6 @@ public class RuleDeletePanel extends FramedPanel {
} }
protected void createContextMenu() { protected void createContextMenu() {
Menu contextMenu = new Menu(); Menu contextMenu = new Menu();
@ -455,7 +480,8 @@ public class RuleDeletePanel extends FramedPanel {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
RuleDescriptionData selected = grid.getSelectionModel().getSelectedItem(); RuleDescriptionData selected = grid.getSelectionModel()
.getSelectedItem();
Log.debug(selected.toString()); Log.debug(selected.toString());
requestInfo(selected); requestInfo(selected);
} }
@ -467,5 +493,4 @@ public class RuleDeletePanel extends FramedPanel {
} }
} }

View File

@ -42,7 +42,6 @@ import com.sencha.gxt.data.shared.loader.ListLoadResult;
import com.sencha.gxt.data.shared.loader.ListLoadResultBean; import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
import com.sencha.gxt.data.shared.loader.ListLoader; import com.sencha.gxt.data.shared.loader.ListLoader;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding; import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.widget.core.client.ContentPanel;
import com.sencha.gxt.widget.core.client.Dialog; import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton;
import com.sencha.gxt.widget.core.client.FramedPanel; import com.sencha.gxt.widget.core.client.FramedPanel;
@ -140,6 +139,19 @@ public class RuleOpenPanel extends FramedPanel {
} }
}); });
ColumnConfig<RuleDescriptionData, String> scopeCol = new ColumnConfig<RuleDescriptionData, String>(
props.scopeLabel(), 40, "Scope");
nameCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
RuleOpenTemplates ruleOpenTemplates = GWT
.create(RuleOpenTemplates.class);
sb.append(ruleOpenTemplates.format(value));
}
});
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>( ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
props.description(), 120, "Description"); props.description(), 120, "Description");
descriptionCol.setCell(new AbstractCell<String>() { descriptionCol.setCell(new AbstractCell<String>() {
@ -179,6 +191,7 @@ public class RuleOpenPanel extends FramedPanel {
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>(); List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
l.add(nameCol); l.add(nameCol);
l.add(scopeCol);
l.add(descriptionCol); l.add(descriptionCol);
l.add(ownerCol); l.add(ownerCol);
l.add(readableExpressionCol); l.add(readableExpressionCol);
@ -400,48 +413,61 @@ public class RuleOpenPanel extends FramedPanel {
final Dialog infoRuleDialog = new Dialog(); final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setHeadingText("Info Rule"); infoRuleDialog.setHeadingText("Info Rule");
infoRuleDialog.getHeader().setIcon(TabularDataResources.INSTANCE.information()); infoRuleDialog.getHeader().setIcon(
TabularDataResources.INSTANCE.information());
infoRuleDialog.setPredefinedButtons(PredefinedButton.OK); infoRuleDialog.setPredefinedButtons(PredefinedButton.OK);
FieldSet configurationFieldSet = new FieldSet(); FieldSet configurationFieldSet = new FieldSet();
configurationFieldSet.setHeadingText("Configuration"); configurationFieldSet.setHeadingText("Configuration");
configurationFieldSet.setCollapsible(false); configurationFieldSet.setCollapsible(false);
configurationFieldSet.setBorders(true); configurationFieldSet.setBorders(true);
VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer(); VerticalLayoutContainer configurationFieldSetLayout = new VerticalLayoutContainer();
configurationFieldSet.add(configurationFieldSetLayout, new MarginData(0)); configurationFieldSet.add(configurationFieldSetLayout,
new MarginData(0));
TextField ruleName = new TextField(); TextField ruleName = new TextField();
ruleName.setToolTip("Rule Name"); ruleName.setToolTip("Rule Name");
ruleName.setValue(rule.getName()); ruleName.setValue(rule.getName());
ruleName.setReadOnly(true); ruleName.setReadOnly(true);
FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Name"); FieldLabel ruleNameLabel = new FieldLabel(ruleName, "Name");
configurationFieldSetLayout.add(ruleNameLabel,new VerticalLayoutData(1, -1, new Margins(0))); configurationFieldSetLayout.add(ruleNameLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextField ruleScope = new TextField();
ruleScope.setToolTip("Rule Scope");
ruleScope.setValue(rule.getScopeLabel());
ruleScope.setReadOnly(true);
FieldLabel ruleScopeLabel = new FieldLabel(ruleScope, "Scope");
configurationFieldSetLayout.add(ruleScopeLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleDescription = new TextArea(); TextArea ruleDescription = new TextArea();
ruleDescription.setToolTip("Rule Description"); ruleDescription.setToolTip("Rule Description");
ruleDescription.setValue(rule.getDescription()); ruleDescription.setValue(rule.getDescription());
ruleDescription.setReadOnly(true); ruleDescription.setReadOnly(true);
FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription, "Description"); FieldLabel ruleDescriptionLabel = new FieldLabel(ruleDescription,
configurationFieldSetLayout.add(ruleDescriptionLabel,new VerticalLayoutData(1, -1, new Margins(0))); "Description");
configurationFieldSetLayout.add(ruleDescriptionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
TextField ruleOwner = new TextField(); TextField ruleOwner = new TextField();
ruleOwner.setToolTip("Rule Owner"); ruleOwner.setToolTip("Rule Owner");
ruleOwner.setValue(rule.getOwner()); ruleOwner.setValue(rule.getOwner());
ruleOwner.setReadOnly(true); ruleOwner.setReadOnly(true);
FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner"); FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner");
configurationFieldSetLayout.add(ruleOwnerLabel,new VerticalLayoutData(1, -1, new Margins(0))); configurationFieldSetLayout.add(ruleOwnerLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleExpression = new TextArea(); TextArea ruleExpression = new TextArea();
ruleExpression.setToolTip("Rule Expression"); ruleExpression.setToolTip("Rule Expression");
ruleExpression.setValue(rule.getReadableExpression()); ruleExpression.setValue(rule.getReadableExpression());
ruleExpression.setReadOnly(true); ruleExpression.setReadOnly(true);
ruleExpression.setHeight("82px"); ruleExpression.setHeight("82px");
FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression, "Expression"); FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression,
configurationFieldSetLayout.add(ruleExpressionLabel,new VerticalLayoutData(1, -1, new Margins(0))); "Expression");
configurationFieldSetLayout.add(ruleExpressionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
infoRuleDialog.add(configurationFieldSet, new MarginData(0)); infoRuleDialog.add(configurationFieldSet, new MarginData(0));
infoRuleDialog.setHideOnButtonClick(true); infoRuleDialog.setHideOnButtonClick(true);
@ -452,7 +478,6 @@ public class RuleOpenPanel extends FramedPanel {
} }
protected void createContextMenu() { protected void createContextMenu() {
Menu contextMenu = new Menu(); Menu contextMenu = new Menu();
@ -463,7 +488,8 @@ public class RuleOpenPanel extends FramedPanel {
@Override @Override
public void onSelection(SelectionEvent<Item> event) { public void onSelection(SelectionEvent<Item> event) {
RuleDescriptionData selected = grid.getSelectionModel().getSelectedItem(); RuleDescriptionData selected = grid.getSelectionModel()
.getSelectedItem();
Log.debug(selected.toString()); Log.debug(selected.toString());
requestInfo(selected); requestInfo(selected);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,11 +1,12 @@
ruleGroupHeadingText = Manage ruleGroupHeadingText = Manage
ruleNewButton = New ruleEditButton = Open
ruleNewButtonToolTip = New ruleEditButtonToolTip = Open
ruleEditButton = Edit
ruleEditButtonToolTip = Edit
ruleDeleteButton = Delete ruleDeleteButton = Delete
ruleDeleteButtonToolTip = Delete ruleDeleteButtonToolTip = Delete
ruleApplyButton = Apply
ruleApplyButtonToolTip = Apply
ruleShareButton = Share ruleShareButton = Share
ruleShareButtonToolTip = Share ruleShareButtonToolTip = Share
ruleOnColumnGroupHeadingText = On Column
ruleNewButton = New
ruleNewButtonToolTip = New
ruleApplyButton = Apply
ruleApplyButtonToolTip = Apply

View File

@ -1,11 +1,12 @@
ruleGroupHeadingText = Gestionar ruleGroupHeadingText = Gestionar
ruleNewButton = Nuevo ruleEditButton = Abre
ruleNewButtonToolTip = Nuevo ruleEditButtonToolTip = Abre
ruleEditButton = Editar
ruleEditButtonToolTip = Editar
ruleDeleteButton = Borrar ruleDeleteButton = Borrar
ruleDeleteButtonToolTip = Borrar ruleDeleteButtonToolTip = Borrar
ruleApplyButton = Aplicar
ruleApplyButtonToolTip = Aplicar
ruleShareButton = Cuota ruleShareButton = Cuota
ruleShareButtonToolTip = Cuota ruleShareButtonToolTip = Cuota
ruleOnColumnGroupHeadingText = On Columna
ruleNewButton = Nuevo
ruleNewButtonToolTip = Nuevo
ruleApplyButton = Aplicar
ruleApplyButtonToolTip = Aplicar

View File

@ -1,11 +1,12 @@
ruleGroupHeadingText = Gestisci ruleGroupHeadingText = Gestisci
ruleNewButton = Nuovo ruleEditButton = Apri
ruleNewButtonToolTip = Nuovo ruleEditButtonToolTip = Apri
ruleEditButton = Modifica
ruleEditButtonToolTip = Modifica
ruleDeleteButton = Elimina ruleDeleteButton = Elimina
ruleDeleteButtonToolTip = Elimina ruleDeleteButtonToolTip = Elimina
ruleApplyButton = Applica
ruleApplyButtonToolTip = Applica
ruleShareButton = Condividi ruleShareButton = Condividi
ruleShareButtonToolTip = Condividi ruleShareButtonToolTip = Condividi
ruleOnColumnGroupHeadingText = Su Colonna
ruleNewButton = Nuova
ruleNewButtonToolTip = Nuova
ruleApplyButton = Applica
ruleApplyButtonToolTip = Applica