Author: dgeraskov
Date: 2008-02-29 09:23:33 -0500 (Fri, 29 Feb 2008)
New Revision: 6649
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall.gif
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall_disable.gif
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabViewActionGroup.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1442
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall_disable.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/icons/images/removeall_disable.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java 2008-02-29
14:23:33 UTC (rev 6649)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.actions;
+
+import java.util.Iterator;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.hibernate.console.ImageConstants;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.QueryPage;
+import org.hibernate.eclipse.console.utils.EclipseImages;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class CloseAllQueryPageAction extends Action {
+
+ public CloseAllQueryPageAction() {
+ setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE_ALL) );
+ setDisabledImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE_ALL_DISABLED)
);
+
+ setToolTipText("Close all query pages");
+ }
+
+ @Override
+ public void run() {
+ for (Iterator i = KnownConfigurations.getInstance().getQueryPageModel().getPages();
i.hasNext(); ) {
+ KnownConfigurations.getInstance().getQueryPageModel().remove( (QueryPage) i.next() );
+ }
+ }
+
+}
Property changes on:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseAllQueryPageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabViewActionGroup.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabViewActionGroup.java 2008-02-29
14:23:20 UTC (rev 6648)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabViewActionGroup.java 2008-02-29
14:23:33 UTC (rev 6649)
@@ -26,6 +26,7 @@
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionGroup;
+import org.hibernate.eclipse.console.actions.CloseAllQueryPageAction;
import org.hibernate.eclipse.console.actions.CloseQueryPageAction;
/**
@@ -36,13 +37,17 @@
Action closeAction;
+ Action closeAllAction;
+
public QueryPageTabViewActionGroup(IViewPart part, ISelectionProvider provider) {
- closeAction = new CloseQueryPageAction(provider);
+ closeAction = new CloseQueryPageAction(provider);
+ closeAllAction = new CloseAllQueryPageAction();
}
- public void fillActionBars(IActionBars actionBars) {
+ public void fillActionBars(IActionBars actionBars) {
actionBars.getToolBarManager().add(closeAction);
+ actionBars.getToolBarManager().add(closeAllAction);
}
}