Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Commit

Permalink
Move up/down actions don't work in the region editor #139
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Orlova committed May 17, 2021
1 parent 2ad5fe5 commit 5ae9c77
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
Expand Up @@ -114,8 +114,6 @@ public void onBeforeShow(BeforeShowEvent event) {
}

protected void initComponents() {
initControlBtnsActions();

if (asFetchPlanEditor) {
initAsFetchPlanEditor();
}
Expand Down Expand Up @@ -235,20 +233,14 @@ protected void showOrHideSortBtns() {
}
}

@Install(to = "propertiesTable.upItemAction", subject = "enabledRule")
protected boolean propertiesTableUpItemActionEnabledRule() {
return isUpdatePermitted();
}

protected void initControlBtnsActions() {
// upItem.setAction(new OrderableItemAction<Table<RegionProperty>, RegionProperty>("upItem", OrderableItemAction.Direction.UP, propertiesTable) {
// @Override
// public boolean isEnabled() {
// return super.isEnabled() && isUpdatePermitted();
// }
// });
// downItem.setAction(new OrderableItemAction<Table<RegionProperty>, RegionProperty>("downItem", OrderableItemAction.Direction.DOWN, propertiesTable) {
// @Override
// public boolean isEnabled() {
// return super.isEnabled() && isUpdatePermitted();
// }
// });
@Install(to = "propertiesTable.downItemAction", subject = "enabledRule")
protected boolean propertiesTableDownItemActionEnabledRule() {
return isUpdatePermitted();
}

protected void normalizeRegionPropertiesOrderNum() {
Expand Down
Expand Up @@ -27,11 +27,6 @@

<dialogMode width="950"/>

<actions>
<action id="upItemAction"/>
<action id="downItemAction"/>
</actions>

<layout spacing="true">
<label id="tipLabel"
stylename="report-wizard-tip-label"
Expand All @@ -44,8 +39,8 @@
<vbox id="btnsControlPanel" margin="true" spacing="true" width="AUTO">
<button id="addItem" icon="ARROW_RIGHT" width="50px"/>
<button id="removeItem" action="propertiesTable.removeItemAction" icon="REMOVE" width="50px"/>
<button id="upItem" enable="false" icon="CARET_UP" width="50px"/>
<button id="downItem" icon="CARET_DOWN" width="50px"/>
<button id="upItem" enable="false" action="propertiesTable.upItemAction" icon="CARET_UP" width="50px"/>
<button id="downItem" action="propertiesTable.downItemAction" icon="CARET_DOWN" width="50px"/>
</vbox>
<groupBox id="selectedTreeItemsPanel" width="500px" height="500px">
<table id="propertiesTable"
Expand All @@ -57,6 +52,16 @@
width="100%" height="100%">
<actions>
<action id="removeItemAction" type="itemTracking"/>
<action id="upItemAction" type="itemOrderable">
<properties>
<property name="direction" value="UP"/>
</properties>
</action>
<action id="downItemAction" type="itemOrderable">
<properties>
<property name="direction" value="DOWN"/>
</properties>
</action>
</actions>
<columns>
<column id="hierarchicalLocalizedName" caption="msg://properties"/>
Expand Down

0 comments on commit 5ae9c77

Please sign in to comment.