[jbosstools-commits] JBoss Tools SVN: r23586 - in workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/tools/as and 3 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Jul 20 06:03:36 EDT 2010
Author: rob.stryker at jboss.com
Date: 2010-07-20 06:03:35 -0400 (Tue, 20 Jul 2010)
New Revision: 23586
Added:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/EditorExtensionManager.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/schema/DeployMethodUI.exsd
Log:
RSE branch why weren't these files added??
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/EditorExtensionManager.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/EditorExtensionManager.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/EditorExtensionManager.java 2010-07-20 10:03:35 UTC (rev 23586)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.ide.eclipse.as.ui.editor;
+
+import java.util.Collection;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class EditorExtensionManager {
+
+ private static EditorExtensionManager instance;
+ public static EditorExtensionManager getDefault() {
+ if( instance == null )
+ instance = new EditorExtensionManager();
+ return instance;
+ }
+
+ private HashMap<String, IDeploymentTypeUI> publishMethodUIMap = null;
+ public IDeploymentTypeUI getPublishPreferenceUI(String deployType) {
+ if( publishMethodUIMap == null )
+ loadPublishPreferenceEditors();
+ return publishMethodUIMap.get(deployType);
+ }
+
+ public IDeploymentTypeUI[] getPublishPreferenceUIs() {
+ if( publishMethodUIMap == null )
+ loadPublishPreferenceEditors();
+ Collection<IDeploymentTypeUI> col = publishMethodUIMap.values();
+ return (IDeploymentTypeUI[]) col.toArray(new IDeploymentTypeUI[col.size()]);
+ }
+ private void loadPublishPreferenceEditors() {
+ publishMethodUIMap = new HashMap<String, IDeploymentTypeUI>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(
+ JBossServerUIPlugin.PLUGIN_ID, "DeployMethodUI"); //$NON-NLS-1$
+ for( int i = 0; i < cf.length; i++ ) {
+ try {
+ IDeploymentTypeUI ui = (IDeploymentTypeUI) cf[i].createExecutableExtension("class"); //$NON-NLS-1$
+ if( ui != null && cf[i].getAttribute("deployMethodId") != null) { //$NON-NLS-1$
+ publishMethodUIMap.put(cf[i].getAttribute("deployMethodId"), ui); //$NON-NLS-1$
+ }
+ } catch(CoreException ce ) {
+ // TODO log
+ }
+ }
+ }
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/IDeploymentTypeUI.java 2010-07-20 10:03:35 UTC (rev 23586)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.ide.eclipse.as.ui.editor;
+
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader.DeploymentPreferences;
+
+public interface IDeploymentTypeUI {
+ /**
+ * The parent in this call has no layout and is basically a positioned,
+ * but unconfigured, composite.
+ *
+ * Fill her up!
+ *
+ * Don't forget this UI element is a singleton, similar to a factory,
+ * so you should probably make your first widget in the parent a
+ * new class which extends Composite and can maintain state.
+ *
+ * @param parent
+ * @param page
+ */
+ public void fillComposite(Composite parent, ModuleDeploymentPage page);
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-07-20 10:03:35 UTC (rev 23586)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.as.rse.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI;
+import org.jboss.ide.eclipse.as.ui.editor.ModuleDeploymentPage;
+
+public class RSEDeploymentPreferenceUI implements IDeploymentTypeUI {
+
+ public RSEDeploymentPreferenceUI() {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void fillComposite(Composite parent,
+ ModuleDeploymentPage page) {
+ parent.setLayout(new FillLayout());
+ new RSEDeploymentPreferenceComposite(parent, SWT.NONE, page);
+ }
+
+ public static class RSEDeploymentPreferenceComposite extends Composite {
+ private ModuleDeploymentPage page;
+ public RSEDeploymentPreferenceComposite(Composite parent, int style, ModuleDeploymentPage page) {
+ super(parent, style);
+ this.page = page;
+ setLayout(new FormLayout());
+ Label l = new Label(this, SWT.NONE);
+ l.setLayoutData(UIUtil.createFormData2(0, 5, 0,70,0,5,100,-5));
+ l.setText("This belongs to rse");
+ }
+ }
+
+
+}
Added: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/schema/DeployMethodUI.exsd
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/schema/DeployMethodUI.exsd (rev 0)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/schema/DeployMethodUI.exsd 2010-07-20 10:03:35 UTC (rev 23586)
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.ide.eclipse.as.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.ide.eclipse.as.ui" id="DeployMethodUI" name="org.jboss.ide.as.ui.deployMethodUI"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="ui"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="ui">
+ <complexType>
+ <attribute name="deployMethodId" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
More information about the jbosstools-commits
mailing list