JBoss Tools SVN: r3649 - trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-17 08:43:03 -0400 (Mon, 17 Sep 2007)
New Revision: 3649
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/LargeImageDescriptor.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java
Log:
JBIDE-571
Added: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/LargeImageDescriptor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/LargeImageDescriptor.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/LargeImageDescriptor.java 2007-09-17 12:43:03 UTC (rev 3649)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jboss.tools.vpe.ui.palette.model;
+
+import java.util.Hashtable;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.icons.impl.LargeReferencedIcons;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class LargeImageDescriptor extends ImageDescriptor {
+ private static Hashtable<String,Image> imageCache = new Hashtable<String,Image>();
+ LargeReferencedIcons xicon = new LargeReferencedIcons();
+ XModelObject object;
+
+ public LargeImageDescriptor(XModelObject object) {
+ this.object = object;
+ }
+
+ public ImageData getImageData() {
+ return createImage().getImageData();
+ }
+
+ public Image createImage(boolean returnMissingImageOnError, Device device) {
+ int code = xicon.getHash(object);
+ if (code == 0) return null;
+ String key = "" + code;
+ Image img = (Image)imageCache.get(key);
+ if (img != null) return img;
+ img = xicon.getImage(object);
+ if (img != null) imageCache.put(key, img);
+ return img;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java 2007-09-17 12:42:24 UTC (rev 3648)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/model/PaletteItem.java 2007-09-17 12:43:03 UTC (rev 3649)
@@ -37,7 +37,7 @@
setLabel("" + xobject.getModelEntity().getRenderer().getTitle(xobject)); //$NON-NLS-1$
XModelObjectImageDescriptor icon = new XModelObjectImageDescriptor(xobject);
setSmallIcon(icon);
- setLargeIcon(icon);
+ setLargeIcon(new LargeImageDescriptor(xobject));
String description = xobject.getAttributeValue("description"); //$NON-NLS-1$
///XModelObjectLoaderUtil.loadFromXMLAttribute(xobject.getAttributeValue("description"));
this.description = (description != null && description.trim().length() > 0) ? description : null;
17 years, 3 months
JBoss Tools SVN: r3648 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-17 08:42:24 -0400 (Mon, 17 Sep 2007)
New Revision: 3648
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java
Log:
JBIDE-571
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/LargeReferencedIcons.java 2007-09-17 12:42:24 UTC (rev 3648)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.jboss.tools.common.model.icons.impl;
+
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.meta.impl.XEntityRendererImpl;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class LargeReferencedIcons implements ImageComponent {
+ ReferencedIcons ri = new ReferencedIcons();
+ private XStudioIcons studioicons = new XStudioIcons();
+
+ public LargeReferencedIcons() {}
+
+ public int getHash(XModelObject obj) {
+ String x = obj.getAttributeValue("large icon");
+ if (x == null || x.trim().length() == 0) {
+ return ri.getHash(obj);
+ }
+ XModelObject r = obj.getModel().getByPath(x);
+ return (r == null) ? "defaultimage".hashCode() : 718 + x.hashCode() + studioicons.getHash(r);
+ }
+
+ public Image getImage(XModelObject obj) {
+ String v = obj.getAttributeValue("large icon");
+ if(v == null || v.trim().length() == 0) {
+ return ri.getImage(obj);
+ }
+ XModelObject ic = (v == null || v.trim().length() == 0) ? null : obj.getModel().getByPath(v);
+ Image res = (ic == null || ic == obj) ? null : new XModelObjectIcon(ic).getEclipseImage();
+ if(res != null) return res;
+ return obj.getModelEntity().getMetaModel().getIconList().getImage("default.unknown");
+ }
+
+}
17 years, 3 months
JBoss Tools SVN: r3646 - in trunk/seam/tests/org.jboss.tools.seam.core.test: seam and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-17 04:27:59 -0400 (Mon, 17 Sep 2007)
New Revision: 3646
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/seam/
trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.0/
trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.0/seam
trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.1/
trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.1/seam
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java
Log:
add test for seam runtime manager
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.0/seam
===================================================================
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/seam/seam-1.2.1/seam
===================================================================
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2007-09-14 23:06:12 UTC (rev 3645)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2007-09-17 08:27:59 UTC (rev 3646)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core.test;
import org.jboss.tools.seam.core.test.project.facet.SeamRuntimeListConverterTest;
+import org.jboss.tools.seam.core.test.project.facet.SeamRuntimeManagerTest;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -27,6 +28,7 @@
suite.addTestSuite(ScannerTest.class);
suite.addTestSuite(SeamEARTest.class);
suite.addTestSuite(SeamRuntimeListConverterTest.class);
+ suite.addTestSuite(SeamRuntimeManagerTest.class);
return suite;
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java 2007-09-14 23:06:12 UTC (rev 3645)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java 2007-09-17 08:27:59 UTC (rev 3646)
@@ -19,5 +19,7 @@
*
*/
public class SeamFacetInstallDelegeteTest extends TestCase {
-
+ public void testSeamFacetInstallDelegateExists() {
+ SeamFacetInstallDelegete instance = new SeamFacetInstallDelegete();
+ }
}
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java 2007-09-17 08:27:59 UTC (rev 3646)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core.test.project.facet;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.osgi.framework.Bundle;
+
+import junit.framework.TestCase;
+
+/**
+ * @author eskimo
+ *
+ */
+public class SeamRuntimeManagerTest extends TestCase {
+
+ SeamRuntimeManager manager;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.0"));
+ File folder = new File(seamUrl.getPath());
+ manager = SeamRuntimeManager.getInstance();
+ assertNotNull("Cannot obtainSeamRuntimeManager instance", manager);
+ if(manager.findRuntimeByName("Seam 1.2.0")!=null) return;
+ manager.addRuntime("Seam 1.2.0", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getRuntimes()}.
+ * @throws IOException
+ */
+ public void testGetRuntimes() throws IOException {
+ SeamRuntime[] rtms = manager.getRuntimes();
+ assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms.length!=1);
+ assertTrue("Seam runtime 'Seam 1.2.0' is not created", rtms[0].getName().equals("Seam 1.2.0"));
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getRuntimes(org.jboss.tools.seam.core.project.facet.SeamVersion)}.
+ */
+ public void testGetRuntimesSeamVersion() {
+ SeamRuntimeManager manager = SeamRuntimeManager.getInstance();
+ SeamRuntime[] rtms = manager.getRuntimes(SeamVersion.SEAM_1_2);
+ assertTrue("Error in obtaining seam runtimes lis for Seam 1.2", rtms.length!=1);
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#addRuntime(org.jboss.tools.seam.core.project.facet.SeamRuntime)}.
+ * @throws IOException
+ */
+ public void testAddRuntimeSeamRuntime() throws IOException {
+ Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
+ URL seamUrl = FileLocator.resolve(seamCoreTest.getEntry("/seam/seam-1.2.1"));
+ File folder = new File(seamUrl.getPath());
+ manager.addRuntime("Seam 1.2.1", folder.getAbsolutePath(), SeamVersion.SEAM_1_2, true);
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#findRuntimeByName(java.lang.String)}.
+ */
+ public void testFindRuntimeByName() {
+ SeamRuntime srt = manager.findRuntimeByName("Seam 1.2.1");
+ assertNotNull("Cannot find runtime 'Seam 1.2.1'",srt);
+ srt = manager.findRuntimeByName("Seam 1.2.0");
+ assertNotNull("Cannot find runtime 'Seam 1.2.0'",srt);
+ }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#removeRuntime(org.jboss.tools.seam.core.project.facet.SeamRuntime)}.
+ */
+// public void testRemoveRuntime() {
+// fail("Not yet implemented");
+// }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getRuntimeForProject(org.eclipse.core.resources.IProject)}.
+ */
+// public void testGetRuntimeForProject() {
+//
+// }
+
+ /**
+ * Test method for {@link org.jboss.tools.seam.core.project.facet.SeamRuntimeManager#getDefaultRuntime()}.
+ */
+ public void testGetDefaultRuntime() {
+ assertNotNull("Cannot obtain default runtime 'Seam 1.2.0'",manager.getDefaultRuntime());
+ assertNotNull("Cannot obtain default runtime 'Seam 1.2.0'",manager.getDefaultRuntime().getName().equals("Seam 1.2.0"));
+ }
+}
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamRuntimeManagerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 3 months
JBoss Tools SVN: r3645 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 19:06:12 -0400 (Fri, 14 Sep 2007)
New Revision: 3645
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java
Log:
Viewer was asking delegate for a list of its children in order to answer hasChildren().
This led to loading some elements too quickly, a costly endeavor.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java 2007-09-14 23:05:26 UTC (rev 3644)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java 2007-09-14 23:06:12 UTC (rev 3645)
@@ -38,7 +38,7 @@
public class ExtensionTableViewer extends TreeViewer {
protected TableViewerPropertySheet propertySheet;
- protected Action disableCategoryAction, refreshAction, refreshFullAction;
+ protected Action disableCategoryAction, refreshAction;
protected boolean suppressingRefresh = false;
public ExtensionTableViewer(Tree tree) {
super(tree);
@@ -85,6 +85,13 @@
disableCategoryAction.setText(Messages.DisableCategoryAction);
refreshAction = new Action() {
public void run() {
+ Object o1 = ((IStructuredSelection)getSelection()).getFirstElement();
+ if( o1 != null ) {
+ // tell the delegate to refresh its model for the selected item, before we refresh the viewer
+ ServerViewProvider provider = o1 instanceof ServerViewProvider ? (ServerViewProvider)o1 : ((ContentWrapper)o1).getProvider();
+ if( provider != null )
+ provider.getDelegate().refreshModel(o1);
+ }
Object el = getSelectedElement();
if( el instanceof ServerViewProvider )
refresh(el);
@@ -93,13 +100,6 @@
}
};
refreshAction.setText("Refresh Item");
-
- refreshFullAction = new Action() {
- public void run() {
- refresh(null);
- }
- };
- refreshFullAction.setText("Refresh Full Tree");
}
public static class ContentWrapper {
@@ -223,7 +223,12 @@
}
public boolean hasChildren(Object element) {
- if( element instanceof ServerViewProvider ) return true;
+ if( element instanceof ServerViewProvider )
+ return ((ServerViewProvider)element).getDelegate().getContentProvider().hasChildren(element);
+ if( element instanceof ContentWrapper ) {
+ ContentWrapper parentWrapper = (ContentWrapper)element;
+ return parentWrapper.getProvider().getDelegate().getContentProvider().hasChildren(parentWrapper.getElement());
+ }
return getChildren(element).length > 0 ? true : false;
}
@@ -289,12 +294,10 @@
protected void fillJBContextMenu(Shell shell, IMenuManager menu) {
Object selected = getSelectedElement();
menu.add(refreshAction);
- menu.add(refreshFullAction);
if( selected instanceof ServerViewProvider ) {
menu.add(disableCategoryAction);
}
- //menu.add(new TempAction());
menu.add(new Separator());
}
@@ -305,7 +308,7 @@
public class TableViewerPropertySheet implements IPropertySheetPage {
private PageBook book;
- private ArrayList addedControls = new ArrayList();
+ private ArrayList<ServerViewProvider> addedControls = new ArrayList<ServerViewProvider>();
private SimplePropertiesPropertySheetPage topLevelPropertiesPage;
public void createControl(Composite parent) {
17 years, 3 months
JBoss Tools SVN: r3644 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 19:05:26 -0400 (Fri, 14 Sep 2007)
New Revision: 3644
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
Log:
API added to tell contributer to forcefully refresh its model.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2007-09-14 22:14:46 UTC (rev 3643)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2007-09-14 23:05:26 UTC (rev 3644)
@@ -50,7 +50,6 @@
public void fillContextMenu(Shell shell, IMenuManager menu, Object selection) {
}
-
public ITreeContentProvider getContentProvider() {
return null;
@@ -71,6 +70,10 @@
return null;
}
+ public void refreshModel(Object object) {
+ // override me
+ }
+
protected void suppressingRefresh(Runnable runnable) {
JBossServerView.getDefault().getExtensionFrame().getViewer().suppressingRefresh(runnable);
}
17 years, 3 months
JBoss Tools SVN: r3643 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server: providers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 18:14:46 -0400 (Fri, 14 Sep 2007)
New Revision: 3643
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
Log:
Moved bringing properties to front into a utility class for other view-related utils.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-09-14 22:13:38 UTC (rev 3642)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-09-14 22:14:46 UTC (rev 3643)
@@ -62,6 +62,7 @@
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
import org.jboss.ide.eclipse.as.ui.views.server.providers.descriptors.DescriptorXPathPropertySheetPage;
+import org.jboss.ide.eclipse.as.ui.views.server.util.ViewUtilityMethods;
public class DescriptorXPathViewProvider extends JBossServerViewExtension {
@@ -88,40 +89,11 @@
JBossServerView.addExtensionFrameListener(
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- activatePropertiesView();
+ ViewUtilityMethods.activatePropertiesView(propertyPage);
}
});
}
- protected void activatePropertiesView() {
- Object o = JBossServerView.getDefault().getExtensionFrame().getViewer().getSelectedElement();
- if( o instanceof XPathCategory ) {
- // show properties view
- String propsId = "org.eclipse.ui.views.PropertySheet";
- try {
- IWorkbench work = PlatformUI.getWorkbench();
- IWorkbenchWindow window = work.getActiveWorkbenchWindow();
- if( !isPropertiesOnTop()) {
- window.getActivePage().showView(propsId);
- if( propertyPage != null ) {
- propertyPage.selectionChanged(JBossServerView.getDefault().getViewSite().getPart(), JBossServerView.getDefault().getExtensionFrame().getViewer().getSelection());
- }
- }
- } catch( PartInitException pie ) {
- }
- }
- }
-
- protected boolean isPropertiesOnTop() {
- String propsId = "org.eclipse.ui.views.PropertySheet";
- IWorkbench work = PlatformUI.getWorkbench();
- IWorkbenchWindow window = work.getActiveWorkbenchWindow();
- IWorkbenchPage page = window.getActivePage();
- IViewReference ref = window.getActivePage().findViewReference(propsId);
- if( ref == null ) return false;
- IWorkbenchPart part = ref.getPart(false);
- return ( part != null && page.isPartVisible(part));
- }
public void setActiveCategory(XPathCategory o) {
if( o != null && o != activeCategory) {
activeCategory = o;
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/util/ViewUtilityMethods.java 2007-09-14 22:14:46 UTC (rev 3643)
@@ -0,0 +1,46 @@
+package org.jboss.ide.eclipse.as.ui.views.server.util;
+
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView;
+
+public class ViewUtilityMethods {
+
+
+ public static void activatePropertiesView(IPropertySheetPage propertyPage) {
+ Object o = JBossServerView.getDefault().getExtensionFrame().getViewer().getSelectedElement();
+ if( o instanceof XPathCategory ) {
+ // show properties view
+ String propsId = "org.eclipse.ui.views.PropertySheet";
+ try {
+ IWorkbench work = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = work.getActiveWorkbenchWindow();
+ if( !isPropertiesOnTop()) {
+ window.getActivePage().showView(propsId);
+ if( propertyPage != null ) {
+ propertyPage.selectionChanged(JBossServerView.getDefault().getViewSite().getPart(), JBossServerView.getDefault().getExtensionFrame().getViewer().getSelection());
+ }
+ }
+ } catch( PartInitException pie ) {
+ }
+ }
+ }
+
+ protected static boolean isPropertiesOnTop() {
+ String propsId = "org.eclipse.ui.views.PropertySheet";
+ IWorkbench work = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = work.getActiveWorkbenchWindow();
+ IWorkbenchPage page = window.getActivePage();
+ IViewReference ref = window.getActivePage().findViewReference(propsId);
+ if( ref == null ) return false;
+ IWorkbenchPart part = ref.getPart(false);
+ return ( part != null && page.isPartVisible(part));
+ }
+}
17 years, 3 months
JBoss Tools SVN: r3642 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 18:13:38 -0400 (Fri, 14 Sep 2007)
New Revision: 3642
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java
Log:
ensuring refresh / properties works properly when a category is selected
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java 2007-09-14 22:12:50 UTC (rev 3641)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java 2007-09-14 22:13:38 UTC (rev 3642)
@@ -335,18 +335,17 @@
IPropertySheetPage page = null;
if( selected instanceof ContentWrapper ) {
- page = getDelegatePage((ContentWrapper)selected);
- }
-
- if( page == null ) {
+ page = getDelegatePage(((ContentWrapper)selected).getProvider());
+ } else if( selected instanceof ServerViewProvider ) {
+ page = getDelegatePage((ServerViewProvider)selected);
+ } else if( page == null ) {
page = topLevelPropertiesPage;
}
page.selectionChanged(part, sel);
book.showPage(page.getControl());
}
}
- private IPropertySheetPage getDelegatePage(ContentWrapper wrapper) {
- ServerViewProvider provider = wrapper.getProvider();
+ private IPropertySheetPage getDelegatePage(ServerViewProvider provider) {
IPropertySheetPage returnSheet = null;
returnSheet = provider.getDelegate().getPropertySheetPage();
if( !addedControls.contains(provider) && returnSheet != null) {
17 years, 3 months
JBoss Tools SVN: r3641 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 18:12:50 -0400 (Fri, 14 Sep 2007)
New Revision: 3641
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
Moved xpath initialization to a class that listens in to server lifecycle events so that the automatic creation of the EAP server does not miss out on it.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-09-14 22:12:48 UTC (rev 3640)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2007-09-14 22:12:50 UTC (rev 3641)
@@ -311,8 +311,6 @@
((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_USERNAME, authUser);
((ServerWorkingCopy)serverWC).setAttribute(JBossServer.SERVER_PASSWORD, authPass);
}
- IPath configFolder = new Path(runtimeLoc).append("server").append(configName);
- XPathModel.getDefault().loadDefaults((IServer)serverWC, configFolder.toOSString());
}
public boolean isComplete() {
17 years, 3 months
JBoss Tools SVN: r3640 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: extensions/descriptors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 18:12:48 -0400 (Fri, 14 Sep 2007)
New Revision: 3640
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
Log:
Moved xpath initialization to a class that listens in to server lifecycle events so that the automatic creation of the EAP server does not miss out on it.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-14 20:14:34 UTC (rev 3639)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCorePlugin.java 2007-09-14 22:12:48 UTC (rev 3640)
@@ -29,6 +29,7 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
import org.osgi.framework.BundleContext;
@@ -70,6 +71,7 @@
public void start(BundleContext context) throws Exception {
super.start(context);
ArchivesBuildListener.getInstance();
+ XPathModel.getDefault();
}
/**
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-09-14 20:14:34 UTC (rev 3639)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2007-09-14 22:12:48 UTC (rev 3640)
@@ -13,9 +13,12 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class XPathModel {
public static final String EMPTY_STRING = "org.jboss.ide.eclipse.as.core.model.descriptor.EmptyString";
@@ -28,7 +31,7 @@
private static final String QUERY =
"org.jboss.ide.eclipse.as.core.model.descriptor.Query";
- public static XPathModel instance;
+ private static XPathModel instance;
public static XPathModel getDefault() {
if( instance == null )
instance = new XPathModel();
@@ -38,6 +41,20 @@
protected HashMap<String, ArrayList<XPathCategory>> serverToCategories;
public XPathModel() {
serverToCategories = new HashMap<String, ArrayList<XPathCategory>>();
+ ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ AbstractJBossServerRuntime ajbsr = (AbstractJBossServerRuntime)
+ server.getRuntime().loadAdapter(AbstractJBossServerRuntime.class, null);
+ IPath loc = server.getRuntime().getLocation();
+ IPath configFolder = loc.append("server").append(ajbsr.getJBossConfiguration());
+ loadDefaults(server, configFolder.toOSString());
+ save(server);
+ }
+ public void serverChanged(IServer server) {
+ }
+ public void serverRemoved(IServer server) {
+ }
+ });
}
public XPathQuery getQuery(IServer server, IPath path) {
17 years, 3 months
JBoss Tools SVN: r3639 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/ide/eclipse/as/ui/upgrades and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-14 16:14:34 -0400 (Fri, 14 Sep 2007)
New Revision: 3639
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/upgrades/UpdatePage20.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/upgrades/UpdatePage20.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/upgrades/UpdatePage20.java 2007-09-14 20:11:55 UTC (rev 3638)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/upgrades/UpdatePage20.java 2007-09-14 20:14:34 UTC (rev 3639)
@@ -24,29 +24,30 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.widgets.Composite;
-import org.jboss.ide.eclipse.firstrun.wizard.pages.AbstractFirstRunPage;
-public class UpdatePage20 extends AbstractFirstRunPage {
+/*
+ * This class is non-functional right now. I'm leaving it in case I get
+ * time to fix it, but with all the changes to the server, this isn't
+ * working.
+ */
+public class UpdatePage20 { //extends AbstractFirstRunPage {
protected UpdatePage20(String pageName, String title,
ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
+// super(pageName, title, titleImage);
// TODO Auto-generated constructor stub
}
- @Override
public void createControl(Composite parent) {
// TODO Auto-generated method stub
}
- @Override
public void initialize() {
// TODO Auto-generated method stub
}
- @Override
public void performFinishWithProgress(IProgressMonitor monitor) {
// TODO Auto-generated method stub
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2007-09-14 20:11:55 UTC (rev 3638)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2007-09-14 20:14:34 UTC (rev 3639)
@@ -248,6 +248,8 @@
icon="icons/jboss.gif"
id="org.jboss.ide.eclipse.as.ui.launchConfigurationImage1"/>
</extension>
+
+<!--
<extension
point="org.jboss.ide.eclipse.firstrun.FirstRunWizardPage">
<UpgradeWizard
@@ -257,6 +259,8 @@
toVersion="2.0.0.*"
weight="50"/>
</extension>
+ -->
+
<extension
point="org.jboss.ide.eclipse.archives.ui.nodePopupMenus">
<nodeContribution
17 years, 3 months