Updated Rules
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114347 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c7bd80cf99
commit
ddd2be5167
|
@ -8,7 +8,7 @@ import java.util.HashMap;
|
||||||
import org.gcube.portlets.user.td.chartswidget.client.ChartsWidgetTD;
|
import org.gcube.portlets.user.td.chartswidget.client.ChartsWidgetTD;
|
||||||
import org.gcube.portlets.user.td.client.logs.TDMLogs;
|
import org.gcube.portlets.user.td.client.logs.TDMLogs;
|
||||||
import org.gcube.portlets.user.td.client.rstudio.RStudio;
|
import org.gcube.portlets.user.td.client.rstudio.RStudio;
|
||||||
import org.gcube.portlets.user.td.client.rule.RuleAppliedDialog;
|
import org.gcube.portlets.user.td.client.rule.RuleActiveDialog;
|
||||||
import org.gcube.portlets.user.td.client.rule.RuleApplyDialog;
|
import org.gcube.portlets.user.td.client.rule.RuleApplyDialog;
|
||||||
import org.gcube.portlets.user.td.client.rule.RuleDeleteDialog;
|
import org.gcube.portlets.user.td.client.rule.RuleDeleteDialog;
|
||||||
import org.gcube.portlets.user.td.client.rule.RuleOpenDialog;
|
import org.gcube.portlets.user.td.client.rule.RuleOpenDialog;
|
||||||
|
@ -907,7 +907,7 @@ public class TabularDataController {
|
||||||
case RULE_APPLY:
|
case RULE_APPLY:
|
||||||
openApplyRule();
|
openApplyRule();
|
||||||
break;
|
break;
|
||||||
case RULES_APPLIED_ON_TABULAR_RESOURCE:
|
case RULES_ACTIVE:
|
||||||
openRulesAppliedOnTabularResource();
|
openRulesAppliedOnTabularResource();
|
||||||
break;
|
break;
|
||||||
case RULE_SHARE:
|
case RULE_SHARE:
|
||||||
|
@ -1759,7 +1759,7 @@ public class TabularDataController {
|
||||||
private void openRulesAppliedOnTabularResource() {
|
private void openRulesAppliedOnTabularResource() {
|
||||||
Log.debug("Request Open Rules Applied on TabularResource Dialog");
|
Log.debug("Request Open Rules Applied on TabularResource Dialog");
|
||||||
if (trId != null) {
|
if (trId != null) {
|
||||||
RuleAppliedDialog raDialog = new RuleAppliedDialog(
|
RuleActiveDialog raDialog = new RuleActiveDialog(
|
||||||
trId, eventBus);
|
trId, eventBus);
|
||||||
raDialog.show();
|
raDialog.show();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -171,11 +171,17 @@ public interface TabularDataResources extends ClientBundle {
|
||||||
@Source("rule-column-apply_32.png")
|
@Source("rule-column-apply_32.png")
|
||||||
ImageResource ruleColumnApply32();
|
ImageResource ruleColumnApply32();
|
||||||
|
|
||||||
|
@Source("rule-column-detach.png")
|
||||||
|
ImageResource ruleColumnDetach();
|
||||||
|
|
||||||
|
@Source("rule-column-detach_32.png")
|
||||||
|
ImageResource ruleColumnDetach32();
|
||||||
|
|
||||||
@Source("rule-tabularresource.png")
|
@Source("rule-tabularresource.png")
|
||||||
ImageResource ruleTabularResource();
|
ImageResource ruleTabularResource();
|
||||||
|
|
||||||
@Source("rule-tabularresource_32.png")
|
@Source("rule-tabularresource_32.png")
|
||||||
ImageResource ruleTabularResource32();
|
ImageResource ruleActive32();
|
||||||
|
|
||||||
|
|
||||||
@Source("table-filter_32.png")
|
@Source("table-filter_32.png")
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 862 B |
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -39,7 +39,7 @@ public class RuleToolBar {
|
||||||
// Rules
|
// Rules
|
||||||
private TextButton ruleOpenButton;
|
private TextButton ruleOpenButton;
|
||||||
private TextButton ruleDeleteButton;
|
private TextButton ruleDeleteButton;
|
||||||
private TextButton ruleOnTabularResourceButton;
|
private TextButton ruleActiveButton;
|
||||||
private TextButton ruleShareButton;
|
private TextButton ruleShareButton;
|
||||||
|
|
||||||
// On Column
|
// On Column
|
||||||
|
@ -107,24 +107,24 @@ public class RuleToolBar {
|
||||||
ruleLayout.setWidget(0, 1, ruleDeleteButton);
|
ruleLayout.setWidget(0, 1, ruleDeleteButton);
|
||||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
ruleLayout.getFlexCellFormatter().setRowSpan(0, 1, 2);
|
||||||
|
|
||||||
ruleOnTabularResourceButton = new TextButton(
|
ruleActiveButton = new TextButton(
|
||||||
msgs.ruleTabularResourceButton(),
|
msgs.ruleActiveButton(),
|
||||||
TabularDataResources.INSTANCE.ruleTabularResource32());
|
TabularDataResources.INSTANCE.ruleActive32());
|
||||||
ruleOnTabularResourceButton.disable();
|
ruleActiveButton.disable();
|
||||||
ruleOnTabularResourceButton.setScale(ButtonScale.LARGE);
|
ruleActiveButton.setScale(ButtonScale.LARGE);
|
||||||
ruleOnTabularResourceButton.setIconAlign(IconAlign.TOP);
|
ruleActiveButton.setIconAlign(IconAlign.TOP);
|
||||||
ruleOnTabularResourceButton.setToolTip(msgs
|
ruleActiveButton.setToolTip(msgs
|
||||||
.ruleTabularResourceButtonToolTip());
|
.ruleActiveButtonToolTip());
|
||||||
ruleOnTabularResourceButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
ruleActiveButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
ruleOnTabularResourceButton.addSelectHandler(new SelectHandler() {
|
ruleActiveButton.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
eventBus.fireEvent(new RibbonEvent(
|
eventBus.fireEvent(new RibbonEvent(
|
||||||
RibbonType.RULES_APPLIED_ON_TABULAR_RESOURCE));
|
RibbonType.RULES_ACTIVE));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ruleLayout.setWidget(0, 2, ruleOnTabularResourceButton);
|
ruleLayout.setWidget(0, 2, ruleActiveButton);
|
||||||
ruleLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
ruleLayout.getFlexCellFormatter().setRowSpan(0, 2, 2);
|
||||||
|
|
||||||
ruleShareButton = new TextButton(msgs.ruleShareButton(),
|
ruleShareButton = new TextButton(msgs.ruleShareButton(),
|
||||||
|
@ -222,7 +222,7 @@ public class RuleToolBar {
|
||||||
case START:
|
case START:
|
||||||
ruleOpenButton.enable();
|
ruleOpenButton.enable();
|
||||||
ruleDeleteButton.enable();
|
ruleDeleteButton.enable();
|
||||||
ruleOnTabularResourceButton.disable();
|
ruleActiveButton.disable();
|
||||||
ruleShareButton.enable();
|
ruleShareButton.enable();
|
||||||
ruleOnColumnNewButton.enable();
|
ruleOnColumnNewButton.enable();
|
||||||
ruleOnColumnApplyButton.disable();
|
ruleOnColumnApplyButton.disable();
|
||||||
|
@ -231,7 +231,7 @@ public class RuleToolBar {
|
||||||
case TR_READONLY:
|
case TR_READONLY:
|
||||||
ruleOpenButton.enable();
|
ruleOpenButton.enable();
|
||||||
ruleDeleteButton.enable();
|
ruleDeleteButton.enable();
|
||||||
ruleOnTabularResourceButton.disable();
|
ruleActiveButton.disable();
|
||||||
ruleShareButton.enable();
|
ruleShareButton.enable();
|
||||||
ruleOnColumnNewButton.enable();
|
ruleOnColumnNewButton.enable();
|
||||||
ruleOnColumnApplyButton.disable();
|
ruleOnColumnApplyButton.disable();
|
||||||
|
@ -242,7 +242,7 @@ public class RuleToolBar {
|
||||||
case TABLECURATION:
|
case TABLECURATION:
|
||||||
ruleOpenButton.enable();
|
ruleOpenButton.enable();
|
||||||
ruleDeleteButton.enable();
|
ruleDeleteButton.enable();
|
||||||
ruleOnTabularResourceButton.enable();
|
ruleActiveButton.enable();
|
||||||
ruleShareButton.enable();
|
ruleShareButton.enable();
|
||||||
ruleOnColumnNewButton.enable();
|
ruleOnColumnNewButton.enable();
|
||||||
ruleOnColumnApplyButton.enable();
|
ruleOnColumnApplyButton.enable();
|
||||||
|
@ -251,7 +251,7 @@ public class RuleToolBar {
|
||||||
case WIZARD_OPEN:
|
case WIZARD_OPEN:
|
||||||
ruleOpenButton.disable();
|
ruleOpenButton.disable();
|
||||||
ruleDeleteButton.disable();
|
ruleDeleteButton.disable();
|
||||||
ruleOnTabularResourceButton.disable();
|
ruleActiveButton.disable();
|
||||||
ruleShareButton.disable();
|
ruleShareButton.disable();
|
||||||
ruleOnColumnNewButton.disable();
|
ruleOnColumnNewButton.disable();
|
||||||
ruleOnColumnApplyButton.disable();
|
ruleOnColumnApplyButton.disable();
|
||||||
|
|
|
@ -32,10 +32,10 @@ public interface RuleToolBarMessages extends Messages {
|
||||||
String ruleShareButtonToolTip();
|
String ruleShareButtonToolTip();
|
||||||
|
|
||||||
@DefaultMessage("Applied")
|
@DefaultMessage("Applied")
|
||||||
String ruleTabularResourceButton();
|
String ruleActiveButton();
|
||||||
|
|
||||||
@DefaultMessage("Applied")
|
@DefaultMessage("Applied")
|
||||||
String ruleTabularResourceButtonToolTip();
|
String ruleActiveButtonToolTip();
|
||||||
|
|
||||||
|
|
||||||
@DefaultMessage("On Column")
|
@DefaultMessage("On Column")
|
||||||
|
|
|
@ -14,15 +14,15 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RuleAppliedDialog extends Window {
|
public class RuleActiveDialog extends Window {
|
||||||
private static final String WIDTH = "720px";
|
private static final String WIDTH = "720px";
|
||||||
private static final String HEIGHT = "428px";
|
private static final String HEIGHT = "428px";
|
||||||
public RuleAppliedDialog(TRId trId, EventBus eventBus) {
|
public RuleActiveDialog(TRId trId, EventBus eventBus) {
|
||||||
initWindow();
|
initWindow();
|
||||||
|
|
||||||
RuleAppliedPanel ruleApplyPanel = new RuleAppliedPanel(this,
|
RuleActivePanel ruleActivePanel = new RuleActivePanel(this,
|
||||||
trId, eventBus);
|
trId, eventBus);
|
||||||
add(ruleApplyPanel);
|
add(ruleActivePanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initWindow() {
|
protected void initWindow() {
|
||||||
|
@ -30,7 +30,7 @@ public class RuleAppliedDialog extends Window {
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
setBodyBorder(false);
|
setBodyBorder(false);
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setHeadingText("Rules Applied On TabularResource");
|
setHeadingText("Active Rules On TabularResource");
|
||||||
setClosable(true);
|
setClosable(true);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
forceLayoutOnResize = true;
|
forceLayoutOnResize = true;
|
|
@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalExcept
|
||||||
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.AppliedRulesResponseData;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.AppliedRulesResponseData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.DetachColumnRulesSession;
|
||||||
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.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;
|
||||||
|
@ -65,7 +66,7 @@ import com.sencha.gxt.widget.core.client.menu.MenuItem;
|
||||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RuleAppliedPanel extends FramedPanel {
|
public class RuleActivePanel extends FramedPanel {
|
||||||
private static final int RULE_ON_COLUMN_FIELDSET_HEIGHT = 348;
|
private static final int RULE_ON_COLUMN_FIELDSET_HEIGHT = 348;
|
||||||
private static final String RULES_GRID_HEIGHT = "102px";
|
private static final String RULES_GRID_HEIGHT = "102px";
|
||||||
private static final String WIDTH = "630px";
|
private static final String WIDTH = "630px";
|
||||||
|
@ -77,20 +78,21 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private EventBus eventBus;
|
private EventBus eventBus;
|
||||||
private RuleAppliedDialog parent;
|
private RuleActiveDialog parent;
|
||||||
private TRId trId;
|
private TRId trId;
|
||||||
private ArrayList<ColumnData> columns;
|
private ArrayList<ColumnData> columns;
|
||||||
|
|
||||||
private AppliedRulesResponseData appliedRuleResponseData;
|
private AppliedRulesResponseData appliedRuleResponseData;
|
||||||
|
|
||||||
private TextButton btnClose;
|
private TextButton btnClose;
|
||||||
|
private VerticalLayoutContainer mainLayoutContainer;
|
||||||
|
|
||||||
public RuleAppliedPanel(RuleAppliedDialog parent, TRId trId,
|
public RuleActivePanel(RuleActiveDialog parent, TRId trId,
|
||||||
EventBus eventBus) {
|
EventBus eventBus) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.trId = trId;
|
this.trId = trId;
|
||||||
|
|
||||||
Log.debug("RuleAppliedPanel");
|
Log.debug("RuleActivePanel");
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
setHeight(HEIGHT);
|
setHeight(HEIGHT);
|
||||||
setHeaderVisible(false);
|
setHeaderVisible(false);
|
||||||
|
@ -140,7 +142,7 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
}
|
}
|
||||||
columns = result;
|
columns = result;
|
||||||
|
|
||||||
getAppliedBaseColumnRules();
|
getActiveRulesOnColumn();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -148,7 +150,7 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
|
|
||||||
protected void create() {
|
protected void create() {
|
||||||
|
|
||||||
Log.debug("Create RuleAppliedPanel(): " + trId);
|
Log.debug("Create RuleActivePanel(): " + trId);
|
||||||
|
|
||||||
// SimpleContainer rulesOnColumnContainer=new SimpleContainer();
|
// SimpleContainer rulesOnColumnContainer=new SimpleContainer();
|
||||||
FieldSet columnRulesFieldSet = new FieldSet();
|
FieldSet columnRulesFieldSet = new FieldSet();
|
||||||
|
@ -200,12 +202,12 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
mainLayoutContainer = new VerticalLayoutContainer();
|
||||||
v.add(columnRulesFieldSet, new VerticalLayoutData(-1,
|
mainLayoutContainer.add(columnRulesFieldSet, new VerticalLayoutData(-1,
|
||||||
RULE_ON_COLUMN_FIELDSET_HEIGHT, new Margins(0)));
|
RULE_ON_COLUMN_FIELDSET_HEIGHT, new Margins(0)));
|
||||||
v.add(flowButton,
|
mainLayoutContainer.add(flowButton,
|
||||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||||
add(v);
|
add(mainLayoutContainer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,6 +294,7 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
|
|
||||||
final Grid<RuleDescriptionData> gridAppliedRules = new Grid<RuleDescriptionData>(
|
final Grid<RuleDescriptionData> gridAppliedRules = new Grid<RuleDescriptionData>(
|
||||||
appliedRulesStore, cm);
|
appliedRulesStore, cm);
|
||||||
|
gridAppliedRules.setItemId(column.getColumnId());
|
||||||
gridAppliedRules.setHeight(RULES_GRID_HEIGHT);
|
gridAppliedRules.setHeight(RULES_GRID_HEIGHT);
|
||||||
gridAppliedRules.getView().setStripeRows(true);
|
gridAppliedRules.getView().setStripeRows(true);
|
||||||
gridAppliedRules.getView().setColumnLines(true);
|
gridAppliedRules.getView().setColumnLines(true);
|
||||||
|
@ -316,9 +319,38 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
return rulesAppliedLabel;
|
return rulesAppliedLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getAppliedBaseColumnRules() {
|
protected void getActiveRulesOnColumn() {
|
||||||
|
|
||||||
ExpressionServiceAsync.INSTANCE.getAppliedRulesByTabularResourceId(
|
ExpressionServiceAsync.INSTANCE.getActiveRulesByTabularResourceId(
|
||||||
|
trId, new AsyncCallback<AppliedRulesResponseData>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving active rules",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(AppliedRulesResponseData result) {
|
||||||
|
Log.trace("AppliedRuleResponseData: " + result);
|
||||||
|
appliedRuleResponseData = result;
|
||||||
|
create();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void updateActiveRulesOnColumn() {
|
||||||
|
|
||||||
|
ExpressionServiceAsync.INSTANCE.getActiveRulesByTabularResourceId(
|
||||||
trId, new AsyncCallback<AppliedRulesResponseData>() {
|
trId, new AsyncCallback<AppliedRulesResponseData>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -338,15 +370,19 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
public void onSuccess(AppliedRulesResponseData result) {
|
public void onSuccess(AppliedRulesResponseData result) {
|
||||||
Log.trace("AppliedRuleResponseData: " + result);
|
Log.trace("AppliedRuleResponseData: " + result);
|
||||||
appliedRuleResponseData = result;
|
appliedRuleResponseData = result;
|
||||||
create();
|
recreate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void close() {
|
protected void close() {
|
||||||
parent.close();
|
parent.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void requestInfo(RuleDescriptionData rule) {
|
protected void requestInfo(RuleDescriptionData rule) {
|
||||||
|
|
||||||
|
@ -422,6 +458,7 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
|
|
||||||
MenuItem infoItem = new MenuItem();
|
MenuItem infoItem = new MenuItem();
|
||||||
infoItem.setText("Info");
|
infoItem.setText("Info");
|
||||||
|
infoItem.setToolTip("Info");
|
||||||
infoItem.setIcon(TabularDataResources.INSTANCE.information());
|
infoItem.setIcon(TabularDataResources.INSTANCE.information());
|
||||||
infoItem.addSelectionHandler(new SelectionHandler<Item>() {
|
infoItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
|
||||||
|
@ -433,6 +470,24 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
requestInfo(selected);
|
requestInfo(selected);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
MenuItem detachItem = new MenuItem();
|
||||||
|
detachItem.setText("Detach");
|
||||||
|
detachItem.setToolTip("Detach rule");
|
||||||
|
detachItem.setIcon(TabularDataResources.INSTANCE.ruleColumnDetach());
|
||||||
|
detachItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelection(SelectionEvent<Item> event) {
|
||||||
|
RuleDescriptionData selected = grid.getSelectionModel()
|
||||||
|
.getSelectedItem();
|
||||||
|
Log.debug(selected.toString());
|
||||||
|
requestDetach(selected, grid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
contextMenu.add(infoItem);
|
contextMenu.add(infoItem);
|
||||||
|
|
||||||
|
@ -440,4 +495,53 @@ public class RuleAppliedPanel extends FramedPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void requestDetach(RuleDescriptionData selected,
|
||||||
|
final Grid<RuleDescriptionData> grid) {
|
||||||
|
|
||||||
|
String columnLocalId=grid.getItemId();
|
||||||
|
ColumnData columnData=new ColumnData();
|
||||||
|
columnData.setColumnId(columnLocalId);
|
||||||
|
ArrayList<RuleDescriptionData> detachRules=new ArrayList<RuleDescriptionData>();
|
||||||
|
detachRules.add(selected);
|
||||||
|
|
||||||
|
DetachColumnRulesSession detachColumnRulesSession=new DetachColumnRulesSession(trId, columnData, detachRules);
|
||||||
|
|
||||||
|
ExpressionServiceAsync.INSTANCE.setDetachColumnRules(detachColumnRulesSession,
|
||||||
|
new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
eventBus.fireEvent(new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error in detach rules",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Void result) {
|
||||||
|
updateActiveRulesOnColumn();
|
||||||
|
Log.debug("The rule is detached!");
|
||||||
|
UtilsGXT3.info("Detach Rule",
|
||||||
|
"The rule is detached!");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected void recreate(){
|
||||||
|
remove(mainLayoutContainer);
|
||||||
|
create();
|
||||||
|
forceLayout();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -99,8 +99,8 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
private ComboBox<ColumnData> comboColumns;
|
private ComboBox<ColumnData> comboColumns;
|
||||||
private ListStore<RuleDescriptionData> applicableRulesStore;
|
private ListStore<RuleDescriptionData> applicableRulesStore;
|
||||||
private Grid<RuleDescriptionData> gridApplicableRules;
|
private Grid<RuleDescriptionData> gridApplicableRules;
|
||||||
private ListStore<RuleDescriptionData> appliesRulesStore;
|
private ListStore<RuleDescriptionData> selectedRulesStore;
|
||||||
private Grid<RuleDescriptionData> gridAppliesRules;
|
private Grid<RuleDescriptionData> gridSelectedRules;
|
||||||
|
|
||||||
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
public RuleApplyPanel(RuleApplyDialog parent, TRId trId, EventBus eventBus) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
@ -292,38 +292,38 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
|
|
||||||
createContextMenu(gridApplicableRules);
|
createContextMenu(gridApplicableRules);
|
||||||
|
|
||||||
// Applies Rules
|
// Selected Rules
|
||||||
appliesRulesStore = new ListStore<RuleDescriptionData>(propsRules.id());
|
selectedRulesStore = new ListStore<RuleDescriptionData>(propsRules.id());
|
||||||
|
|
||||||
gridAppliesRules = new Grid<RuleDescriptionData>(appliesRulesStore, cm);
|
gridSelectedRules = new Grid<RuleDescriptionData>(selectedRulesStore, cm);
|
||||||
gridAppliesRules.setHeight(RULES_GRID_HEIGHT);
|
gridSelectedRules.setHeight(RULES_GRID_HEIGHT);
|
||||||
gridAppliesRules.getView().setStripeRows(true);
|
gridSelectedRules.getView().setStripeRows(true);
|
||||||
gridAppliesRules.getView().setColumnLines(true);
|
gridSelectedRules.getView().setColumnLines(true);
|
||||||
gridAppliesRules.getView().setAutoFill(true);
|
gridSelectedRules.getView().setAutoFill(true);
|
||||||
gridAppliesRules.setBorders(false);
|
gridSelectedRules.setBorders(false);
|
||||||
gridAppliesRules.setLoadMask(true);
|
gridSelectedRules.setLoadMask(true);
|
||||||
gridAppliesRules.setColumnReordering(true);
|
gridSelectedRules.setColumnReordering(true);
|
||||||
gridAppliesRules.setColumnResize(true);
|
gridSelectedRules.setColumnResize(true);
|
||||||
gridAppliesRules.getView().setAutoExpandColumn(descriptionCol);
|
gridSelectedRules.getView().setAutoExpandColumn(descriptionCol);
|
||||||
|
|
||||||
GridFilters<RuleDescriptionData> filtersAppliesRules = new GridFilters<RuleDescriptionData>();
|
GridFilters<RuleDescriptionData> filtersSelectedRules = new GridFilters<RuleDescriptionData>();
|
||||||
filtersAppliesRules.initPlugin(gridAppliesRules);
|
filtersSelectedRules.initPlugin(gridSelectedRules);
|
||||||
filtersAppliesRules.setLocal(true);
|
filtersSelectedRules.setLocal(true);
|
||||||
filtersAppliesRules.addFilter(nameFilter);
|
filtersSelectedRules.addFilter(nameFilter);
|
||||||
filtersAppliesRules.addFilter(descriptionFilter);
|
filtersSelectedRules.addFilter(descriptionFilter);
|
||||||
|
|
||||||
createContextMenu(gridAppliesRules);
|
createContextMenu(gridSelectedRules);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
new GridDragSource<RuleDescriptionData>(gridApplicableRules)
|
new GridDragSource<RuleDescriptionData>(gridApplicableRules)
|
||||||
.setGroup(SET_RULES);
|
.setGroup(SET_RULES);
|
||||||
new GridDragSource<RuleDescriptionData>(gridAppliesRules)
|
new GridDragSource<RuleDescriptionData>(gridSelectedRules)
|
||||||
.setGroup(SET_RULES);
|
.setGroup(SET_RULES);
|
||||||
|
|
||||||
new GridDropTarget<RuleDescriptionData>(gridApplicableRules)
|
new GridDropTarget<RuleDescriptionData>(gridApplicableRules)
|
||||||
.setGroup(SET_RULES);
|
.setGroup(SET_RULES);
|
||||||
new GridDropTarget<RuleDescriptionData>(gridAppliesRules)
|
new GridDropTarget<RuleDescriptionData>(gridSelectedRules)
|
||||||
.setGroup(SET_RULES);
|
.setGroup(SET_RULES);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -333,17 +333,17 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
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 rulesSelectedLabel = new FieldLabel(gridSelectedRules,
|
||||||
"Applies Rules");
|
"Selected Rules");
|
||||||
|
|
||||||
configurationFieldSetLayout.add(rulesAppliesLabel,
|
configurationFieldSetLayout.add(rulesSelectedLabel,
|
||||||
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.ruleColumnApply());
|
btnApply.setIcon(TabularDataResources.INSTANCE.ruleColumnApply());
|
||||||
btnApply.setIconAlign(IconAlign.RIGHT);
|
btnApply.setIconAlign(IconAlign.RIGHT);
|
||||||
btnApply.setToolTip("Apply Template");
|
btnApply.setToolTip("Apply Rule");
|
||||||
btnApply.addSelectHandler(new SelectHandler() {
|
btnApply.addSelectHandler(new SelectHandler() {
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
|
@ -403,7 +403,7 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
protected void updateRulesInGrids(ColumnData columnData) {
|
protected void updateRulesInGrids(ColumnData columnData) {
|
||||||
column = columnData;
|
column = columnData;
|
||||||
applicableRulesStore.clear();
|
applicableRulesStore.clear();
|
||||||
appliesRulesStore.clear();
|
selectedRulesStore.clear();
|
||||||
HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping = appliedRuleResponseData
|
HashMap<String, ArrayList<RuleDescriptionData>> columnRuleMapping = appliedRuleResponseData
|
||||||
.getColumnRuleMapping();
|
.getColumnRuleMapping();
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
|
|
||||||
if (applied != null) {
|
if (applied != null) {
|
||||||
appliedRules = applied;
|
appliedRules = applied;
|
||||||
appliesRulesStore.addAll(new ArrayList<RuleDescriptionData>(
|
selectedRulesStore.addAll(new ArrayList<RuleDescriptionData>(
|
||||||
applied));
|
applied));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
|
|
||||||
protected void getAppliedBaseColumnRules() {
|
protected void getAppliedBaseColumnRules() {
|
||||||
|
|
||||||
ExpressionServiceAsync.INSTANCE.getAppliedRulesByTabularResourceId(
|
ExpressionServiceAsync.INSTANCE.getActiveRulesByTabularResourceId(
|
||||||
trId, new AsyncCallback<AppliedRulesResponseData>() {
|
trId, new AsyncCallback<AppliedRulesResponseData>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -482,7 +482,7 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.error(caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving applied rules",
|
UtilsGXT3.alert("Error retrieving selected rules",
|
||||||
caught.getLocalizedMessage());
|
caught.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ public class RuleApplyPanel extends FramedPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ArrayList<RuleDescriptionData> getSelectedItems() {
|
protected ArrayList<RuleDescriptionData> getSelectedItems() {
|
||||||
List<RuleDescriptionData> selectedItems = appliesRulesStore.getAll();
|
List<RuleDescriptionData> selectedItems = selectedRulesStore.getAll();
|
||||||
ArrayList<RuleDescriptionData> rulesSelected = new ArrayList<RuleDescriptionData>(
|
ArrayList<RuleDescriptionData> rulesSelected = new ArrayList<RuleDescriptionData>(
|
||||||
selectedItems);
|
selectedItems);
|
||||||
return rulesSelected;
|
return rulesSelected;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 862 B |
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -5,8 +5,8 @@ ruleDeleteButton = Delete
|
||||||
ruleDeleteButtonToolTip = Delete
|
ruleDeleteButtonToolTip = Delete
|
||||||
ruleShareButton = Share
|
ruleShareButton = Share
|
||||||
ruleShareButtonToolTip = Share
|
ruleShareButtonToolTip = Share
|
||||||
ruleTabularResourceButton = Applied
|
ruleActiveButton = Active
|
||||||
ruleTabularResourceButtonToolTip = Applied
|
ruleActiveButtonToolTip = Active
|
||||||
ruleOnColumnGroupHeadingText = On Column
|
ruleOnColumnGroupHeadingText = On Column
|
||||||
ruleNewButton = New
|
ruleNewButton = New
|
||||||
ruleNewButtonToolTip = New
|
ruleNewButtonToolTip = New
|
||||||
|
|
|
@ -5,8 +5,8 @@ ruleDeleteButton = Borrar
|
||||||
ruleDeleteButtonToolTip = Borrar
|
ruleDeleteButtonToolTip = Borrar
|
||||||
ruleShareButton = Cuota
|
ruleShareButton = Cuota
|
||||||
ruleShareButtonToolTip = Cuota
|
ruleShareButtonToolTip = Cuota
|
||||||
ruleTabularResourceButton = Aplicado
|
ruleActiveButton = Activo
|
||||||
ruleTabularResourceButtonToolTip = Aplicado
|
ruleActiveToolTip = Activo
|
||||||
ruleOnColumnGroupHeadingText = On Columna
|
ruleOnColumnGroupHeadingText = On Columna
|
||||||
ruleNewButton = Nuevo
|
ruleNewButton = Nuevo
|
||||||
ruleNewButtonToolTip = Nuevo
|
ruleNewButtonToolTip = Nuevo
|
||||||
|
|
|
@ -5,8 +5,8 @@ ruleDeleteButton = Elimina
|
||||||
ruleDeleteButtonToolTip = Elimina
|
ruleDeleteButtonToolTip = Elimina
|
||||||
ruleShareButton = Condividi
|
ruleShareButton = Condividi
|
||||||
ruleShareButtonToolTip = Condividi
|
ruleShareButtonToolTip = Condividi
|
||||||
ruleTabularResourceButton = Applicate
|
ruleActiveButton = Attive
|
||||||
ruleTabularResourceButtonToolTip = Applicate
|
ruleActiveButtonToolTip = Attive
|
||||||
ruleOnColumnGroupHeadingText = Su Colonna
|
ruleOnColumnGroupHeadingText = Su Colonna
|
||||||
ruleNewButton = Nuova
|
ruleNewButton = Nuova
|
||||||
ruleNewButtonToolTip = Nuova
|
ruleNewButtonToolTip = Nuova
|
||||||
|
|
Loading…
Reference in New Issue