From 812c85ec65ff0f5d2ebcfbdbadacaea2b84005d6 Mon Sep 17 00:00:00 2001 From: Shireesh Anjal Date: Wed, 17 Aug 2011 12:28:14 +0530 Subject: Fixed Bug 3427 - All the extra added terminals are gone once we change the view --- .../plugin.xml | 11 +-------- .../management/console/ConsoleConstants.java | 26 ++++++++++++++++++++++ .../management/console/utils/GUIHelper.java | 5 ++--- .../console/views/GlusterViewsManager.java | 9 ++++---- .../management/console/views/TerminalView.java | 26 ---------------------- 5 files changed, 33 insertions(+), 44 deletions(-) create mode 100644 src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/ConsoleConstants.java delete mode 100644 src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java (limited to 'src/com.gluster.storage.management.console') diff --git a/src/com.gluster.storage.management.console/plugin.xml b/src/com.gluster.storage.management.console/plugin.xml index 675b7e52..9cadd537 100644 --- a/src/com.gluster.storage.management.console/plugin.xml +++ b/src/com.gluster.storage.management.console/plugin.xml @@ -175,15 +175,6 @@ name="Tasks" restorable="true"> - - @@ -1419,7 +1410,7 @@ + * This file is part of Gluster Management Console. + * + * Gluster Management Console is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * Gluster Management Console is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see + * . + *******************************************************************************/ +package com.gluster.storage.management.console; + +/** + * + */ +public class ConsoleConstants { + public static final String TERMINAL_VIEW_ID = "org.eclipse.tm.terminal.view.TerminalView"; +} diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java index 841d5a9d..f46f9ddf 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/utils/GUIHelper.java @@ -80,11 +80,11 @@ import org.eclipse.ui.forms.widgets.Section; import org.eclipse.ui.progress.IProgressConstants; import com.gluster.storage.management.console.Application; +import com.gluster.storage.management.console.ConsoleConstants; import com.gluster.storage.management.console.GlusterDataModelManager; import com.gluster.storage.management.console.IImageKeys; import com.gluster.storage.management.console.views.NavigationView; import com.gluster.storage.management.console.views.TasksView; -import com.gluster.storage.management.console.views.TerminalView; import com.gluster.storage.management.core.exceptions.GlusterRuntimeException; import com.gluster.storage.management.core.model.Disk; import com.gluster.storage.management.core.utils.JavaUtil; @@ -460,8 +460,7 @@ public class GUIHelper { } public void showTerminalView() { - //showView("org.eclipse.tm.terminal.view.TerminalView"); - showView(TerminalView.ID); + showView(ConsoleConstants.TERMINAL_VIEW_ID); } public void showProgressView() { diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java index 928bc7fc..05c30626 100644 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java +++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/GlusterViewsManager.java @@ -24,6 +24,7 @@ import org.eclipse.ui.IViewReference; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; +import com.gluster.storage.management.console.ConsoleConstants; import com.gluster.storage.management.core.model.Cluster; import com.gluster.storage.management.core.model.Entity; import com.gluster.storage.management.core.model.EntityGroup; @@ -44,6 +45,7 @@ public class GlusterViewsManager implements ViewsManager { /* (non-Javadoc) * @see com.gluster.storage.management.console.views.ViewsManager#updateViews(com.gluster.storage.management.core.model.Entity) */ + @SuppressWarnings("rawtypes") @Override public void updateViews(Entity entity) { closeAllViews(); @@ -65,13 +67,11 @@ public class GlusterViewsManager implements ViewsManager { } } - /** - * - */ private void closeAllViews() { IViewReference[] viewReferences = page.getViewReferences(); for (final IViewReference viewReference : viewReferences) { - if (!(viewReference.getId().equals(NavigationView.ID) || viewReference.getId().equals(TerminalView.ID))) { + if (!(viewReference.getId().equals(NavigationView.ID) || viewReference.getId().equals( + ConsoleConstants.TERMINAL_VIEW_ID))) { page.hideView(viewReference); } } @@ -80,7 +80,6 @@ public class GlusterViewsManager implements ViewsManager { private void showViewsForCluster(Cluster cluster) throws PartInitException { page.showView(ClusterSummaryView.ID); page.showView(TasksView.ID, null, IWorkbenchPage.VIEW_CREATE); - //page.showView("org.eclipse.tm.terminal.view.TerminalView", null, IWorkbenchPage.VIEW_CREATE); } private void showViewsForVolume(Volume volume) throws PartInitException { diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java deleted file mode 100644 index d99ac513..00000000 --- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/views/TerminalView.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Gluster, Inc. - * This file is part of Gluster Management Console. - * - * Gluster Management Console is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * Gluster Management Console is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License - * for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see - * . - *******************************************************************************/ -package com.gluster.storage.management.console.views; - -/** - * - */ -public class TerminalView extends org.eclipse.tm.internal.terminal.view.TerminalView { - public static final String ID = TerminalView.class.getName(); -} -- cgit