Updated Rules

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@114384 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-04-23 16:43:47 +00:00
parent 3cf6eb1e66
commit ecc8cd4e8a
6 changed files with 107 additions and 352 deletions

View File

@ -34,23 +34,18 @@ import com.sencha.gxt.core.client.XTemplates;
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.widget.core.client.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;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
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;
@ -385,73 +380,10 @@ public class RuleActivePanel extends FramedPanel {
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setModal(true);
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.getOwnerLogin());
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);
final RuleInfoDialog infoRuleDialog = new RuleInfoDialog(rule);
infoRuleDialog.show();
}
protected void createContextMenu(final Grid<RuleDescriptionData> grid) {

View File

@ -39,15 +39,12 @@ 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;
@ -55,8 +52,6 @@ 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;
@ -575,73 +570,10 @@ public class RuleApplyPanel extends FramedPanel {
}
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setModal(true);
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.getOwnerLogin());
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);
final RuleInfoDialog infoRuleDialog = new RuleInfoDialog(rule);
infoRuleDialog.show();
}
protected void createContextMenu(final Grid<RuleDescriptionData> grid) {

View File

@ -42,22 +42,16 @@ 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.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;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
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.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
@ -404,72 +398,10 @@ public class RuleDeletePanel extends FramedPanel {
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setModal(true);
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.getOwnerLogin());
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);
final RuleInfoDialog infoRuleDialog = new RuleInfoDialog(rule);
infoRuleDialog.show();
}
protected void createContextMenu() {

View File

@ -0,0 +1,98 @@
package org.gcube.portlets.user.td.client.rule;
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
import org.gcube.portlets.user.td.gwtservice.shared.rule.RuleDescriptionData;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.Dialog;
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
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.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;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class RuleInfoDialog extends Dialog {
RuleDescriptionData ruleDescriptionData;
public RuleInfoDialog(RuleDescriptionData ruleDescriptionData){
this.ruleDescriptionData=ruleDescriptionData;
initWindow();
create();
}
protected void initWindow(){
setModal(true);
setHeadingText("Info Rule");
getHeader().setIcon(
TabularDataResources.INSTANCE.information());
setPredefinedButtons(PredefinedButton.OK);
setHideOnButtonClick(true);
setButtonAlign(BoxLayoutPack.CENTER);
setWidth(500);
}
protected void create(){
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.setValue(ruleDescriptionData.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.setValue(ruleDescriptionData.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.setValue(ruleDescriptionData.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.setValue(ruleDescriptionData.getOwnerLogin());
ruleOwner.setReadOnly(true);
FieldLabel ruleOwnerLabel = new FieldLabel(ruleOwner, "Owner");
configurationFieldSetLayout.add(ruleOwnerLabel, new VerticalLayoutData(
1, -1, new Margins(0)));
TextArea ruleExpression = new TextArea();
ruleExpression.setValue(ruleDescriptionData.getReadableExpression());
ruleExpression.setReadOnly(true);
ruleExpression.setHeight("82px");
FieldLabel ruleExpressionLabel = new FieldLabel(ruleExpression,
"Expression");
configurationFieldSetLayout.add(ruleExpressionLabel,
new VerticalLayoutData(1, -1, new Margins(0)));
add(configurationFieldSet, new MarginData(0));
}
}

View File

@ -42,22 +42,16 @@ 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.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;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
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.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
@ -411,73 +405,10 @@ public class RuleOpenPanel extends FramedPanel {
}
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setModal(true);
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.getOwnerLogin());
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);
final RuleInfoDialog infoRuleDialog = new RuleInfoDialog(rule);
infoRuleDialog.show();
}
protected void createContextMenu() {

View File

@ -41,22 +41,16 @@ 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.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;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
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.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
@ -395,71 +389,7 @@ public class RuleSharePanel extends FramedPanel {
}
protected void requestInfo(RuleDescriptionData rule) {
final Dialog infoRuleDialog = new Dialog();
infoRuleDialog.setModal(true);
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.getOwnerLogin());
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);
final RuleInfoDialog infoRuleDialog = new RuleInfoDialog(rule);
infoRuleDialog.show();
}