Updated Rules
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114285 82a268e6-3cf1-43bd-a215-b396298e98cf
|
@ -159,13 +159,24 @@ public interface TabularDataResources extends ClientBundle {
|
|||
@Source("rule-share_32.png")
|
||||
ImageResource ruleShare32();
|
||||
|
||||
@Source("rule-column-add.png")
|
||||
ImageResource ruleColumnAdd();
|
||||
|
||||
@Source("rule-column-add_32.png")
|
||||
ImageResource ruleColumnAdd32();
|
||||
|
||||
@Source("rule-column-apply.png")
|
||||
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.png")
|
||||
ImageResource rules();
|
||||
|
||||
@Source("rules_32.png")
|
||||
ImageResource rules32();
|
||||
|
||||
@Source("table-filter_32.png")
|
||||
ImageResource filter32();
|
||||
|
|
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 863 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 877 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB |
|
@ -36,13 +36,13 @@ public class RuleToolBar {
|
|||
private EventBus eventBus;
|
||||
private ToolBar toolBar;
|
||||
|
||||
//Rules
|
||||
// Rules
|
||||
private TextButton ruleNewButton;
|
||||
private TextButton ruleOpenButton;
|
||||
private TextButton ruleDeleteButton;
|
||||
private TextButton ruleApplyButton;
|
||||
//private TextButton ruleShareButton;
|
||||
|
||||
|
||||
// private TextButton ruleShareButton;
|
||||
|
||||
public RuleToolBar(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
|
@ -55,40 +55,22 @@ public class RuleToolBar {
|
|||
|
||||
protected void build() {
|
||||
RuleToolBarMessages msgs = GWT.create(RuleToolBarMessages.class);
|
||||
|
||||
|
||||
toolBar = new ToolBar();
|
||||
toolBar.setSpacing(1);
|
||||
toolBar.setEnableOverflow(false);
|
||||
|
||||
|
||||
// Rules
|
||||
ButtonGroup rulesGroup = new ButtonGroup();
|
||||
rulesGroup.setId("Manage");
|
||||
rulesGroup.setStyleName("ribbon");
|
||||
rulesGroup.setHeadingText(msgs.ruleGroupHeadingText());
|
||||
//templateGroup.disable();
|
||||
// templateGroup.disable();
|
||||
toolBar.add(rulesGroup);
|
||||
|
||||
FlexTable ruleLayout = new FlexTable();
|
||||
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(),
|
||||
TabularDataResources.INSTANCE.ruleEdit32());
|
||||
ruleOpenButton.enable();
|
||||
|
@ -99,15 +81,13 @@ public class RuleToolBar {
|
|||
ruleOpenButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(
|
||||
RibbonType.RULE_MODIFY));
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_MODIFY));
|
||||
}
|
||||
});
|
||||
|
||||
ruleLayout.setWidget(0, 1, ruleOpenButton);
|
||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
|
||||
|
||||
ruleLayout.setWidget(0, 0, ruleOpenButton);
|
||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
ruleDeleteButton = new TextButton(msgs.ruleDeleteButton(),
|
||||
TabularDataResources.INSTANCE.ruleDelete32());
|
||||
ruleDeleteButton.enable();
|
||||
|
@ -118,17 +98,64 @@ public class RuleToolBar {
|
|||
ruleDeleteButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(
|
||||
RibbonType.RULE_DELETE));
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.RULE_DELETE));
|
||||
}
|
||||
});
|
||||
|
||||
ruleLayout.setWidget(0, 1, ruleDeleteButton);
|
||||
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));
|
||||
}
|
||||
});
|
||||
|
||||
ruleLayout.setWidget(0, 2, ruleDeleteButton);
|
||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||
|
||||
ruleOnColumnLayout.setWidget(0, 0, ruleNewButton);
|
||||
ruleOnColumnLayout.getFlexCellFormatter().setRowSpan(0, 0, 2);
|
||||
|
||||
ruleApplyButton = new TextButton(msgs.ruleApplyButton(),
|
||||
TabularDataResources.INSTANCE.ruleApply32());
|
||||
TabularDataResources.INSTANCE.ruleColumnApply32());
|
||||
ruleApplyButton.disable();
|
||||
ruleApplyButton.setScale(ButtonScale.LARGE);
|
||||
ruleApplyButton.setIconAlign(IconAlign.TOP);
|
||||
|
@ -141,27 +168,8 @@ public class RuleToolBar {
|
|||
}
|
||||
});
|
||||
|
||||
ruleLayout.setWidget(0, 3, ruleApplyButton);
|
||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 3, 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);
|
||||
*/
|
||||
ruleOnColumnLayout.setWidget(0, 1, ruleApplyButton);
|
||||
ruleOnColumnLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||
|
||||
cleanCells(ruleLayout.getElement());
|
||||
|
||||
|
@ -196,31 +204,31 @@ public class RuleToolBar {
|
|||
ruleNewButton.enable();
|
||||
ruleDeleteButton.enable();
|
||||
ruleApplyButton.disable();
|
||||
//ruleShareButton.enable();
|
||||
// ruleShareButton.enable();
|
||||
break;
|
||||
case TR_CLOSE:
|
||||
case TR_READONLY:
|
||||
case TR_READONLY:
|
||||
ruleOpenButton.enable();
|
||||
ruleNewButton.enable();
|
||||
ruleDeleteButton.enable();
|
||||
ruleApplyButton.disable();
|
||||
//ruleShareButton.enable();
|
||||
// ruleShareButton.enable();
|
||||
break;
|
||||
case TR_OPEN:
|
||||
case TABLEUPDATE:
|
||||
case TABLECURATION:
|
||||
case TABLECURATION:
|
||||
ruleOpenButton.enable();
|
||||
ruleNewButton.enable();
|
||||
ruleDeleteButton.enable();
|
||||
ruleApplyButton.enable();
|
||||
//ruleShareButton.enable();
|
||||
// ruleShareButton.enable();
|
||||
break;
|
||||
case WIZARD_OPEN:
|
||||
ruleOpenButton.disable();
|
||||
ruleNewButton.disable();
|
||||
ruleDeleteButton.disable();
|
||||
ruleApplyButton.disable();
|
||||
//ruleShareButton.disable();
|
||||
// ruleShareButton.disable();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -12,13 +12,7 @@ public interface RuleToolBarMessages extends Messages {
|
|||
|
||||
@DefaultMessage("Manage")
|
||||
String ruleGroupHeadingText();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButton();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButtonToolTip();
|
||||
|
||||
|
||||
@DefaultMessage("Open")
|
||||
String ruleOpenButton();
|
||||
|
||||
|
@ -30,6 +24,22 @@ public interface RuleToolBarMessages extends Messages {
|
|||
|
||||
@DefaultMessage("Delete")
|
||||
String ruleDeleteButtonToolTip();
|
||||
|
||||
@DefaultMessage("Share")
|
||||
String ruleShareButton();
|
||||
|
||||
@DefaultMessage("Share")
|
||||
String ruleShareButtonToolTip();
|
||||
|
||||
|
||||
@DefaultMessage("On Column")
|
||||
String ruleOnColumnGroupHeadingText();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButton();
|
||||
|
||||
@DefaultMessage("New")
|
||||
String ruleNewButtonToolTip();
|
||||
|
||||
@DefaultMessage("Apply")
|
||||
String ruleApplyButton();
|
||||
|
@ -37,11 +47,7 @@ public interface RuleToolBarMessages extends Messages {
|
|||
@DefaultMessage("Apply")
|
||||
String ruleApplyButtonToolTip();
|
||||
|
||||
@DefaultMessage("Share")
|
||||
String ruleShareButton();
|
||||
|
||||
@DefaultMessage("Share")
|
||||
String ruleShareButtonToolTip();
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -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.TDGWTIsLockedException;
|
||||
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.MonitorDialogListener;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||
|
@ -40,9 +40,9 @@ public class RuleApplyDialog extends Window implements
|
|||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
|
||||
RuleApplyPanel templateApplyPanel = new RuleApplyPanel(this,
|
||||
RuleApplyPanel ruleApplyPanel = new RuleApplyPanel(this,
|
||||
trId, eventBus);
|
||||
add(templateApplyPanel);
|
||||
add(ruleApplyPanel);
|
||||
}
|
||||
|
||||
protected void initWindow() {
|
||||
|
@ -50,11 +50,11 @@ public class RuleApplyDialog extends Window implements
|
|||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(false);
|
||||
setHeadingText("Apply Template");
|
||||
setHeadingText("Apply Column Rule");
|
||||
setClosable(true);
|
||||
setModal(true);
|
||||
forceLayoutOnResize = true;
|
||||
getHeader().setIcon(TabularDataResources.INSTANCE.ruleApply());
|
||||
getHeader().setIcon(TabularDataResources.INSTANCE.ruleColumnApply());
|
||||
|
||||
}
|
||||
|
||||
|
@ -78,8 +78,8 @@ public class RuleApplyDialog extends Window implements
|
|||
hide();
|
||||
}
|
||||
|
||||
protected void applyRules(RulesOnColumnApplySession ruleOnColumnApplySession) {
|
||||
ExpressionServiceAsync.INSTANCE.startRulesOnColumnApply(ruleOnColumnApplySession, new AsyncCallback<String>() {
|
||||
protected void applyRules(ApplyColumnRulesSession applyColumnRulesSession) {
|
||||
ExpressionServiceAsync.INSTANCE.startApplyColumnRules(applyColumnRulesSession, new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -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.TDGWTIsLockedException;
|
||||
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.RulesOnColumnApplySession;
|
||||
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.type.SessionExpiredType;
|
||||
|
@ -36,12 +36,15 @@ import com.sencha.gxt.data.shared.LabelProvider;
|
|||
import com.sencha.gxt.data.shared.ListStore;
|
||||
import com.sencha.gxt.dnd.core.client.GridDragSource;
|
||||
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.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.MarginData;
|
||||
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;
|
||||
|
@ -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.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.grid.ColumnConfig;
|
||||
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.filters.GridFilters;
|
||||
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.menu.Item;
|
||||
import com.sencha.gxt.widget.core.client.menu.Menu;
|
||||
import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -81,26 +89,23 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
private ColumnData column;
|
||||
private ArrayList<RuleDescriptionData> applicableRules;
|
||||
private ArrayList<RuleDescriptionData> appliesRules;
|
||||
|
||||
|
||||
|
||||
private TextButton btnApply;
|
||||
private TextButton btnClose;
|
||||
|
||||
|
||||
private ComboBox<ColumnData> comboColumns;
|
||||
private ListStore<RuleDescriptionData> applicableRulesStore;
|
||||
private Grid<RuleDescriptionData> gridApplicableRules;
|
||||
private ListStore<RuleDescriptionData> appliesRulesStore;
|
||||
private Grid<RuleDescriptionData> gridAppliesRules;
|
||||
|
||||
|
||||
|
||||
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
this.trId = trId;
|
||||
applicableRules=new ArrayList<RuleDescriptionData>();
|
||||
appliesRules=new ArrayList<RuleDescriptionData>();
|
||||
|
||||
Log.debug("TemplateApplyPanel");
|
||||
applicableRules = new ArrayList<RuleDescriptionData>();
|
||||
appliesRules = new ArrayList<RuleDescriptionData>();
|
||||
|
||||
Log.debug("RuleApplyPanel");
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setHeaderVisible(false);
|
||||
|
@ -191,11 +196,6 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
||||
// Rules
|
||||
// IdentityValueProvider<RuleDescriptionData> identity = new
|
||||
// IdentityValueProvider<RuleDescriptionData>();
|
||||
// CheckBoxSelectionModel<RuleDescriptionData> sm = new
|
||||
// CheckBoxSelectionModel<RuleDescriptionData>(
|
||||
// identity);
|
||||
|
||||
RuleDescriptionDataProperties propsRules = GWT
|
||||
.create(RuleDescriptionDataProperties.class);
|
||||
|
@ -212,6 +212,8 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
sb.append(ruleApplyTemplates.format(value));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> descriptionCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
propsRules.description(), 120, "Description");
|
||||
|
@ -258,10 +260,11 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
|
||||
ColumnModel<RuleDescriptionData> cm = new ColumnModel<RuleDescriptionData>(
|
||||
l);
|
||||
|
||||
StringFilter<RuleDescriptionData> nameFilter = new StringFilter<RuleDescriptionData>(propsRules.name());
|
||||
StringFilter<RuleDescriptionData> descriptionFilter = new StringFilter<RuleDescriptionData>(propsRules.description());
|
||||
|
||||
|
||||
StringFilter<RuleDescriptionData> nameFilter = new StringFilter<RuleDescriptionData>(
|
||||
propsRules.name());
|
||||
StringFilter<RuleDescriptionData> descriptionFilter = new StringFilter<RuleDescriptionData>(
|
||||
propsRules.description());
|
||||
|
||||
// Applicable Rules
|
||||
applicableRulesStore = new ListStore<RuleDescriptionData>(
|
||||
|
@ -278,21 +281,19 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
gridApplicableRules.setColumnReordering(true);
|
||||
gridApplicableRules.setColumnResize(true);
|
||||
gridApplicableRules.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
|
||||
|
||||
GridFilters<RuleDescriptionData> filtersApplicableRules = new GridFilters<RuleDescriptionData>();
|
||||
filtersApplicableRules.initPlugin(gridApplicableRules);
|
||||
filtersApplicableRules.setLocal(true);
|
||||
filtersApplicableRules.addFilter(nameFilter);
|
||||
filtersApplicableRules.addFilter(descriptionFilter);
|
||||
|
||||
|
||||
createContextMenu(gridApplicableRules);
|
||||
|
||||
// Applies Rules
|
||||
appliesRulesStore = new ListStore<RuleDescriptionData>(
|
||||
propsRules.id());
|
||||
appliesRulesStore = new ListStore<RuleDescriptionData>(propsRules.id());
|
||||
|
||||
gridAppliesRules = new Grid<RuleDescriptionData>(
|
||||
appliesRulesStore, cm);
|
||||
gridAppliesRules = new Grid<RuleDescriptionData>(appliesRulesStore, cm);
|
||||
gridAppliesRules.setHeight(RULES_GRID_HEIGHT);
|
||||
gridAppliesRules.getView().setStripeRows(true);
|
||||
gridAppliesRules.getView().setColumnLines(true);
|
||||
|
@ -302,41 +303,43 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
gridAppliesRules.setColumnReordering(true);
|
||||
gridAppliesRules.setColumnResize(true);
|
||||
gridAppliesRules.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
|
||||
GridFilters<RuleDescriptionData> filtersAppliesRules = new GridFilters<RuleDescriptionData>();
|
||||
filtersAppliesRules.initPlugin(gridAppliesRules);
|
||||
filtersAppliesRules.setLocal(true);
|
||||
filtersAppliesRules.addFilter(nameFilter);
|
||||
filtersAppliesRules.addFilter(descriptionFilter);
|
||||
|
||||
//
|
||||
|
||||
|
||||
new GridDragSource<RuleDescriptionData>(gridApplicableRules).setGroup(SET_RULES);
|
||||
new GridDragSource<RuleDescriptionData>(gridAppliesRules).setGroup(SET_RULES);
|
||||
createContextMenu(gridAppliesRules);
|
||||
|
||||
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,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
||||
|
||||
FieldLabel rulesAppliesLabel = new FieldLabel(gridAppliesRules, "Applies Rules");
|
||||
|
||||
|
||||
FieldLabel rulesAppliesLabel = new FieldLabel(gridAppliesRules,
|
||||
"Applies Rules");
|
||||
|
||||
configurationFieldSetLayout.add(rulesAppliesLabel,
|
||||
new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
|
||||
|
||||
// Button
|
||||
btnApply = new TextButton("Apply");
|
||||
btnApply.setIcon(TabularDataResources.INSTANCE.ruleApply());
|
||||
btnApply.setIcon(TabularDataResources.INSTANCE.ruleColumnApply());
|
||||
btnApply.setIconAlign(IconAlign.RIGHT);
|
||||
btnApply.setToolTip("Apply Template");
|
||||
btnApply.addSelectHandler(new SelectHandler() {
|
||||
|
@ -398,11 +401,10 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
protected void updateRulesInGrids(ColumnData columnData) {
|
||||
column = columnData;
|
||||
getApplicableBaseColumnRules();
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void getApplicableBaseColumnRules(){
|
||||
|
||||
protected void getApplicableBaseColumnRules() {
|
||||
ExpressionServiceAsync.INSTANCE.getApplicableBaseColumnRules(column,
|
||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||
|
||||
|
@ -423,15 +425,15 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
@Override
|
||||
public void onSuccess(ArrayList<RuleDescriptionData> result) {
|
||||
Log.trace("loaded " + result.size() + " Rules");
|
||||
applicableRules=result;
|
||||
applicableRules = result;
|
||||
getAppliesBaseColumnRules();
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected void getAppliesBaseColumnRules(){
|
||||
protected void getAppliesBaseColumnRules() {
|
||||
|
||||
ExpressionServiceAsync.INSTANCE.getApplicableBaseColumnRules(column,
|
||||
new AsyncCallback<ArrayList<RuleDescriptionData>>() {
|
||||
|
@ -447,18 +449,21 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
UtilsGXT3.alert("Error retrieving rules",
|
||||
"Error retrieving applicable rules");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ArrayList<RuleDescriptionData> result) {
|
||||
Log.trace("loaded " + result.size() + " Rules");
|
||||
appliesRules=result;
|
||||
appliesRules = result;
|
||||
applicableRulesStore.clear();
|
||||
applicableRulesStore.addAll(applicableRules);
|
||||
applicableRulesStore
|
||||
.addAll(new ArrayList<RuleDescriptionData>(
|
||||
applicableRules));
|
||||
appliesRulesStore.clear();
|
||||
appliesRulesStore.addAll(appliesRules);
|
||||
appliesRulesStore
|
||||
.addAll(new ArrayList<RuleDescriptionData>(
|
||||
appliesRules));
|
||||
forceLayout();
|
||||
|
||||
}
|
||||
|
@ -474,12 +479,26 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
protected void apply() {
|
||||
ArrayList<RuleDescriptionData> selectedRules = getSelectedItems();
|
||||
ColumnData column = comboColumns.getCurrentValue();
|
||||
if (column != null) {
|
||||
RulesOnColumnApplySession rulesOnColumnApplySession = new RulesOnColumnApplySession(
|
||||
trId, column, selectedRules);
|
||||
parent.applyRules(rulesOnColumnApplySession);
|
||||
ArrayList<RuleDescriptionData> selectedRules = getSelectedItems();
|
||||
ArrayList<RuleDescriptionData> rulesToBeApplied = new ArrayList<RuleDescriptionData>();
|
||||
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 {
|
||||
Log.error("No column selected");
|
||||
UtilsGXT3.alert("Attention", "Select a column");
|
||||
|
@ -490,4 +509,96 @@ public class RuleApplyPanel extends FramedPanel {
|
|||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,14 +27,15 @@ public class RuleDeleteDialog extends Window {
|
|||
private static final String WIDTH = "720px";
|
||||
private static final String HEIGHT = "530px";
|
||||
private EventBus eventBus;
|
||||
private RuleDeletePanel ruleDeletePanel;
|
||||
|
||||
public RuleDeleteDialog(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
|
||||
RuleDeletePanel templateDeletePanel = new RuleDeletePanel(this,
|
||||
ruleDeletePanel = new RuleDeletePanel(this,
|
||||
eventBus);
|
||||
add(templateDeletePanel);
|
||||
add(ruleDeletePanel);
|
||||
}
|
||||
|
||||
protected void initWindow() {
|
||||
|
@ -80,7 +81,7 @@ public class RuleDeleteDialog extends Window {
|
|||
public void onSuccess(Void v) {
|
||||
Log.debug("Rule is deleted!");
|
||||
UtilsGXT3.info("Delete Rule", "The rule is deleted!");
|
||||
|
||||
ruleDeletePanel.gridReload();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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.LoadResultListStoreBinding;
|
||||
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.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.MarginData;
|
||||
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.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
|
@ -72,16 +72,15 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
public class RuleDeletePanel extends FramedPanel {
|
||||
private static final String WIDTH = "630px";
|
||||
private static final String HEIGHT = "520px";
|
||||
|
||||
|
||||
interface RuleDeleteTemplates extends XTemplates {
|
||||
@XTemplate("<span title=\"{value}\">{value}</span>")
|
||||
SafeHtml format(String value);
|
||||
}
|
||||
|
||||
|
||||
private EventBus eventBus;
|
||||
private RuleDeleteDialog parent;
|
||||
|
||||
|
||||
private TextButton btnDelete;
|
||||
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>(
|
||||
props.description(), 120, "Description");
|
||||
descriptionCol.setCell(new AbstractCell<String>() {
|
||||
|
@ -145,7 +157,7 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
sb.append(ruleDeleteTemplates.format(value));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ColumnConfig<RuleDescriptionData, String> ownerCol = new ColumnConfig<RuleDescriptionData, String>(
|
||||
props.owner(), 70, "Owner");
|
||||
ownerCol.setCell(new AbstractCell<String>() {
|
||||
|
@ -170,9 +182,10 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
sb.append(ruleDeleteTemplates.format(value));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
|
||||
l.add(nameCol);
|
||||
l.add(scopeCol);
|
||||
l.add(descriptionCol);
|
||||
l.add(ownerCol);
|
||||
l.add(readableExpressionCol);
|
||||
|
@ -253,9 +266,9 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
grid.setColumnReordering(true);
|
||||
grid.setColumnResize(true);
|
||||
grid.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
|
||||
createContextMenu();
|
||||
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(grid);
|
||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||
|
@ -392,59 +405,71 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
|
||||
final Dialog infoRuleDialog = new Dialog();
|
||||
infoRuleDialog.setHeadingText("Info Rule");
|
||||
infoRuleDialog.getHeader().setIcon(TabularDataResources.INSTANCE.information());
|
||||
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));
|
||||
|
||||
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)));
|
||||
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
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() {
|
||||
Menu contextMenu = new Menu();
|
||||
|
||||
|
@ -455,17 +480,17 @@ public class RuleDeletePanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
RuleDescriptionData selected = grid.getSelectionModel().getSelectedItem();
|
||||
RuleDescriptionData selected = grid.getSelectionModel()
|
||||
.getSelectedItem();
|
||||
Log.debug(selected.toString());
|
||||
requestInfo(selected);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
contextMenu.add(infoItem);
|
||||
|
||||
grid.setContextMenu(contextMenu);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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.ListLoader;
|
||||
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.PredefinedButton;
|
||||
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>(
|
||||
props.description(), 120, "Description");
|
||||
descriptionCol.setCell(new AbstractCell<String>() {
|
||||
|
@ -179,6 +191,7 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
|
||||
List<ColumnConfig<RuleDescriptionData, ?>> l = new ArrayList<ColumnConfig<RuleDescriptionData, ?>>();
|
||||
l.add(nameCol);
|
||||
l.add(scopeCol);
|
||||
l.add(descriptionCol);
|
||||
l.add(ownerCol);
|
||||
l.add(readableExpressionCol);
|
||||
|
@ -261,7 +274,7 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
grid.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
createContextMenu();
|
||||
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(grid);
|
||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||
|
@ -400,59 +413,71 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
|
||||
final Dialog infoRuleDialog = new Dialog();
|
||||
infoRuleDialog.setHeadingText("Info Rule");
|
||||
infoRuleDialog.getHeader().setIcon(TabularDataResources.INSTANCE.information());
|
||||
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));
|
||||
|
||||
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)));
|
||||
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
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() {
|
||||
Menu contextMenu = new Menu();
|
||||
|
||||
|
@ -463,15 +488,16 @@ public class RuleOpenPanel extends FramedPanel {
|
|||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
RuleDescriptionData selected = grid.getSelectionModel().getSelectedItem();
|
||||
RuleDescriptionData selected = grid.getSelectionModel()
|
||||
.getSelectedItem();
|
||||
Log.debug(selected.toString());
|
||||
requestInfo(selected);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
contextMenu.add(infoItem);
|
||||
|
||||
grid.setContextMenu(contextMenu);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 819 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 819 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 863 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 877 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 969 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 958 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,11 +1,12 @@
|
|||
ruleGroupHeadingText = Manage
|
||||
ruleNewButton = New
|
||||
ruleNewButtonToolTip = New
|
||||
ruleEditButton = Edit
|
||||
ruleEditButtonToolTip = Edit
|
||||
ruleEditButton = Open
|
||||
ruleEditButtonToolTip = Open
|
||||
ruleDeleteButton = Delete
|
||||
ruleDeleteButtonToolTip = Delete
|
||||
ruleShareButton = Share
|
||||
ruleShareButtonToolTip = Share
|
||||
ruleOnColumnGroupHeadingText = On Column
|
||||
ruleNewButton = New
|
||||
ruleNewButtonToolTip = New
|
||||
ruleApplyButton = Apply
|
||||
ruleApplyButtonToolTip = Apply
|
||||
ruleShareButton = Share
|
||||
ruleShareButtonToolTip = Share
|
|
@ -1,11 +1,12 @@
|
|||
ruleGroupHeadingText = Gestionar
|
||||
ruleNewButton = Nuevo
|
||||
ruleNewButtonToolTip = Nuevo
|
||||
ruleEditButton = Editar
|
||||
ruleEditButtonToolTip = Editar
|
||||
ruleEditButton = Abre
|
||||
ruleEditButtonToolTip = Abre
|
||||
ruleDeleteButton = Borrar
|
||||
ruleDeleteButtonToolTip = Borrar
|
||||
ruleApplyButton = Aplicar
|
||||
ruleApplyButtonToolTip = Aplicar
|
||||
ruleShareButton = Cuota
|
||||
ruleShareButtonToolTip = Cuota
|
||||
ruleShareButtonToolTip = Cuota
|
||||
ruleOnColumnGroupHeadingText = On Columna
|
||||
ruleNewButton = Nuevo
|
||||
ruleNewButtonToolTip = Nuevo
|
||||
ruleApplyButton = Aplicar
|
||||
ruleApplyButtonToolTip = Aplicar
|
|
@ -1,11 +1,12 @@
|
|||
ruleGroupHeadingText = Gestisci
|
||||
ruleNewButton = Nuovo
|
||||
ruleNewButtonToolTip = Nuovo
|
||||
ruleEditButton = Modifica
|
||||
ruleEditButtonToolTip = Modifica
|
||||
ruleEditButton = Apri
|
||||
ruleEditButtonToolTip = Apri
|
||||
ruleDeleteButton = Elimina
|
||||
ruleDeleteButtonToolTip = Elimina
|
||||
ruleApplyButton = Applica
|
||||
ruleApplyButtonToolTip = Applica
|
||||
ruleShareButton = Condividi
|
||||
ruleShareButtonToolTip = Condividi
|
||||
ruleShareButtonToolTip = Condividi
|
||||
ruleOnColumnGroupHeadingText = Su Colonna
|
||||
ruleNewButton = Nuova
|
||||
ruleNewButtonToolTip = Nuova
|
||||
ruleApplyButton = Applica
|
||||
ruleApplyButtonToolTip = Applica
|