Alexander Wels has uploaded a new change for review. Change subject: webadmin: Conform QuotaListModel to standard ......................................................................
webadmin: Conform QuotaListModel to standard - Fixed QuotaListModel to have the same command method names as all the other models. Some functionality is dependent on the fact that all Models follow the same convention. Change-Id: Ieb9a4ede386d494399855181f0a4ef58542253c7 Signed-off-by: Alexander Wels <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/DataCenterModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/QuotaModule.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabQuotaView.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterQuotaView.java 5 files changed, 48 insertions(+), 47 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/13275/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java index c5e76bd..073944b 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java @@ -47,33 +47,34 @@ private static final String COPY_OF = "Copy_of_"; //$NON-NLS-1$ - private UICommand createQuotaCommand; - private UICommand removeQuotaCommand; - private UICommand editQuotaCommand; - private UICommand cloneQuotaCommand; + private UICommand createCommand; + private UICommand removeCommand; + private UICommand editCommand; + private UICommand cloneCommand; - public UICommand getCreateQuotaCommand() { - return createQuotaCommand; + public UICommand getCreateCommand() { + return createCommand; } - public void setCreateQuotaCommand(UICommand createQuotaCommand) { - this.createQuotaCommand = createQuotaCommand; + public void setCreateCommand(UICommand createQuotaCommand) { + this.createCommand = createQuotaCommand; } - public UICommand getRemoveQuotaCommand() { - return removeQuotaCommand; + public UICommand getRemoveCommand() { + return removeCommand; } - public void setRemoveQuotaCommand(UICommand removeQuotaCommand) { - this.removeQuotaCommand = removeQuotaCommand; + public void setRemoveCommand(UICommand removeQuotaCommand) { + this.removeCommand = removeQuotaCommand; } - public UICommand getEditQuotaCommand() { - return editQuotaCommand; + @Override + public UICommand getEditCommand() { + return editCommand; } - public void setEditQuotaCommand(UICommand editQuotaCommand) { - this.editQuotaCommand = editQuotaCommand; + public void setEditCommand(UICommand editQuotaCommand) { + this.editCommand = editQuotaCommand; } public QuotaListModel() { @@ -84,10 +85,10 @@ setSearchObjects(new String[] { SearchObjects.QUOTA_OBJ_NAME, SearchObjects.QUOTA_PLU_OBJ_NAME }); setAvailableInModes(ApplicationMode.VirtOnly); - setCreateQuotaCommand(new UICommand("Create", this)); //$NON-NLS-1$ - setEditQuotaCommand(new UICommand("Edit", this)); //$NON-NLS-1$ - setRemoveQuotaCommand(new UICommand("Remove", this)); //$NON-NLS-1$ - setCloneQuotaCommand(new UICommand("Clone", this)); //$NON-NLS-1$ + setCreateCommand(new UICommand("Create", this)); //$NON-NLS-1$ + setEditCommand(new UICommand("Edit", this)); //$NON-NLS-1$ + setRemoveCommand(new UICommand("Remove", this)); //$NON-NLS-1$ + setCloneCommand(new UICommand("Clone", this)); //$NON-NLS-1$ updateActionAvailability(); @@ -139,9 +140,9 @@ List items = getSelectedItems() != null && getSelectedItem() != null ? getSelectedItems() : new ArrayList(); - getEditQuotaCommand().setIsExecutionAllowed(items.size() == 1); - getRemoveQuotaCommand().setIsExecutionAllowed(items.size() > 0); - getCloneQuotaCommand().setIsExecutionAllowed(items.size() == 1); + getEditCommand().setIsExecutionAllowed(items.size() == 1); + getRemoveCommand().setIsExecutionAllowed(items.size() > 0); + getCloneCommand().setIsExecutionAllowed(items.size() == 1); } protected void createQuota(){ @@ -590,10 +591,10 @@ @Override public void ExecuteCommand(UICommand command) { super.ExecuteCommand(command); - if (command.equals(getCreateQuotaCommand())) { + if (command.equals(getCreateCommand())) { createQuota(); } - else if (command.equals(getEditQuotaCommand())) { + else if (command.equals(getEditCommand())) { editQuota(false); } else if (command.getName().equals("OnCreateQuota")) { //$NON-NLS-1$ @@ -602,13 +603,13 @@ else if (command.getName().equals("Cancel")) { //$NON-NLS-1$ cancel(); } - else if (command.equals(getRemoveQuotaCommand())) { + else if (command.equals(getRemoveCommand())) { remove(); } else if (command.getName().equals("OnRemove")) { //$NON-NLS-1$ onRemove(); } - else if (command.equals(getCloneQuotaCommand())) { + else if (command.equals(getCloneCommand())) { editQuota(true); } else if (command.getName().equals("onCloneQuota")) { //$NON-NLS-1$ onCreateQuota(true); @@ -646,12 +647,12 @@ return searchString.trim().toLowerCase().startsWith("quota"); //$NON-NLS-1$ } - public UICommand getCloneQuotaCommand() { - return cloneQuotaCommand; + public UICommand getCloneCommand() { + return cloneCommand; } - public void setCloneQuotaCommand(UICommand cloneQuotaCommand) { - this.cloneQuotaCommand = cloneQuotaCommand; + public void setCloneCommand(UICommand cloneQuotaCommand) { + this.cloneCommand = cloneQuotaCommand; } } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/DataCenterModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/DataCenterModule.java index 98c08fc..63222f2 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/DataCenterModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/DataCenterModule.java @@ -189,9 +189,9 @@ public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(DataCenterQuotaListModel source, UICommand lastExecutedCommand, Model windowModel) { - if (lastExecutedCommand.equals(getModel().getCreateQuotaCommand()) - || lastExecutedCommand.equals(getModel().getEditQuotaCommand()) - || lastExecutedCommand.equals(getModel().getCloneQuotaCommand())) { + if (lastExecutedCommand.equals(getModel().getCreateCommand()) + || lastExecutedCommand.equals(getModel().getEditCommand()) + || lastExecutedCommand.equals(getModel().getCloneCommand())) { return quotaPopupProvider.get(); } else { return super.getModelPopup(source, lastExecutedCommand, windowModel); @@ -201,7 +201,7 @@ @Override public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(DataCenterQuotaListModel source, UICommand lastExecutedCommand) { - if (lastExecutedCommand.equals(getModel().getRemoveQuotaCommand())) { + if (lastExecutedCommand.equals(getModel().getRemoveCommand())) { return removeConfirmPopupProvider.get(); } else { return super.getConfirmModelPopup(source, lastExecutedCommand); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/QuotaModule.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/QuotaModule.java index 265e2a7..b92dc21 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/QuotaModule.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/gin/uicommon/QuotaModule.java @@ -46,9 +46,9 @@ @Override public AbstractModelBoundPopupPresenterWidget<? extends Model, ?> getModelPopup(QuotaListModel source, UICommand lastExecutedCommand, Model windowModel) { - if (lastExecutedCommand.equals(getModel().getCreateQuotaCommand()) - || lastExecutedCommand.equals(getModel().getEditQuotaCommand()) - || lastExecutedCommand.equals(getModel().getCloneQuotaCommand())) { + if (lastExecutedCommand.equals(getModel().getCreateCommand()) + || lastExecutedCommand.equals(getModel().getEditCommand()) + || lastExecutedCommand.equals(getModel().getCloneCommand())) { return quotaPopupProvider.get(); } else { return super.getModelPopup(source, lastExecutedCommand, windowModel); @@ -58,7 +58,7 @@ @Override public AbstractModelBoundPopupPresenterWidget<? extends ConfirmationModel, ?> getConfirmModelPopup(QuotaListModel source, UICommand lastExecutedCommand) { - if (lastExecutedCommand.equals(getModel().getRemoveQuotaCommand())) { + if (lastExecutedCommand.equals(getModel().getRemoveCommand())) { return removeConfirmPopupProvider.get(); } else { return super.getConfirmModelPopup(source, lastExecutedCommand); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabQuotaView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabQuotaView.java index a96e3ff..de174ad 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabQuotaView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabQuotaView.java @@ -248,25 +248,25 @@ getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.addQuota()) { @Override protected UICommand resolveCommand() { - return getMainModel().getCreateQuotaCommand(); + return getMainModel().getCreateCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.editQuota()) { @Override protected UICommand resolveCommand() { - return getMainModel().getEditQuotaCommand(); + return getMainModel().getEditCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.copyQuota()) { @Override protected UICommand resolveCommand() { - return getMainModel().getCloneQuotaCommand(); + return getMainModel().getCloneCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.removeQuota()) { @Override protected UICommand resolveCommand() { - return getMainModel().getRemoveQuotaCommand(); + return getMainModel().getRemoveCommand(); } }); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterQuotaView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterQuotaView.java index f8f6464..26803ab 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterQuotaView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/datacenter/SubTabDataCenterQuotaView.java @@ -52,25 +52,25 @@ getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.addQuota()) { @Override protected UICommand resolveCommand() { - return getDetailModel().getCreateQuotaCommand(); + return getDetailModel().getCreateCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.editQuota()) { @Override protected UICommand resolveCommand() { - return getDetailModel().getEditQuotaCommand(); + return getDetailModel().getEditCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.copyQuota()) { @Override protected UICommand resolveCommand() { - return getDetailModel().getCloneQuotaCommand(); + return getDetailModel().getCloneCommand(); } }); getTable().addActionButton(new WebAdminButtonDefinition<Quota>(constants.removeQuota()) { @Override protected UICommand resolveCommand() { - return getDetailModel().getRemoveQuotaCommand(); + return getDetailModel().getRemoveCommand(); } }); } -- To view, visit http://gerrit.ovirt.org/13275 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb9a4ede386d494399855181f0a4ef58542253c7 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alexander Wels <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
