JBoss Tools SVN: r9470 - in trunk/portlet/plugins/org.jboss.tools.portlet.ui: META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-08-01 09:41:55 -0400 (Fri, 01 Aug 2008)
New Revision: 9470
Added:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/
trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/
trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/edit.jsp
trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/help.jsp
trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/view.jsp
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/MultiSelectFilteredFileSelectionDialog.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/project/facet/JSFPortletFacetInstallPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/META-INF/MANIFEST.MF
trunk/portlet/plugins/org.jboss.tools.portlet.ui/build.properties
trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/PortletUIActivator.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletWizard.java
Log:
JBIDE-2574 Support for JSF portlets
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/META-INF/MANIFEST.MF 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/META-INF/MANIFEST.MF 2008-08-01 13:41:55 UTC (rev 9470)
@@ -24,5 +24,7 @@
org.jboss.tools.portlet.core,
org.eclipse.emf.codegen,
org.eclipse.wst.xml.core,
- org.eclipse.wst.sse.core
+ org.eclipse.wst.sse.core,
+ org.eclipse.jdt.ui,
+ org.eclipse.ui.ide
Bundle-ActivationPolicy: lazy
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/build.properties
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/build.properties 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/build.properties 2008-08-01 13:41:55 UTC (rev 9470)
@@ -3,4 +3,11 @@
bin.includes = META-INF/,\
.,\
plugin.xml,\
- icons/
+ icons/,\
+ resources/,\
+ rhds_wiz.png,\
+ templates/,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml 2008-08-01 13:41:55 UTC (rev 9470)
@@ -11,6 +11,13 @@
</extension>
-->
+ <extension
+ point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+ <wizard-pages action="jboss.jsfportlet.install">
+ <page class="org.jboss.tools.portlet.ui.internal.project.facet.JSFPortletFacetInstallPage"/>
+ </wizard-pages>
+ </extension>
+
<!-- New Java Portlet wizard -->
<extension point="org.eclipse.ui.newWizards">
<category id="org.jboss.tools.portlet"
@@ -26,6 +33,15 @@
<description>Create a new Java Portlet</description>
<selection class="org.eclipse.core.resources.IResource" />
</wizard>
+ <wizard
+ id="org.jboss.tools.portlet.ui.wizard.NewJSFPortletWizard"
+ name="JBoss JSF Portlet"
+ class="org.jboss.tools.portlet.ui.internal.wizard.NewJSFPortletWizard"
+ category="org.jboss.tools.jst.web/org.jboss.tools.portlet"
+ icon="icons/portlet_wiz.gif">
+ <description>Create a new JBoss JSF Portlet</description>
+ <selection class="org.eclipse.core.resources.IResource" />
+ </wizard>
</extension>
</plugin>
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/edit.jsp
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/edit.jsp (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/edit.jsp 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,8 @@
+ <ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ Edit Mode
+</ui:composition>
\ No newline at end of file
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/help.jsp
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/help.jsp (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/help.jsp 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,8 @@
+ <ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ Help Mode
+</ui:composition>
\ No newline at end of file
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/view.jsp
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/view.jsp (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/resources/jsf/view.jsp 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,8 @@
+ <ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ View Mode
+</ui:composition>
\ No newline at end of file
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -1,33 +1,60 @@
package org.jboss.tools.portlet.operations;
+import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.INIT_PARAM;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.VIEW_MODE;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_JBOSS_APP;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_JBOSS_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.COPY_JSF_TEMPLATES;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.EDIT_MODE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.HELP_MODE;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IF_EXISTS;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INSTANCE_NAME;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.WINDOW_NAME;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IF_EXISTS;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.JBOSS_APP;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_REGION;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PARENT_PORTAL;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PORTLET_HEIGHT;
-import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.VIEW_MODE;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.WINDOW_NAME;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
+import java.io.File;
+import java.io.FileFilter;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jst.j2ee.internal.common.operations.NewJavaEEArtifactClassOperation;
import org.eclipse.jst.j2ee.internal.web.operations.AddWebClassOperation;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditProviderOperation;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
@@ -35,8 +62,10 @@
import org.jboss.tools.portlet.core.PortletCoreActivator;
import org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties;
import org.jboss.tools.portlet.ui.PortletUIActivator;
+import org.osgi.framework.Bundle;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
/**
@@ -44,6 +73,13 @@
*/
public class AddPortletOperation extends AddWebClassOperation {
+ public static final IOverwriteQuery OVERWRITE_NO_QUERY = new IOverwriteQuery()
+ {
+ public String queryOverwrite(String pathString)
+ {
+ return IOverwriteQuery.NO_ALL;
+ }
+ };
/**
* This is the constructor which should be used when creating the operation.
* It will not accept null parameter. It will not return null.
@@ -59,7 +95,27 @@
@Override
protected NewJavaEEArtifactClassOperation getNewClassOperation() {
- return new NewPortletClassOperation(getDataModel());
+ boolean isJSFPortlet = model.getBooleanProperty(IS_JSF_PORTLET);
+ if (!isJSFPortlet) {
+ return new NewPortletClassOperation(getDataModel());
+ }
+ NewJavaEEArtifactClassOperation op = new NewJavaEEArtifactClassOperation(getDataModel()) {
+
+ @Override
+ protected void generateUsingTemplates(IProgressMonitor monitor,
+ IPackageFragment fragment) throws WFTWrappedException,
+ CoreException {
+
+ }
+
+ @Override
+ public IStatus doExecute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ return Status.OK_STATUS;
+ }
+
+ };
+ return op;
}
protected void generateMetaData(IDataModel aModel, String qualifiedClassName) {
@@ -74,13 +130,147 @@
// generate/update *.object.xml
updatePortletObject(aModel);
}
+ boolean addJBossApp = model.getBooleanProperty(ADD_JBOSS_APP);
+ if (addJBossApp) {
+ updateJBossApp(aModel);
+ }
+ boolean addJBossPortlet = model.getBooleanProperty(ADD_JBOSS_PORTLET);
+ if (addJBossPortlet) {
+ updateJBossPortlet(aModel);
+ }
+
+ boolean copyJSFTemplates = model.getBooleanProperty(COPY_JSF_TEMPLATES);
+ if (copyJSFTemplates) {
+ try {
+ copyJSFTemplates(aModel);
+ } catch (Exception e) {
+ PortletUIActivator.log(e);
+ }
+ }
}
+ private void updateJBossPortlet(IDataModel model) {
+ IProject project = getTargetProject();
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFile portletVirtualFile = component.getRootFolder().getFile(
+ IPortletConstants.JBOSS_PORTLET_FILE);
+
+ if (!portletVirtualFile.getUnderlyingFile().exists()) {
+ try {
+ PortletCoreActivator.createJBossPortlet(project,portletVirtualFile.getUnderlyingFile());
+ } catch (Exception e) {
+ PortletCoreActivator.log(e);
+ return;
+ }
+ }
+
+ IFile portletFile = portletVirtualFile.getUnderlyingFile();
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager()
+ .getModelForEdit(portletFile);
+ Document document = domModel.getDocument();
+ Element element = document.getDocumentElement();
+
+ String name = model.getStringProperty(NAME);
+ Element portlet = addNode(document,element,"portlet",null);
+ addNode(document,portlet,"portlet-name",name);
+ addNode(document,portlet,"header-content",null);
+
+ domModel.save();
+ } catch (Exception e) {
+ PortletCoreActivator.getDefault().log(e);
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromEdit();
+ }
+ }
+
+ try {
+ new FormatProcessorXML().formatFile(portletFile);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private void copyJSFTemplates(IDataModel model) throws Exception {
+ IProject project = getTargetProject();
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder jsfFolder = component.getRootFolder().getFolder("jsf");
+ if (!jsfFolder.exists()) {
+ jsfFolder.create(IResource.FORCE, new NullProgressMonitor());
+ }
+ IContainer folder = jsfFolder.getUnderlyingFolder();
+
+ Bundle bundle = Platform.getBundle(PortletUIActivator.PLUGIN_ID);
+ URL jsfURL = bundle.getEntry("/resources/jsf");
+ String jsfFolderName = FileLocator.toFileURL(jsfURL).getFile();
+ File source = new File(jsfFolderName);
+ File[] files = source.listFiles(new FileFilter() {
+
+ public boolean accept(File pathname) {
+ return pathname.isFile();
+ }
+
+ });
+ List<File> filesToImport = Arrays.asList(files);
+ ImportOperation importOperation = new ImportOperation(folder
+ .getFullPath(), source, FileSystemStructureProvider.INSTANCE,
+ OVERWRITE_NO_QUERY, filesToImport);
+ importOperation.setCreateContainerStructure(false);
+ IProgressMonitor monitor = new NullProgressMonitor();
+ importOperation.run(monitor);
+ }
+
+ private void updateJBossApp(IDataModel model) {
+ IProject project = getTargetProject();
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFile portletVirtualFile = component.getRootFolder().getFile(
+ IPortletConstants.JBOSS_APP_FILE);
+
+ if (!portletVirtualFile.getUnderlyingFile().exists()) {
+ try {
+ PortletCoreActivator.createJBossApp(project,portletVirtualFile.getUnderlyingFile());
+ } catch (Exception e) {
+ PortletCoreActivator.log(e);
+ return;
+ }
+ }
+
+ IFile portletFile = portletVirtualFile.getUnderlyingFile();
+ IDOMModel domModel = null;
+ try {
+ domModel = (IDOMModel) StructuredModelManager.getModelManager()
+ .getModelForEdit(portletFile);
+ Document document = domModel.getDocument();
+ Element element = document.getDocumentElement();
+
+ NodeList appNameNodes = element.getElementsByTagName("app-name");
+ if (appNameNodes.getLength() <= 0) {
+ String appName = model.getStringProperty(JBOSS_APP);
+ addNode(document, element, "app-name", appName);
+ domModel.save();
+ }
+ } catch (Exception e) {
+ PortletCoreActivator.getDefault().log(e);
+ } finally {
+ if (domModel != null) {
+ domModel.releaseFromEdit();
+ }
+ }
+
+ try {
+ new FormatProcessorXML().formatFile(portletFile);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
private void updatePortletObject(IDataModel model) {
- String name = model.getStringProperty(NAME);
String instanceId = model.getStringProperty(INSTANCE_NAME);
String windowName = model.getStringProperty(WINDOW_NAME);
+ String pageName = model.getStringProperty(PAGE_NAME);
String ifExists = model.getStringProperty(IF_EXISTS);
String parent = model.getStringProperty(PARENT_PORTAL);;
String region = model.getStringProperty(PAGE_REGION);
@@ -114,8 +304,16 @@
addNode(document,deployment,"parent-ref",parent);
addNode(document,deployment,"if-exists",ifExists);
- Element window = addNode(document,deployment,"window",null);
+ Element page = null;
+ if (pageName != null && pageName.trim().length() > 0) {
+ page = addNode(document,deployment,"page",null);
+ addNode(document,page,"page-name",pageName);
+ } else {
+ page=deployment;
+ }
+ Element window = addNode(document,page,"window",null);
+
addNode(document,window,"window-name",windowName);
addNode(document,window,"instance-ref",instanceId);
addNode(document,window,"region",region);
@@ -194,16 +392,10 @@
String className = aModel.getStringProperty(INewPortletClassDataModelProperties.QUALIFIED_CLASS_NAME);
IProject project = getTargetProject();
- IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFile portletVirtualFile = component.getRootFolder().getFile(
- IPortletConstants.CONFIG_PATH);
-
- if (!portletVirtualFile.getUnderlyingFile().exists()) {
- PortletCoreActivator.getDefault().log(new RuntimeException("The portlet.xml file doesn't exist"));
+ IFile portletFile = PortletUIActivator.getPortletXmlFile(project);
+ if (portletFile == null) {
return;
}
-
- IFile portletFile = portletVirtualFile.getUnderlyingFile();
IDOMModel domModel = null;
try {
domModel = (IDOMModel) StructuredModelManager.getModelManager()
@@ -228,6 +420,20 @@
// portlet-class
addNode(document,portlet,"portlet-class",className);
+ // init-param
+ List initParamList = (List) aModel.getProperty(INIT_PARAM);
+ if (initParamList != null) {
+ for (Iterator iterator = initParamList.iterator(); iterator
+ .hasNext();) {
+ String[] arrayString = (String[]) iterator.next();
+ Element initParam = addNode(document,portlet,"init-param",null);
+ addNode(document,initParam,"name",arrayString[0]);
+ addNode(document,initParam,"value",arrayString[1]);
+ if (arrayString[2] != null && arrayString[2].length() > 0) {
+ addNode(document,initParam,"description",arrayString[2]);
+ }
+ }
+ }
// supports
Element supports = addNode(document,portlet,"supports",null);
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -33,6 +33,8 @@
static final String WINDOW_NAME = "NewPortletClassDataModel.WINDOW_NAME";
+ static final String PAGE_NAME = "NewPortletClassDataModel.PAGE_NAME";
+
static final String PARENT_PORTAL = "NewPortletClassDataModel.PARENT_PORTAL";
static final String PAGE_REGION = "NewPortletClassDataModel.PAGE_REGION";
@@ -43,4 +45,13 @@
static final String ADD_PORTLET = "NewPortletClassDataModel.ADD_PORTLET";
+ static final String ADD_JBOSS_APP = "NewPortletClassDataModel.ADD_JBOSS_APP";
+
+ static final String ADD_JBOSS_PORTLET = "NewPortletClassDataModel.ADD_JBOSS_PORTLET";
+
+ static final String JBOSS_APP = "NewPortletClassDataModel.JBOSS_APP";
+
+ static final String IS_JSF_PORTLET = "NewPortletClassDataModel.IS_JSF_PORTLET";
+
+ static final String COPY_JSF_TEMPLATES = "NewPortletClassDataModel.COPY_JSF_TEMPLATES";
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -9,6 +9,7 @@
static final String ADD_PORTLET_WIZARD_PAGE_DESC = "Enter portlet deployment descriptor specific information.";
static final String ADD_JBOSS_PORTLET_WIZARD_PAGE_TITLE = "Create Portlet";
+ static final String ADD_JBOSS_JSF_PORTLET_WIZARD_PAGE_TITLE = "Create JBoss JSF Portlet";
static final String ADD_JBOSS_PORTLET_WIZARD_PAGE_DESC = "Enter JBoss portlet specific information";
static final String DISPLAY_NAME_LABEL = "Display name:";
@@ -54,9 +55,20 @@
static final String ADD_PORTLET_LABEL = "Create Portlet Instance";
static final String INSTANCE_NAME_LABEL = "Instance Name:";
static final String WINDOW_NAME_LABEL = "Window Name:";
+ static final String PAGE_NAME_LABEL = "Page Name:";
static final String PARENT_PORTAL_LABEL = "Parent Reference:";
static final String PAGE_REGION_LABEL = "Region:";
static final String PORTLET_HEIGHT_LABEL = "Height:";
static final String IF_EXISTS_LABEL = "If Exists:";
+ static final String NEW_JBOSS_JSF_PORTLET_WIZARD_PAGE_DESC = "Specify class file information";
+ static final String JBOSS_JSF_PORTLET_CLASS = "javax.portlet.faces.GenericFacesPortlet";
+ static final String JBOSS_JSF_PORTLET_NAME = "riPortlet";
+ static final String JBOSS_JSF_DISPLAY_PORTLET_NAME = "JBoss JSF Portlet";
+ static final String JBOSS_JSF_PORTLET_TITLE = "JBoss JSF Portlet";
+ static final String JBOSS_APP_LABEL = "JBoss Application Name:";
+ static final String ADD_JBOSS_APP_LABEL = "Create JBoss Application";
+ static final String ADD_JBOSS_PORTLET_LABEL = "Add the jboss-portlet.xml file";
+ static final String COPY_JSF_TEMPLATES_LABEL = "Copy JSF Templates";
+
}
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/MultiSelectFilteredFileSelectionDialog.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/MultiSelectFilteredFileSelectionDialog.java (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/MultiSelectFilteredFileSelectionDialog.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,609 @@
+package org.jboss.tools.portlet.ui;
+
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DEFAULT_PACKAGE;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.ui.ISharedImages;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jst.j2ee.internal.dialogs.FilteredFileSelectionDialog;
+import org.eclipse.jst.j2ee.internal.dialogs.TwoArrayQuickSorter;
+import org.eclipse.jst.j2ee.internal.dialogs.TypedFileViewerFilter;
+import org.eclipse.jst.j2ee.internal.web.providers.WebAppEditResourceHandler;
+import org.eclipse.jst.servlet.ui.internal.wizard.SimpleTypedElementSelectionValidator;
+import org.eclipse.jst.servlet.ui.internal.wizard.StringMatcher;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.part.PageBook;
+import org.jboss.tools.portlet.core.PortletCoreActivator;
+
+/**
+ * Insert the type's description here.
+ * Creation date: (7/30/2001 11:16:36 AM)
+ */
+public class MultiSelectFilteredFileSelectionDialog extends
+ FilteredFileSelectionDialog implements SelectionListener {
+
+
+ private static class PackageRenderer extends LabelProvider {
+ private final Image PACKAGE_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_PACKAGE);
+
+ public String getText(Object element) {
+ IType type = (IType) element;
+ String p = type.getPackageFragment().getElementName();
+ if ("".equals(p)) //$NON-NLS-1$
+ p = DEFAULT_PACKAGE;
+ return (p + " - " + type.getPackageFragment().getParent().getPath().toString()); //$NON-NLS-1$
+ }
+ public Image getImage(Object element) {
+ return PACKAGE_ICON;
+ }
+ }
+
+ private static class TypeRenderer extends LabelProvider {
+ private final Image CLASS_ICON = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CLASS);
+
+ public String getText(Object element) {
+ IType e = ((IType) element);
+ return e.getElementName();
+ }
+
+ public Image getImage(Object element) {
+ return CLASS_ICON;
+ }
+
+ }
+
+ protected PageBook fPageBook = null;
+ protected Control fPortletControl = null;
+ protected Composite fChild = null;
+ // construction parameters
+ protected IRunnableContext fRunnableContext;
+ protected ILabelProvider fElementRenderer;
+ protected ILabelProvider fQualifierRenderer;
+ private Object[] fElements;
+ private boolean fIgnoreCase = true;
+ private String fUpperListLabel;
+ private String fLowerListLabel;
+ // SWT widgets
+ private Table fUpperList;
+ private Table fLowerList;
+ protected Text fText;
+ private IType[] fIT;
+ private String[] fRenderedStrings;
+ private int[] fElementMap;
+ private Integer[] fQualifierMap;
+
+ private ISelectionStatusValidator fLocalValidator = null;
+ /**
+ * MultiSelectFilteredFileSelectionDialog constructor comment.
+ * @param parent Shell
+ * @param title String
+ * @param message String
+ * @parent extensions String[]
+ * @param allowMultiple boolean
+ */
+ public MultiSelectFilteredFileSelectionDialog(Shell parent, String title, String message, String[] extensions, boolean allowMultiple, IProject project) {
+ super(parent, title, message, extensions, allowMultiple);
+ setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
+
+ if (title == null)
+ setTitle(WebAppEditResourceHandler.getString("File_Selection_UI_")); //$NON-NLS-1$
+ if (message == null)
+ message = WebAppEditResourceHandler.getString("Select_a_file__UI_"); //$NON-NLS-1$
+ setMessage(message);
+ setExtensions(extensions);
+ addFilter(new TypedFileViewerFilter(extensions));
+ fLocalValidator = new SimpleTypedElementSelectionValidator(new Class[] { IFile.class }, allowMultiple);
+ setValidator(fLocalValidator);
+
+ //StatusInfo currStatus = new StatusInfo();
+ //currStatus.setOK();
+ Status currStatus = new Status(Status.OK, PortletCoreActivator.PLUGIN_ID, Status.OK, "", null);
+
+ updateStatus(currStatus);
+ fElementRenderer = new TypeRenderer();
+ fQualifierRenderer = new PackageRenderer();
+ fRunnableContext = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ try {
+ IJavaElement jelem = null;
+ IProject proj = null;
+ jelem = (IJavaElement) project.getAdapter(IJavaElement.class);
+ if (jelem == null) {
+ IResource resource = (IResource) project.getAdapter(IResource.class);
+ if (resource != null) {
+ proj = resource.getProject();
+ if (proj != null) {
+ jelem = org.eclipse.jdt.core.JavaCore.create(proj);
+ }
+ }
+ }
+ IJavaProject jp = jelem.getJavaProject();
+
+ IType portletType = jp.findType(IPortletUIConstants.QUALIFIED_PORTLET);
+ // next 3 lines fix defect 177686
+ if (portletType == null) {
+ return;
+ }
+
+ ArrayList portletClasses = new ArrayList();
+ ITypeHierarchy tH = portletType.newTypeHierarchy(jp, null);
+ IType[] types = tH.getAllSubtypes(portletType);
+ for (int i = 0; i < types.length; i++) {
+ if (types[i].isClass() && !portletClasses.contains(types[i]))
+ portletClasses.add(types[i]);
+ }
+ fIT = (IType[]) portletClasses.toArray(new IType[portletClasses.size()]);
+ portletClasses = null;
+
+ } catch (Exception e) {
+ PortletCoreActivator.log(e);
+ }
+ }
+
+ /**
+ * @private
+ */
+ protected void computeResult() {
+ IType type = (IType) getWidgetSelection();
+ if (type != null) {
+ if (type == null) {
+ String title = WebAppEditResourceHandler
+ .getString("Select_Class_UI_"); //$NON-NLS-1$ = "Select Class"
+ String message = WebAppEditResourceHandler
+ .getString("Could_not_uniquely_map_the_ERROR_"); //$NON-NLS-1$ = "Could not uniquely map the class name to a class."
+ MessageDialog.openError(getShell(), title, message);
+ setResult(null);
+ } else {
+ java.util.List result = new ArrayList(1);
+ result.add(type);
+ setResult(result);
+ }
+ }
+ }
+
+ public void create() {
+ super.create();
+ fText.setFocus();
+ rematch(""); //$NON-NLS-1$
+ updateOkState();
+ }
+
+ /**
+ * Creates and returns the contents of this dialog's
+ * button bar.
+ * <p>
+ * The <code>Dialog</code> implementation of this framework method
+ * lays out a button bar and calls the <code>createButtonsForButtonBar</code>
+ * framework method to populate it. Subclasses may override.
+ * </p>
+ *
+ * @param parent the parent composite to contain the button bar
+ * @return the button bar control
+ */
+ protected Control createButtonBar(Composite parent) {
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+
+ layout.numColumns = 2;
+
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite composite2 = new Composite(composite, SWT.NONE);
+
+ // create a layout with spacing and margins appropriate for the font size.
+ layout = new GridLayout();
+ layout.numColumns = 0; // this is incremented by createButton
+ layout.makeColumnsEqualWidth = true;
+ layout.marginWidth = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_MARGIN);
+ layout.marginHeight = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_MARGIN);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.HORIZONTAL_SPACING);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(org.eclipse.jface.dialogs.IDialogConstants.VERTICAL_SPACING);
+
+ composite2.setLayout(layout);
+
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER);
+ composite2.setLayoutData(data);
+
+ composite2.setFont(parent.getFont());
+
+ // Add the buttons to the button bar.
+ super.createButtonsForButtonBar(composite2);
+
+ return composite;
+ }
+
+ /*
+ * @private
+ */
+ protected Control createDialogArea(Composite parent) {
+ GridData gd = new GridData();
+
+ fChild = new Composite(parent, SWT.NONE);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fChild, "com.ibm.etools.webapplicationedit.webx2010"); //$NON-NLS-1$
+ GridLayout gl = new GridLayout();
+ gl.numColumns = 2;
+ gl.marginHeight = 0;
+ fChild.setLayout(gl);
+
+ gd.verticalAlignment = GridData.FILL;
+ gd.grabExcessVerticalSpace = true;
+ fChild.setLayoutData(gd);
+
+ fPageBook = new PageBook(fChild, SWT.NONE);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ gd.horizontalSpan = 2;
+ fPageBook.setLayoutData(gd);
+ fPortletControl = super.createDialogArea(fPageBook);
+
+ Composite composite = new Composite(fPageBook, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ composite.setFont(parent.getFont());
+
+ Label messageLabel = new Label(composite, SWT.NONE);
+ gd = new GridData();
+ messageLabel.setLayoutData(gd);
+ messageLabel.setText("Choose a portlet"); //$NON-NLS-1$
+
+ fText = createText(composite);
+
+ messageLabel = new Label(composite, SWT.NONE);
+ gd = new GridData();
+ messageLabel.setLayoutData(gd);
+ messageLabel.setText("Matching portlets"); //$NON-NLS-1$
+
+ fUpperList = createUpperList(composite);
+
+ messageLabel = new Label(composite, SWT.NONE);
+ gd = new GridData();
+ messageLabel.setLayoutData(gd);
+ messageLabel.setText(WebAppEditResourceHandler.getString("Qualifier__3")); //$NON-NLS-1$
+
+ fLowerList = createLowerList(composite);
+
+ fPortletControl = composite;
+ fPageBook.showPage(fPortletControl);
+ return parent;
+ }
+
+ /**
+ * Creates the list widget and sets layout data.
+ * @return org.eclipse.swt.widgets.List
+ */
+ private Table createLowerList(Composite parent) {
+ if (fLowerListLabel != null)
+ (new Label(parent, SWT.NONE)).setText(fLowerListLabel);
+
+ Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ list.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ handleLowerSelectionChanged();
+ }
+ });
+ list.addListener(SWT.MouseDoubleClick, new Listener() {
+ public void handleEvent(Event evt) {
+ handleLowerDoubleClick();
+ }
+ });
+ list.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ fQualifierRenderer.dispose();
+ }
+ });
+ GridData spec = new GridData();
+ spec.widthHint = convertWidthInCharsToPixels(50);
+ spec.heightHint = convertHeightInCharsToPixels(5);
+ spec.grabExcessVerticalSpace = true;
+ spec.grabExcessHorizontalSpace = true;
+ spec.horizontalAlignment = GridData.FILL;
+ spec.verticalAlignment = GridData.FILL;
+ list.setLayoutData(spec);
+ return list;
+ }
+
+ /**
+ * Creates the text widget and sets layout data.
+ * @return org.eclipse.swt.widgets.Text
+ */
+ private Text createText(Composite parent) {
+ Text text = new Text(parent, SWT.BORDER);
+ GridData spec = new GridData();
+ spec.grabExcessVerticalSpace = false;
+ spec.grabExcessHorizontalSpace = true;
+ spec.horizontalAlignment = GridData.FILL;
+ spec.verticalAlignment = GridData.BEGINNING;
+ text.setLayoutData(spec);
+ Listener l = new Listener() {
+ public void handleEvent(Event evt) {
+ rematch(fText.getText());
+ }
+ };
+ text.addListener(SWT.Modify, l);
+ return text;
+ }
+
+ /**
+ * Creates the list widget and sets layout data.
+ * @return org.eclipse.swt.widgets.List
+ */
+ private Table createUpperList(Composite parent) {
+ if (fUpperListLabel != null)
+ (new Label(parent, SWT.NONE)).setText(fUpperListLabel);
+
+ Table list = new Table(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
+ list.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event evt) {
+ handleUpperSelectionChanged();
+ }
+ });
+ list.addListener(SWT.MouseDoubleClick, new Listener() {
+ public void handleEvent(Event evt) {
+ handleUpperDoubleClick();
+ }
+ });
+ list.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ fElementRenderer.dispose();
+ }
+ });
+ GridData spec = new GridData();
+ spec.widthHint = convertWidthInCharsToPixels(50);
+ spec.heightHint = convertHeightInCharsToPixels(15);
+ spec.grabExcessVerticalSpace = true;
+ spec.grabExcessHorizontalSpace = true;
+ spec.horizontalAlignment = GridData.FILL;
+ spec.verticalAlignment = GridData.FILL;
+ list.setLayoutData(spec);
+ return list;
+ }
+
+ /**
+ * @return the ID of the button that is 'pressed' on doubleClick in the lists.
+ * By default it is the OK button.
+ * Override to change this setting.
+ */
+ protected int getDefaultButtonID() {
+ return IDialogConstants.OK_ID;
+ }
+
+ protected Object getWidgetSelection() {
+ int i = fLowerList.getSelectionIndex();
+ if (fQualifierMap != null) {
+ if (fQualifierMap.length == 1)
+ i = 0;
+ if (i < 0) {
+ return null;
+ }
+ Integer index = fQualifierMap[i];
+ return fElements[index.intValue()];
+ }
+ return null;
+ }
+
+ protected final void handleLowerDoubleClick() {
+ if (getWidgetSelection() != null)
+ buttonPressed(getDefaultButtonID());
+ }
+
+ protected final void handleLowerSelectionChanged() {
+ updateOkState();
+ }
+
+ protected final void handleUpperDoubleClick() {
+ if (getWidgetSelection() != null)
+ buttonPressed(getDefaultButtonID());
+ }
+
+ protected final void handleUpperSelectionChanged() {
+ int selection = fUpperList.getSelectionIndex();
+ if (selection >= 0) {
+ int i = fElementMap[selection];
+ int k = i;
+ int length = fRenderedStrings.length;
+ while (k < length && fRenderedStrings[k].equals(fRenderedStrings[i])) {
+ k++;
+ }
+ updateLowerListWidget(i, k);
+ } else
+ updateLowerListWidget(0, 0);
+ }
+
+ public int open() {
+
+ if (fIT == null || fIT.length == 0) {
+ MessageDialog.openInformation(getShell(), WebAppEditResourceHandler.getString("Empty_List_1"), "No portlets exist to add");
+ return CANCEL;
+ }
+
+ setElements(fIT);
+ setInitialSelection(""); //$NON-NLS-1$
+ return super.open();
+ }
+
+ /**
+ * update the list to reflect a new match string.
+ * @param matchString java.lang.String
+ */
+ protected final void rematch(String matchString) {
+ int k = 0;
+ String text = fText.getText();
+ StringMatcher matcher = new StringMatcher(text + "*", fIgnoreCase, false); //$NON-NLS-1$
+ String lastString = null;
+ int length = fElements.length;
+ for (int i = 0; i < length; i++) {
+ while (i < length && fRenderedStrings[i].equals(lastString))
+ i++;
+ if (i < length) {
+ lastString = fRenderedStrings[i];
+ if (matcher.match(fRenderedStrings[i])) {
+ fElementMap[k] = i;
+ k++;
+ }
+ }
+ }
+ fElementMap[k] = -1;
+
+ updateUpperListWidget(fElementMap, k);
+ }
+
+ /**
+ *
+ * @return java.lang.String[]
+ * @param p org.eclipse.jface.elements.IIndexedProperty
+ */
+ private String[] renderStrings(Object[] p) {
+ String[] strings = new String[p.length];
+ int size = strings.length;
+ for (int i = 0; i < size; i++) {
+ strings[i] = fElementRenderer.getText(p[i]);
+ }
+ new TwoArrayQuickSorter(fIgnoreCase).sort(strings, p);
+ return strings;
+ }
+
+ public void setElements(Object[] elements) {
+ fElements = elements;
+ fElementMap = new int[fElements.length + 1];
+ fRenderedStrings = renderStrings(fElements);
+ }
+
+ private void updateLowerListWidget(int from, int to) {
+ fLowerList.removeAll();
+ fQualifierMap = new Integer[to - from];
+ String[] qualifiers = new String[to - from];
+ for (int i = from; i < to; i++) {
+ // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
+ qualifiers[i - from] = fQualifierRenderer.getText(fElements[i]);
+ fQualifierMap[i - from] = new Integer(i);
+ }
+
+ new TwoArrayQuickSorter(fIgnoreCase).sort(qualifiers, fQualifierMap);
+
+ for (int i = 0; i < to - from; i++) {
+ TableItem ti = new TableItem(fLowerList, i);
+ ti.setText(qualifiers[i]);
+ // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
+ Image img = fQualifierRenderer.getImage(fElements[from + i]);
+ if (img != null)
+ ti.setImage(img);
+ }
+
+ if (fLowerList.getItemCount() > 0)
+ fLowerList.setSelection(0);
+ updateOkState();
+ }
+
+ private void updateOkState() {
+ Button okButton = getOkButton();
+ if (okButton != null)
+ okButton.setEnabled(getWidgetSelection() != null);
+ }
+
+ private void updateUpperListWidget(int[] indices, int size) {
+ fUpperList.setRedraw(false);
+ int itemCount = fUpperList.getItemCount();
+ if (size < itemCount)
+ fUpperList.remove(0, itemCount - size - 1);
+ TableItem[] items = fUpperList.getItems();
+ for (int i = 0; i < size; i++) {
+ TableItem ti = null;
+ if (i < itemCount)
+ ti = items[i];
+ else
+ ti = new TableItem(fUpperList, i);
+ ti.setText(fRenderedStrings[indices[i]]);
+ // XXX: 1G65LDG: JFUIF:WIN2000 - ILabelProvider used outside a viewer
+ Image img = fElementRenderer.getImage(fElements[indices[i]]);
+ if (img != null)
+ ti.setImage(img);
+ }
+ if (fUpperList.getItemCount() > 0)
+ fUpperList.setSelection(0);
+ fUpperList.setRedraw(true);
+ handleUpperSelectionChanged();
+ }
+
+ /**
+ * Sent when default selection occurs in the control.
+ * <p>
+ * For example, on some platforms default selection occurs
+ * in a List when the user double-clicks an item or types
+ * return in a Text.
+ * </p>
+ *
+ * @param e an event containing information about the default selection
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // Do nothing
+ }
+
+ /**
+ * Sent when selection occurs in the control.
+ * <p>
+ * For example, on some platforms selection occurs in
+ * a List when the user selects an item or items.
+ * </p>
+ *
+ * @param e an event containing information about the selection
+ */
+ public void widgetSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * @see ElementTreeSelectionDialog#updateOKStatus()
+ */
+ protected void updateOKStatus() {
+ super.updateOKStatus();
+ Button okButton = getOkButton();
+ if (okButton != null)
+ okButton.setEnabled(fLocalValidator.validate(getResult()).isOK());
+ }
+
+}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/PortletUIActivator.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/PortletUIActivator.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/PortletUIActivator.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -1,6 +1,15 @@
package org.jboss.tools.portlet.ui;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.jboss.tools.portlet.core.IPortletConstants;
+import org.jboss.tools.portlet.core.PortletCoreActivator;
import org.osgi.framework.BundleContext;
/**
@@ -46,5 +55,28 @@
public static PortletUIActivator getDefault() {
return plugin;
}
+
+ public static IFile getPortletXmlFile(IProject project) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFile portletVirtualFile = component.getRootFolder().getFile(
+ IPortletConstants.CONFIG_PATH);
+ if (!portletVirtualFile.getUnderlyingFile().exists()) {
+ log(new RuntimeException("The portlet.xml file doesn't exist"));
+ return null;
+ }
+
+ IFile portletFile = portletVirtualFile.getUnderlyingFile();
+ return portletFile;
+ }
+
+ public static void log(Exception e, String message) {
+ IStatus status = new Status(IStatus.ERROR,PLUGIN_ID,message,e);
+ PortletCoreActivator.getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR,PLUGIN_ID,e.getLocalizedMessage(),e);
+ PortletCoreActivator.getDefault().getLog().log(status);
+ }
}
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/project/facet/JSFPortletFacetInstallPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/project/facet/JSFPortletFacetInstallPage.java (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/project/facet/JSFPortletFacetInstallPage.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,71 @@
+package org.jboss.tools.portlet.ui.internal.project.facet;
+
+
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
+import org.jboss.tools.portlet.core.IPortletConstants;
+import org.jboss.tools.portlet.ui.PortletUIActivator;
+
+/**
+ * @author snjeza
+ */
+public class JSFPortletFacetInstallPage extends AbstractFacetWizardPage {
+
+ private IDialogSettings dialogSettings;
+ private IDataModel model;
+ private IDialogSettings jsfSection;
+
+ public JSFPortletFacetInstallPage() {
+ super("JSFPortletProjectConfigurationWizardPage");
+ setTitle("JBoss JSF Portlet Capabilities");
+ setDescription("Add JBoss JSF Portlet capabilities to this Web Project");
+ //ImageDescriptor imageDesc = getDefaultPageImageDescriptor( );
+ //if ( imageDesc != null )
+ // setImageDescriptor( imageDesc );
+ dialogSettings = PortletUIActivator.getDefault().getDialogSettings();
+ }
+
+ public void createControl(Composite parent) {
+ initializeDialogUnits(parent);
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1,false));
+
+ final Button btn = new Button(composite,SWT.CHECK);
+ btn.setText("Deploy jars to WEB-INF/lib");
+ jsfSection = dialogSettings.getSection(IPortletConstants.JSF_SECTION);
+ boolean deployJars;
+ if (jsfSection == null) {
+ jsfSection = dialogSettings.addNewSection(IPortletConstants.JSF_SECTION);
+ deployJars = true;
+ } else {
+ deployJars = jsfSection.getBoolean(IPortletConstants.DEPLOY_JARS);
+ }
+ btn.setSelection(deployJars);
+ jsfSection.put(IPortletConstants.DEPLOY_JARS, btn.getSelection());
+ btn.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ model.setBooleanProperty(IPortletConstants.DEPLOY_JARS, btn.getSelection());
+ jsfSection.put(IPortletConstants.DEPLOY_JARS, btn.getSelection());
+ }
+
+ });
+ setControl( composite );
+ }
+
+ public void setConfig(Object config) {
+ this.model = (IDataModel) config;
+ }
+
+
+
+}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -18,22 +18,33 @@
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_LABEL;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_TITLE;
import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INSTANCE_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.WINDOW_NAME;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IF_EXISTS;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_JBOSS_APP;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.ADD_JBOSS_PORTLET;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_REGION;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PARENT_PORTAL;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PORTLET_HEIGHT;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.JBOSS_APP;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.COPY_JSF_TEMPLATES;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.INSTANCE_NAME_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.WINDOW_NAME_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.PAGE_NAME_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.IF_EXISTS_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PAGE_REGION_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PARENT_PORTAL_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PORTLET_HEIGHT_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.JBOSS_APP_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.ADD_JBOSS_APP_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.ADD_JBOSS_PORTLET_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.COPY_JSF_TEMPLATES_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.ADD_PORTLET_LABEL;
import org.eclipse.core.runtime.IStatus;
@@ -140,6 +151,14 @@
synchHelper.synchText(instanceNameText, INSTANCE_NAME, null);
// window name
+ Label pageNameLabel = new Label(composite, SWT.LEFT);
+ pageNameLabel.setText(PAGE_NAME_LABEL);
+ pageNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ final Text pageNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ pageNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ synchHelper.synchText(pageNameText, PAGE_NAME, null);
+
+ // window name
Label windowNameLabel = new Label(composite, SWT.LEFT);
windowNameLabel.setText(WINDOW_NAME_LABEL);
windowNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
@@ -171,17 +190,9 @@
heightText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(heightText, PORTLET_HEIGHT, null);
- addPortlet.addSelectionListener(new SelectionListener() {
+ addPortlet.addSelectionListener(new SelectionAdapter() {
- public void widgetDefaultSelected(SelectionEvent e) {
- //enableComponents();
- }
-
public void widgetSelected(SelectionEvent e) {
- enableComponents();
- }
-
- private void enableComponents() {
boolean enable = addPortlet.getSelection();
ifExistsCombo.setEnabled(enable);
instanceNameText.setEnabled(enable);
@@ -192,6 +203,45 @@
}
});
+ if (isJSFPortlet()) {
+ final Button addJBossApp = new Button(composite, SWT.CHECK);
+ addJBossApp.setText(ADD_JBOSS_APP_LABEL);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.horizontalSpan = 2;
+ addJBossApp.setLayoutData(gd);
+ synchHelper.synchCheckbox(addJBossApp, ADD_JBOSS_APP, null);
+
+ // JBoss Application Name
+ Label jbossAppLabel = new Label(composite, SWT.LEFT);
+ jbossAppLabel.setText(JBOSS_APP_LABEL);
+ jbossAppLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ final Text jbossAppText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ jbossAppText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ synchHelper.synchText(jbossAppText, JBOSS_APP, null);
+
+ addJBossApp.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ boolean enable = addJBossApp.getSelection();
+ jbossAppText.setEnabled(enable);
+
+ }
+ });
+
+ final Button addJBossPortlet = new Button(composite, SWT.CHECK);
+ addJBossPortlet.setText(ADD_JBOSS_PORTLET_LABEL);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.horizontalSpan = 2;
+ addJBossPortlet.setLayoutData(gd);
+ synchHelper.synchCheckbox(addJBossPortlet, ADD_JBOSS_PORTLET, null);
+
+ final Button copyJSFTemplates = new Button(composite, SWT.CHECK);
+ copyJSFTemplates.setText(COPY_JSF_TEMPLATES_LABEL);
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ gd.horizontalSpan = 2;
+ copyJSFTemplates.setLayoutData(gd);
+ synchHelper.synchCheckbox(copyJSFTemplates, COPY_JSF_TEMPLATES, null);
+ }
}
public boolean canFlipToNextPage() {
@@ -205,4 +255,7 @@
return true;
}
+ protected boolean isJSFPortlet() {
+ return model.getBooleanProperty(IS_JSF_PORTLET);
+ }
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -4,6 +4,9 @@
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DESCRIPTION;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.DISPLAY_NAME;
+import java.util.ArrayList;
+import java.util.List;
+
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.ADD_BUTTON_LABEL;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.DESCRIPTION_LABEL;
@@ -20,6 +23,7 @@
import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
@@ -34,6 +38,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
@@ -89,6 +95,30 @@
INIT_PARAM);
initSection.setCallback(callback);
+ if (isJSFPortlet()) {
+ List<String[]> initParamList = new ArrayList<String[]>();
+ String[] arrayString = new String[3];
+ arrayString[0]="javax.portlet.faces.defaultViewId.view";
+ arrayString[1]="/jsf/view.jsp";
+ arrayString[2]="";
+ initParamList.add(arrayString);
+
+ arrayString = new String[3];
+ arrayString[0]="javax.portlet.faces.defaultViewId.edit";
+ arrayString[1]="/jsf/edit.jsp";
+ arrayString[2]="";
+ initParamList.add(arrayString);
+
+ arrayString = new String[3];
+ arrayString[0]="javax.portlet.faces.defaultViewId.help";
+ arrayString[1]="/jsf/help.jsp";
+ arrayString[2]="";
+ initParamList.add(arrayString);
+
+ initSection.setInput(initParamList);
+
+ }
+
String text = nameText.getText();
nameText.setFocus();
@@ -141,6 +171,9 @@
nameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(nameText, NAME, null);
+ if (isJSFPortlet()) {
+ nameText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_NAME);
+ }
// display name
Label displayNameLabel = new Label(composite, SWT.LEFT);
@@ -149,7 +182,9 @@
Text displayNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
displayNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(displayNameText, DISPLAY_NAME, null);
-
+ if (isJSFPortlet()) {
+ displayNameText.setText(IPortletUIConstants.JBOSS_JSF_DISPLAY_PORTLET_NAME);
+ }
// title
Label titleLabel = new Label(composite, SWT.LEFT);
titleLabel.setText(IPortletUIConstants.TITLE_LABEL);
@@ -157,7 +192,9 @@
Text titleText = new Text(composite, SWT.SINGLE | SWT.BORDER);
titleText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(titleText, TITLE, null);
-
+ if (isJSFPortlet()) {
+ titleText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_TITLE);
+ }
// description
Label descLabel = new Label(composite, SWT.LEFT);
descLabel.setText(DESCRIPTION_LABEL);
@@ -182,4 +219,7 @@
return true;
}
+ protected boolean isJSFPortlet() {
+ return model.getBooleanProperty(IS_JSF_PORTLET);
+ }
}
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,264 @@
+package org.jboss.tools.portlet.ui.internal.wizard;
+
+import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.CLASS_NAME;
+import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
+import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.BROWSE_BUTTON_LABEL;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CLASS_NAME_LABEL;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
+import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.jboss.tools.portlet.core.IPortletConstants;
+import org.jboss.tools.portlet.ui.IPortletUIConstants;
+import org.jboss.tools.portlet.ui.MultiSelectFilteredFileSelectionDialog;
+
+/**
+ * JBoss Portlet Wizard Setting Page
+ *
+ * @author snjeza
+ */
+public class NewJSFPortletClassWizardPage extends NewJavaClassWizardPage {
+
+ protected Label projectNameLabel;
+ private Combo projectNameCombo;
+ private String projectName;
+ private Label existingClassLabel;
+ private Text existingClassText;
+ private Button existingClassButton;
+
+ public NewJSFPortletClassWizardPage(IDataModel model, String pageName, String pageDesc, String pageTitle,
+ String moduleType) {
+ super(model, pageName, pageDesc,pageTitle,moduleType);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames()
+ */
+ protected String[] getValidationPropertyNames() {
+ return new String[] { IArtifactEditOperationDataModelProperties.PROJECT_NAME};
+ }
+
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ composite.setLayout(layout);
+ GridData data = new GridData();
+ data.verticalAlignment = GridData.FILL;
+ data.horizontalAlignment = GridData.FILL;
+ data.widthHint = 300;
+ composite.setLayoutData(data);
+ Dialog.applyDialogFont(parent);
+
+ addProjectNameGroup(composite);
+
+ createUseExistingGroup(composite);
+
+ return composite;
+ }
+
+ private void createUseExistingGroup(Composite composite) {
+
+ existingClassLabel = new Label(composite, SWT.LEFT);
+ existingClassLabel.setText(CLASS_NAME_LABEL);
+ existingClassLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+
+ existingClassText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+ existingClassText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ synchHelper.synchText(existingClassText, CLASS_NAME, null);
+ existingClassText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_CLASS);
+
+ existingClassButton = new Button(composite, SWT.PUSH);
+ existingClassButton.setText(BROWSE_BUTTON_LABEL);
+ existingClassButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
+ existingClassButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleClassButtonSelected();
+ }
+ });
+ }
+
+ private void handleClassButtonSelected() {
+ getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
+ IProject project = (IProject) model.getProperty(PROJECT);
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ MultiSelectFilteredFileSelectionDialog ms = new MultiSelectFilteredFileSelectionDialog(
+ getShell(),
+ "New JSF Portlet",
+ "Choose a JSF portlet class:",
+ new String[0],
+ false,
+ project);
+ IContainer root = component.getRootFolder().getUnderlyingFolder();
+ ms.setInput(root);
+ ms.open();
+ if (ms.getReturnCode() == Window.OK) {
+ String qualifiedClassName = ""; //$NON-NLS-1$
+ IType type = (IType) ms.getFirstResult();
+ if (type != null) {
+ qualifiedClassName = type.getFullyQualifiedName();
+ }
+ existingClassText.setText(qualifiedClassName);
+ }
+ getControl().setCursor(null);
+ }
+
+ /**
+ * Add project group
+ */
+ private void addProjectNameGroup(Composite parent) {
+ // set up project name label
+ projectNameLabel = new Label(parent, SWT.NONE);
+ projectNameLabel.setText(J2EEUIMessages.getResourceString(J2EEUIMessages.MODULES_DEPENDENCY_PAGE_TABLE_PROJECT)); //$NON-NLS-1$
+ GridData data = new GridData();
+ projectNameLabel.setLayoutData(data);
+ // set up project name entry field
+ projectNameCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = 300;
+ data.horizontalSpan = 1;
+ projectNameCombo.setLayoutData(data);
+
+ synchHelper.synchCombo(projectNameCombo, IArtifactEditOperationDataModelProperties.PROJECT_NAME, null);
+ initializeProjectList();
+ new Label(parent, SWT.NONE);
+ }
+
+ /**
+ *
+ */
+ private void initializeProjectList() {
+ IProject[] workspaceProjects = ProjectUtilities.getAllProjects();
+ List items = new ArrayList();
+ for (int i = 0; i < workspaceProjects.length; i++) {
+ IProject project = workspaceProjects[i];
+ if (isProjectValid(project))
+ items.add(project.getName());
+ }
+ if (items.isEmpty()) return;
+ String[] names = new String[items.size()];
+ for (int i = 0; i < items.size(); i++) {
+ names[i] = (String) items.get(i);
+ }
+ projectNameCombo.setItems(names);
+ IProject selectedProject = null;
+ try {
+ if (model !=null) {
+ String projectNameFromModel = model.getStringProperty(IArtifactEditOperationDataModelProperties.COMPONENT_NAME);
+ if (projectNameFromModel!=null && projectNameFromModel.length()>0)
+ selectedProject = ProjectUtilities.getProject(projectNameFromModel);
+ }
+ } catch (Exception e) {};
+ try {
+ if (selectedProject == null)
+ selectedProject = getSelectedProject();
+ if (selectedProject != null && selectedProject.isAccessible()
+ && selectedProject.hasNature(IModuleConstants.MODULE_NATURE_ID)) {
+ projectNameCombo.setText(selectedProject.getName());
+ model.setProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME, selectedProject.getName());
+ }
+ } catch (CoreException ce) {
+ // Ignore
+ }
+ if (projectName == null && names.length > 0)
+ projectName = names[0];
+
+ if ((projectNameCombo.getText() == null || projectNameCombo.getText().length() == 0) && projectName != null) {
+ projectNameCombo.setText(projectName);
+ model.setProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME, projectName);
+ }
+
+ }
+
+ /**
+ * @return
+ */
+ private IProject getSelectedProject() {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (window == null)
+ return null;
+ ISelection selection = window.getSelectionService().getSelection();
+ if (selection == null)
+ return null;
+ if (!(selection instanceof IStructuredSelection))
+ return null;
+ IStructuredSelection stucturedSelection = (IStructuredSelection) selection;
+ if (stucturedSelection.getFirstElement() instanceof EObject)
+ return ProjectUtilities.getProject(stucturedSelection.getFirstElement());
+ IJavaElement element = getInitialJavaElement(selection);
+ if (element != null && element.getJavaProject() != null)
+ return element.getJavaProject().getProject();
+ return getExtendedSelectedProject(stucturedSelection.getFirstElement());
+ }
+
+ /**
+ * This method is used by the project list initializer. The method checks
+ * if the specified project is valid to include it in the project list.
+ *
+ * <p>Subclasses of this wizard page should override this method to
+ * adjust filtering of the projects to their needs. </p>
+ *
+ * @param project reference to the project to be checked
+ *
+ * @return <code>true</code> if the project is valid to be included in
+ * the project list, <code>false</code> - otherwise.
+ */
+ protected boolean isProjectValid(IProject project) {
+ boolean result = super.isProjectValid(project);
+ if (!result)
+ return result;
+ try {
+ result = FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
+ } catch (CoreException ce) {
+ result = false;
+ }
+ return result;
+ }
+
+ public boolean canFlipToNextPage() {
+ if (model.getBooleanProperty(USE_EXISTING_CLASS))
+ return false;
+ return super.canFlipToNextPage();
+ }
+
+ @Override
+ protected boolean showValidationErrorsOnEnter() {
+ return true;
+ }
+
+}
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -0,0 +1,85 @@
+package org.jboss.tools.portlet.ui.internal.wizard;
+
+import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jst.servlet.ui.IWebUIContextIds;
+import org.eclipse.jst.servlet.ui.internal.wizard.NewServletClassOptionsWizardPage;
+import org.eclipse.jst.servlet.ui.internal.wizard.NewWebArtifactWizard;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties;
+import org.jboss.tools.portlet.ui.IPortletUIConstants;
+import org.jboss.tools.portlet.ui.PortletUIActivator;
+
+/**
+ * New portlet wizard
+ */
+public class NewJSFPortletWizard extends NewWebArtifactWizard {
+
+ //protected static final String PAGE_FOUR = "pageFour";
+
+ public NewJSFPortletWizard() {
+ this(null);
+ }
+
+ public NewJSFPortletWizard(IDataModel model) {
+ super(model);
+ }
+
+ @Override
+ protected String getTitle() {
+ return IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE;
+ }
+
+ @Override
+ protected ImageDescriptor getImage() {
+ return PortletUIActivator.imageDescriptorFromPlugin(PortletUIActivator.PLUGIN_ID, "/icons/portlet_wiz.gif");
+ }
+
+ @Override
+ public void doAddPages() {
+ NewJSFPortletClassWizardPage page1 = new NewJSFPortletClassWizardPage(
+ getDataModel(),
+ PAGE_ONE,NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
+ IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE, IModuleConstants.JST_WEB_MODULE);
+ //page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1);
+ addPage(page1);
+ AddPortletWizardPage page2 = new AddPortletWizardPage(getDataModel(), PAGE_TWO);
+ //page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2);
+ addPage(page2);
+ /*NewPortletClassOptionsWizardPage page3 = new NewPortletClassOptionsWizardPage(
+ getDataModel(),
+ PAGE_THREE,
+ "Specify modifiers, interfaces to implement and method stubs to generate.",
+ IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE);
+ //page3.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3);
+ addPage(page3);*/
+ AddJBossPortletWizardPage page4 = new AddJBossPortletWizardPage(getDataModel(), PAGE_THREE);
+ addPage(page4);
+ }
+
+ @Override
+ protected void postPerformFinish() throws InvocationTargetException {
+ // open the portlet.xml file
+ IProject project = (IProject) getDataModel().getProperty(PROJECT);
+ IFile portletFile = PortletUIActivator.getPortletXmlFile(project);
+ if (portletFile == null) {
+ return;
+ }
+ openEditor(portletFile);
+ }
+
+ @Override
+ protected IDataModelProvider getDefaultProvider() {
+ return new NewPortletClassDataModelProvider(true);
+ }
+
+}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -1,12 +1,13 @@
package org.jboss.tools.portlet.ui.internal.wizard;
-import static org.eclipse.jst.j2ee.web.IServletConstants.QUALIFIED_SERVLET;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties;
import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModelProvider;
@@ -46,6 +47,16 @@
private final static String NON_ANNOTATED_TEMPLATE_DEFAULT = "portlet.javajet"; //$NON-NLS-1$
+ private boolean isJSFPortlet;
+
+ public NewPortletClassDataModelProvider(boolean isJSFPortlet) {
+ this.isJSFPortlet = isJSFPortlet;
+ }
+
+ public NewPortletClassDataModelProvider() {
+ this(false);
+ }
+
/**
* Subclasses may extend this method to provide their own default operation
* for this data model provider. This implementation uses the
@@ -92,11 +103,17 @@
propertyNames.add(TEMPLATE_FILE);
propertyNames.add(INSTANCE_NAME);
propertyNames.add(WINDOW_NAME);
+ propertyNames.add(PAGE_NAME);
propertyNames.add(PARENT_PORTAL);
propertyNames.add(PAGE_REGION);
propertyNames.add(PORTLET_HEIGHT);
propertyNames.add(IF_EXISTS);
propertyNames.add(ADD_PORTLET);
+ propertyNames.add(ADD_JBOSS_APP);
+ propertyNames.add(ADD_JBOSS_PORTLET);
+ propertyNames.add(JBOSS_APP);
+ propertyNames.add(IS_JSF_PORTLET);
+ propertyNames.add(COPY_JSF_TEMPLATES);
return propertyNames;
}
@@ -126,12 +143,30 @@
@Override
public Object getDefaultProperty(String propertyName) {
+ if (propertyName.equals(IS_JSF_PORTLET)) {
+ if (isJSFPortlet)
+ return Boolean.TRUE;
+ return Boolean.FALSE;
+ }
+ if (propertyName.equals(COPY_JSF_TEMPLATES)) {
+ return Boolean.FALSE;
+ }
if (propertyName.equals(ADD_PORTLET)) {
return Boolean.TRUE;
}
+ if (propertyName.equals(ADD_JBOSS_APP)) {
+ return Boolean.TRUE;
+ }
+ if (propertyName.equals(ADD_JBOSS_PORTLET)) {
+ return Boolean.TRUE;
+ }
if (propertyName.equals(DO_VIEW)) {
return Boolean.TRUE;
}
+ if (isJSFPortlet) {
+ if (propertyName.equals(EDIT_MODE) || propertyName.equals(HELP_MODE))
+ return Boolean.TRUE;
+ }
if (propertyName.equals(DO_EDIT) || propertyName.equals(DO_HELP) || propertyName.equals(INIT) || propertyName.equals(DESTROY) ||
propertyName.equals(GET_PORTLET_CONFIG)) {
return Boolean.FALSE;
@@ -179,9 +214,15 @@
if (propertyName.equals(WINDOW_NAME)) {
return getDefaultProperty(NAME) + "Window";
}
+ if (propertyName.equals(PAGE_NAME)) {
+ return "";
+ }
if (propertyName.equals(PORTLET_HEIGHT)) {
return "1";
}
+ if (propertyName.equals(JBOSS_APP)) {
+ return "riPortletApp";
+ }
if (propertyName.equals(PAGE_REGION)) {
return "center";
}
@@ -202,6 +243,12 @@
if (propertyName.equals(SUPERCLASS))
return validateSuperClassName(getStringProperty(propertyName));
+ if (isJSFPortlet && propertyName.equals(CLASS_NAME)) {
+ if (getStringProperty(propertyName).length()!=0) {
+ return Status.OK_STATUS;
+ }
+
+ }
// Otherwise defer to super to validate the property
return super.validate(propertyName);
}
@@ -247,7 +294,7 @@
model.notifyPropertyChange(PROCESS_ACTION, IDataModel.DEFAULT_CHG);
List ifaces = (List) model.getProperty(INTERFACES);
- ifaces.add(QUALIFIED_SERVLET);
+ ifaces.add(QUALIFIED_PORTLET);
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.jboss.tools.portlet.ui.internal.wizard;
import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
+import static org.eclipse.jst.j2ee.internal.web.operations.INewServletClassDataModelProperties.IS_SERVLET_TYPE;
import static org.eclipse.jst.j2ee.internal.web.operations.INewWebClassDataModelProperties.USE_EXISTING_CLASS;
import org.eclipse.core.resources.IContainer;
@@ -26,7 +27,6 @@
import org.eclipse.jst.j2ee.webapplication.WebApp;
import org.eclipse.jst.jee.ui.internal.navigator.web.GroupServletItemProvider;
import org.eclipse.jst.jee.ui.internal.navigator.web.WebAppProvider;
-import org.eclipse.jst.servlet.ui.internal.wizard.MultiSelectFilteredFileSelectionDialog;
import org.eclipse.jst.servlet.ui.internal.wizard.NewWebClassWizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Cursor;
@@ -37,6 +37,7 @@
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
import org.jboss.tools.portlet.core.IPortletConstants;
+import org.jboss.tools.portlet.ui.MultiSelectFilteredFileSelectionDialog;
public class NewPortletClassWizardPage extends NewWebClassWizardPage {
@@ -99,6 +100,10 @@
ms.open();
if (ms.getReturnCode() == Window.OK) {
String qualifiedClassName = ""; //$NON-NLS-1$
+ IType type = (IType) ms.getFirstResult();
+ if (type != null) {
+ qualifiedClassName = type.getFullyQualifiedName();
+ }
existingClassText.setText(qualifiedClassName);
}
getControl().setCursor(null);
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletWizard.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletWizard.java 2008-08-01 13:10:43 UTC (rev 9469)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletWizard.java 2008-08-01 13:41:55 UTC (rev 9470)
@@ -47,17 +47,17 @@
PAGE_ONE,
NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE, IModuleConstants.JST_WEB_MODULE);
- page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1);
+ //page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1);
addPage(page1);
AddPortletWizardPage page2 = new AddPortletWizardPage(getDataModel(), PAGE_TWO);
- page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2);
+ //page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2);
addPage(page2);
NewPortletClassOptionsWizardPage page3 = new NewPortletClassOptionsWizardPage(
getDataModel(),
PAGE_THREE,
"Specify modifiers, interfaces to implement and method stubs to generate.",
IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE);
- page3.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3);
+ //page3.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_3);
addPage(page3);
AddJBossPortletWizardPage page4 = new AddJBossPortletWizardPage(getDataModel(), PAGE_FOUR);
addPage(page4);
@@ -65,7 +65,7 @@
@Override
protected void postPerformFinish() throws InvocationTargetException {
- // open new servlet class in java editor
+ // open new portlet class in java editor
openJavaClass();
}
15 years, 9 months
JBoss Tools SVN: r9469 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-08-01 09:10:43 -0400 (Fri, 01 Aug 2008)
New Revision: 9469
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2583
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2008-08-01 12:44:08 UTC (rev 9468)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2008-08-01 13:10:43 UTC (rev 9469)
@@ -1,812 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <extension-point id="exporters" name="Hibernate Console Exporter" schema="schema/exporters.exsd"/>
-
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- icon="icons/hibernate_small_icon.gif"
- class="org.hibernate.eclipse.console.HibernateConsolePerspectiveFactory"
- name="Hibernate"
- id="org.hibernate.eclipse.console.HibernateConsolePerspective"/>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <category
- name="Hibernate"
- id="hibernatecategory"/>
- <view
- icon="icons/hibernate_small_icon.gif"
- class="org.hibernate.eclipse.console.views.KnownConfigurationsView"
- category="hibernatecategory"
- name="Hibernate Configurations"
- id="org.hibernate.eclipse.console.views.KnownConfigurationsView"/>
- <!-- <view
- category="hibernatecategory"
- class="org.hibernate.eclipse.graph.EntityGraphView"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.graph.EntityGraphView"
- name="Hibernate Entity Model"/>
- <view
- category="hibernatecategory"
- class="org.hibernate.eclipse.graph.RelationalGraphView"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.graph.RelationalGraphView"
- name="Hibernate Relational Model"/> -->
- <view
- icon="icons/hibernate_small_icon.gif"
- class="org.hibernate.eclipse.console.views.QueryPageTabView"
- category="hibernatecategory"
- name="Hibernate Query Result"
- id="org.hibernate.eclipse.console.views.QueryPageTabView"/>
- <view
- category="hibernatecategory"
- class="org.hibernate.eclipse.console.views.DynamicSQLPreviewView"
- icon="icons/images/hibernate_small_icon.jpg"
- id="org.hibernate.eclipse.console.views.DynamicSQLPreviewView"
- name="Hibernate Dynamic SQL Preview"/>
- <view
- category="hibernatecategory"
- class="org.hibernate.eclipse.console.views.QueryParametersView"
- icon="icons/images/parameter.gif"
- id="org.hibernate.eclipse.console.views.QueryParametersView"
- name="Query Parameters"/>
-
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- name="Hibernate"
- id="hibernatewizards"/>
- <wizard
- category="hibernatewizards"
- class="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"
- name="Hibernate XML Mapping file (hbm.xml)"/>
- <wizard
- category="hibernatewizards"
- class="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
- name="Hibernate Configuration File (cfg.xml)">
- <description>Create a new hibernate.cfg.xml file (Helping with the initial JDBC setup etc.)</description>
- </wizard>
- <wizard
- category="hibernatewizards"
- class="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"
- descriptionImage="icons/hibernate_small_icon.gif"
- finalPerspective="org.hibernate.eclipse.console.HibernateConsolePerspective"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"
- name="Hibernate Console Configuration"
- preferredPerspectives="org.hibernate.eclipse.console.HibernateConsolePerspective"
- project="true">
- <description>Creates a new Hibernate Console Configuration</description>
- </wizard>
- <wizard
- canFinishEarly="false"
- category="hibernatewizards"
- class="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"
- name="Hibernate Reverse Engineering File (reveng.xml)">
- <description>Create a new hibernate.reveng.xml (Helping with the initial table and type filtering)</description>
- </wizard>
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xml"
- id="org.hibernate.eclipse.console.jtidyformat">
- <menu
- label="JTidy"
- path="additions"
- id="org.hibernate.eclipse.console.jtidymenu">
- <separator name="group1"/>
- </menu>
- <action
- label="Format with JTidy"
- class="org.hibernate.eclipse.console.actions.JTidyFormatAction"
- menubarPath="org.hibernate.eclipse.console.jtidymenu/group1"
- id="org.hibernate.eclipse.console.jtidyformat"/>
- </objectContribution>
- </extension>
- <extension
- point="org.eclipse.ui.propertyPages">
- <page
- class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
- id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
- name="Hibernate Settings"
- objectClass="org.eclipse.jdt.core.IJavaProject">
- </page>
- <page
- class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
- id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
- name="Hibernate Settings"
- objectClass="org.eclipse.core.resources.IProject">
- <filter
- name="nature"
- value="org.eclipse.jdt.core.javanature"/>
- </page>
-
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
- <!--objectContribution id="mappingEditorAction" objectClass="org.hibernate.mapping.RootClass">
- <menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
- <action
- id="org.hibernate.eclipse.console.actions.openMappingAction"
- label="Open Mapping File"
- class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
- </action>
- </objectContribution>
- <objectContribution id="mappingEditorAction2" objectClass="org.hibernate.mapping.Property">
- <menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
- <action
- id="org.hibernate.eclipse.console.actions.openMappingAction"
- label="Open Mapping File"
- class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
- </action>
- </objectContribution>
- <objectContribution id="sourceEditorAction" objectClass="org.hibernate.mapping.RootClass">
- <menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
- <action
- id="org.hibernate.eclipse.console.actions.openSourceAction"
- label="Open Source File"
- class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
- </action>
- </objectContribution>
- <objectContribution id="sourceEditorAction2" objectClass="org.hibernate.mapping.Property">
- <menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
- <action
- id="org.hibernate.eclipse.console.actions.openSourceAction"
- label="Open Source File"
- class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
- </action>
- </objectContribution-->
- </extension>
-
- <extension
- id="hibernateNature"
- name="Hibernate Nature"
- point="org.eclipse.core.resources.natures">
- <runtime>
- <run
- class="org.hibernate.eclipse.nature.HibernateNature">
- </run>
- </runtime>
- <requires-nature
- id="org.eclipse.jdt.core.javanature">
- </requires-nature>
- </extension>
-
- <extension
- id="hibernateBuilder"
- name="Hibernate Builder"
- point="org.eclipse.core.resources.builders">
- <builder hasNature="false">
- <run class="org.hibernate.eclipse.builder.HibernateBuilder"/>
- </builder>
- </extension>
-
- <extension
- point="org.eclipse.ui.editors">
- <editor
- class="org.hibernate.eclipse.hqleditor.HQLEditor"
- contributorClass="org.hibernate.eclipse.hqleditor.HQLEditorActionContributor"
- extensions="hql"
- icon="icons/images/hql_editor.gif"
- id="org.hibernate.eclipse.hqleditor.HQLEditor"
- name="HQL Editor">
- </editor>
- <editor
- class="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"
- contributorClass="org.hibernate.eclipse.criteriaeditor.CriteriaEditorActionContributor"
- extensions="crit"
- icon="icons/images/criteria_editor.gif"
- id="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"
- name="Criteria Editor"/>
- </extension>
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- id="org.hibernate.eclipse.console.actionSet"
- label="HQL"
- visible="false">
- <menu
- id="HQL"
- label="H&QL">
- <separator name="hqlGroup"/>
- </menu>
- <action
- allowLabelUpdate="true"
- icon="icons/images/execute.gif"
- id="org.hibernate.eclipse.console.actions.ExecuteQueryAction"
- definitionId="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
- label="Run Query"
- retarget="true"
- tooltip="Run HQL Query from current editor">
- </action>
- </actionSet>
- <actionSet
- label="Hibernate Code Generation"
- id="org.hibernate.eclipse.launch.actionset">
- <!-- the menu is here to stop eclipse complaining about a menu entry that might not yet have started (see HBX-863) -->
- <menu
- id="org.eclipse.ui.run"
- label="&Run">
- <groupMarker name="HibernateToolsGroup"/>
- </menu>
- <action
- label="Hibernate Code Generation..."
- style="pulldown"
- icon="icons/images/hibernate_launch.png"
- class="org.hibernate.eclipse.launch.LaunchMenuDelegate"
- menubarPath="org.eclipse.ui.run/HibernateToolsGroup"
- id="org.hibernate.eclipse.launch.LaunchMenuDelegateMenu">
- </action>
- <action
- label="Hibernate Code Generation..."
- style="pulldown"
- icon="icons/images/hibernate_launch.png"
- tooltip="Generate code via Hibernate Tools"
- class="org.hibernate.eclipse.launch.LaunchMenuDelegate"
- toolbarPath="org.eclipse.debug.ui.launchActionSet/hibernatetool"
- id="org.hibernate.eclipse.launch.LaunchMenuDelegateToolBar">
- </action>
- <action
- definitionId="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations"
- label="Hibernate Tools ..."
- class="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations"
- id="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations">
- </action>
- </actionSet>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.ui.category.edit"
- id="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
- name="Run Query command"/>
-</extension>
-<extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
- contextId="org.hibernate.eclipse.console.hql"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+ENTER"/>
-</extension>
-
- <extension point="org.eclipse.ui.actionSetPartAssociations">
- <actionSetPartAssociation targetID="org.hibernate.eclipse.console.actionSet">
- <part id="org.hibernate.eclipse.hqleditor.HQLEditor"/>
- <part id="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"/>
- </actionSetPartAssociation>
- </extension>
- <!--extension
- point="org.eclipse.ui.editorActions">
- <editorContribution
- id="org.hibernate.eclipse.hqleditor.HQLEditorContributions"
- targetID="org.hibernate.eclipse.hqleditor.HQLEditor">
- <action
- actionID="clearEditor"
- class="org.hibernate.eclipse.console.actions.ClearHQLEditorAction"
- icon="icons/images/clear.gif"
- id="org.hibernate.eclipse.console.actions.ClearHQLEditorAction"
- label="&Clear HQL Editor"
- menubarPath="HQL/hqlGroup"
- style="push"
- toolbarPath="hqlGroup"
- tooltip="Clear HQL Editor">
- </action>
- <menu
- id="HQL"
- label="H&QL">
- <separator name="hqlGroup"/>
- </menu>
- </editorContribution>
- </extension-->
-
- <extension
- point = "org.eclipse.ui.elementFactories">
- <factory
- id ="org.hibernate.eclipse.hqleditor.HQLEditorInputFactory"
- class="org.hibernate.eclipse.hqleditor.HQLEditorInputFactory">
- </factory>
- <factory
- id ="org.hibernate.eclipse.criteriaeditor.CriteriaEditorInputFactory"
- class="org.hibernate.eclipse.criteriaeditor.CriteriaEditorInputFactory">
- </factory>
- </extension>
- <!-- Only Show Hibernate Launch Action Set in the following perspectives (as well as the Hibernate Console perspective-->
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
- <actionSet id="org.hibernate.eclipse.launch.actionset"/>
- </perspectiveExtension>
- <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaBrowsingPerspective">
- <actionSet id="org.hibernate.eclipse.launch.actionset"/>
- </perspectiveExtension>
- </extension>
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension targetID="org.hibernate.eclipse.console.HibernateConsolePerspective">
- <actionSet id="org.hibernate.eclipse.launch.actionset"/>
- <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"/>
- <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"/>
-<!-- <newWizardShortcut id="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"/> -->
- <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"/>
- <viewShortcut id="org.hibernate.eclipse.console.views.KnownConfigurationsView"/>
- <viewShortcut id="org.hibernate.eclipse.graph.EntityGraphView"/>
- <viewShortcut id="org.hibernate.eclipse.console.views.QueryPageTabView"/>
- <viewShortcut id="org.hibernate.eclipse.console.views.DynamicQueryTranslatorView"/>
- </perspectiveExtension>
- </extension>
- <extension
- point="org.eclipse.ui.contexts">
- <context
- id="org.hibernate.eclipse.console.hql"
- name="Editing HQL"
- parentId="org.eclipse.ui.textEditorScope"/>
- </extension>
-
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- category="org.hibernate.eclipse.launchcategory"
- delegate="org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate"
- id="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"
- modes="run"
- name="Hibernate Code Generation"
- public="true"/>
- <launchConfigurationType
- delegate="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchDelegate"
- id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"
- modes="run"
- name="Hibernate Console Configuration"
- public="true"/>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- icon="icons/images/hibernate_launch.png"
- configTypeID="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"
- id="org.hibernate.eclipse.launch.CodeGenerationLaunchImage"/>
- <launchConfigurationTypeImage
- icon="icons/images/hibernate_config.gif"
- configTypeID="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"
- id="org.hibernate.eclipse.launch.ConsoleConfiguraitonLaunchImage"/>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- class="org.hibernate.eclipse.launch.LaunchConfigurationTabGroup"
- description="Select or configure a code generation"
- id="org.hibernate.eclipse.launch.CodeGenerationLaunchTabGroup"
- type="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"/>
- <launchConfigurationTabGroup
- class="org.hibernate.eclipse.launch.ConsoleConfigurationTabGroup"
- description="Select or configure a Console Configuration"
- id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchTabGroup"
- type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"/>
- </extension>
-
- <extension
- point="org.eclipse.debug.ui.launchGroups">
- <launchGroup
- bannerImage="icons/images/newhibernate_wiz.gif"
- category="org.hibernate.eclipse.launchcategory"
- id="org.hibernate.eclipse.launch.CodeGenerationLaunchGroup"
- image="icons/images/hibernate_launch.png"
- label="Hibernate Code Generation"
- mode="run"
- title="Select or configure a code generation to run"/>
- <launchGroup
- bannerImage="icons/images/newhibernate_wiz.gif"
- category="org.hibernate.eclipse.launchcategory"
- id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchGroup"
- image="icons/images/hibernate_launch.png"
- label="Hibernate Console Configuration"
- mode="run"
- title="Select or configure a console configuration to run"/>
- </extension>
- <extension
- point="org.eclipse.debug.core.statusHandlers">
- <statusHandler
- class="org.hibernate.eclipse.launch.GeneralExceptionStatusHandler"
- code="666"
- id="org.hibernate.eclipse.launch.GeneralExceptionStatusHandler"
- plugin="org.hibernate.eclipse.console"/>
- </extension>
- <extension
- point="org.hibernate.eclipse.console.exporters">
- <exporter
- classname="org.hibernate.tool.hbm2x.POJOExporter"
- description="Domain code (.java)"
- icon="icons/images/mapped_class.gif"
- id="org.hibernate.tools.hbm2java">
- <property
- description="Generate EJB3 annotations"
- name="ejb3"
- type="boolean"
- value="false"/>
- <property
- description="Generate Java 5 syntax"
- name="jdk5"
- type="boolean"
- value="false"/>
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- </exporter>
- <exporter
- classname="org.hibernate.tool.hbm2x.HibernateMappingExporter"
- description="Hibernate XML Mappings (.hbm.xml)"
- icon="icons/images/hibernate_mapping.gif"
- id="org.hibernate.tools.hbm2hbmxml">
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- </exporter>
- <exporter
- classname="org.hibernate.tool.hbm2x.DAOExporter"
- description="DAO code (.java)"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.tools.hbm2dao">
- <property
- description="Generate EJB3 annotations"
- name="ejb3"
- type="boolean"
- value="false"/>
- <property
- description="Generate Java syntax"
- name="jdk5"
- type="boolean"
- value="false"/>
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- </exporter>
- <exporter
- classname="org.hibernate.tool.hbm2x.GenericExporter"
- description="Generic Exporter (<hbmtemplate>)"
- icon="icons/images/hibernate_mapping.gif"
- id="org.hibernate.tools.hbmtemplate">
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- <property
- description="File pattern"
- name="file_pattern"
- type="string"
- value="${package-name}/${class-name}.java"/>
- <property
- description="For each"
- name="for_each"
- type="string"
- value="entity, component"/>
- <property
- description="Template name"
- name="template_name"
- type="string"
- value="pojo/Pojo.ftl"/>
- </exporter>
-
- <exporter
- classname="org.hibernate.tool.hbm2x.HibernateConfigurationExporter"
- description="Hibernate XML Configuration (.cfg.xml)"
- icon="icons/hibernate_small_icon.gif"
- id="org.hibernate.tools.hbm2cfgxml">
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- </exporter>
- <exporter
- classname="org.hibernate.tool.hbm2x.DocExporter"
- description="Schema Documentation (.html)"
- icon="icons/images/schema.gif"
- id="org.hibernate.tools.hbm2doc">
- <property
- description="executable to run GraphViz"
- name="dot.executable"
- type="string"
- value="dot.exe"/>
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Template directory"
- name="template_path"
- type="path"
- value=""/>
- </exporter>
- <exporter
- classname="org.hibernate.tool.hbm2x.Hbm2DDLExporter"
- description="Schema Export (.ddl)"
- icon="icons/images/schema.gif"
- id="org.hibernate.tools.hbm2ddl">
- <property
- description="Output directory"
- name="outputdir"
- type="directory"
- value=""/>
- <property
- description="Output file name"
- name="outputFileName"
- type="string"
- value="schema.sql"/>
- <property
- description="Export to database"
- name="exportToDatabase"
- type="boolean"
- value="true"/> <!-- we set this to false in the ui to avoid users to delete their databases with a single click -->
- <property
- description="Script to console"
- name="scriptToConsole"
- type="boolean"
- value="true"/>
- <property
- description="Update schema"
- name="schemaUpdate"
- type="boolean"
- value="false"/>
- <property
- description="Delimiter used in output file"
- name="delimiter"
- type="string"
- value=";"/>
- <property
- description="Generate Drop statements"
- name="drop"
- type="boolean"
- value="false"/>
- <property
- description="Generate Create statements"
- name="create"
- type="boolean"
- value="true"/>
- <property
- description="Format generated SQL"
- name="format"
- type="boolean"
- value="false"/>
- <property
- description="Halt on error"
- name="haltOnError"
- type="boolean"
- value="false"/>
- </exporter>
- </extension>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- class="org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePage"
- id="org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePage"
- name="HQL editor">
- <keywordReference id="org.hibernate.eclipse.hqleditor.preferencekeywords"/>
- </page>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer class="org.hibernate.eclipse.hqleditor.preferences.PreferenceInitializer"/>
- </extension>
- <extension
- point="org.eclipse.ui.keywords">
- <keyword
- id="org.hibernate.eclipse.hqleditor.preferencekeywords"
- label="hql editor colors coloring highlighting query"/>
- </extension>
- <extension
- point="org.eclipse.ltk.core.refactoring.renameParticipants">
- <!--renameParticipant
- class="org.hibernate.eclipse.launch.core.refactoring.RenameProjectParticipant"
- id="org.hibernate.eclipse.launch.core.refactoring.RenameProjectParticipant"
- name="Launch Configurations projectrename updates">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IJavaProject"/>
- </with>
- </enablement>
- </renameParticipant>
- <renameParticipant
- class="org.hibernate.eclipse.launch.core.refactoring.RenamePackageParticipant"
- id="org.hibernate.eclipse.launch.core.refactoring.RenamePackageParticipant"
- name="Launch Configurations package rename updates">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </with>
- </enablement>
- </renameParticipant-->
- <renameParticipant
- class="org.hibernate.eclipse.launch.core.refactoring.RenameResourceParticipant"
- id="org.hibernate.eclipse.launch.core.refactoring.RenameResourceParticipant"
- name="Launch Configurations resource rename updates">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.core.resources.IResource"/>
- </with>
- </enablement>
- </renameParticipant>
- </extension>
- <extension
- point="org.eclipse.ltk.core.refactoring.moveParticipants">
- <moveParticipant
- class="org.hibernate.eclipse.launch.core.refactoring.MoveResourceParticipant"
- id="org.hibernate.eclipse.launch.core.refactoring.MoveResourceParticipant"
- name="Launch Configurations resource move updates">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.core.resources.IResource"/>
- </with>
- </enablement>
- </moveParticipant>
- <!--moveParticipant
- class="org.hibernate.eclipse.launch.core.refactoring.MovePackageParticipant"
- id="org.hibernate.eclipse.launch.core.refactoring.MovePackageParticipant"
- name="Launch Configurations resource move updates">
- <enablement>
- <with variable="element">
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </with>
- </enablement>
- </moveParticipant-->
-
- </extension>
- <extension
- point="org.eclipse.ui.popupMenus">
- <!--<objectContribution
- id="org.hibernate.eclipse.console.objectContribution2"
- objectClass="org.hibernate.mapping.Table">
- <action
- class="org.hibernate.eclipse.console.GenerateEntitiesAction"
- id="org.hibernate.eclipse.console.action1"
- label="%GenerateEntities">
- </action>-->
- </extension>
- <!-- <extension
- point="org.eclipse.ui.themes">
- <themeElementCategory
- id="org.hibernate.eclipse.presentation.hql"
- label="HQL"/>
-
- <fontDefinition
- label="HQL editor text font"
- defaultsTo="org.eclipse.jface.textfont"
- categoryId="org.hibernate.eclipse.presentation.hql"
- id="org.hibernate.eclipse.presentation.hql.textfont">
- <description>
- The HQL editor text font is used by HQL editors.
- </description>
- </fontDefinition>
-
- </extension>
- -->
-
-<!-- Do not expose the facet before the id's are stable
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
- <category id="org.hibernate.eclipse.facet.category">
- <label>Hibernate Facet</label>
- </category>
- <project-facet id="org.hibernate.eclipse.facet.hibernate-core">
- <label>Hibernate Core</label>
- <description>Enables support for Hibernate</description>
- </project-facet>
- <project-facet-version
- facet="org.hibernate.eclipse.facet.hibernate-core"
- version="3.2.0.0">
- <action type="install">
- <delegate class="org.hibernate.eclipse.facet.HibernateCoreFacetInstallDelegate"/>
- </action>
- </project-facet-version>
- </extension>
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
- <supported>
- <facet id="org.hibernate.eclipse.facet.hibernate-core"/>
- <runtime-component any="true"/>
- </supported>
- </extension>
- -->
-<!-- <extension
- point="org.eclipse.ui.views">
- <view
- allowMultiple="false"
- category="hibernatecategory"
- class="org.hibernate.eclipse.console.views.navigator.KnownConfigurationsNaviagtor"
- id="org.hibernate.eclipse.navigator.KnownConfigurationsViewer"
- name="Hibernate Configurations"/>
- </extension>
- <extension
- point="org.eclipse.ui.navigator.viewer">
- <viewer viewerId="org.hibernate.eclipse.navigator.KnownConfigurationsViewer"/>
- <viewerContentBinding viewerId="org.hibernate.eclipse.navigator.KnownConfigurationsViewer">
- <includes>
- <contentExtension
- isRoot="true"
- pattern="org.hibernate.eclipse.navigator.KnownConfigurationsContent"/>
- </includes>
- </viewerContentBinding>
- <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.hibernate.eclipse.navigator.KnownConfigurationsContent"/>
- </includes>
- </viewerContentBinding>
- </extension>
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
- <navigatorContent
- activeByDefault="true"
- contentProvider="org.hibernate.eclipse.console.views.NavigatorProvider"
- id="org.hibernate.eclipse.navigator.KnownConfigurationsContent"
- labelProvider="org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider"
- name="Hibernate Known Configurations">
- <possibleChildren>
- <instanceof value="java.lang.Object"/>
- </possibleChildren>
- </navigatorContent>
- </extension>
--->
-
-
- <!--
- <extension
- point="org.eclipse.ui.themes">
- <themeElementCategory
- id="org.hibernate.eclipse.console.theme.HQLColors"
- label="HQL Colors"/>
- <colorDefinition
- categoryId="org.hibernate.eclipse.console.theme.HQLColors"
- id="HQL_KEYWORD"
- isEditable="true"
- label="HQL Keyword"
- value="123,45,3">
- <description>Color for a HQL keyword</description>
- </colorDefinition>
- </extension>
--->
-</plugin>
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2008-08-01 13:10:43 UTC (rev 9469)
@@ -0,0 +1,811 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="exporters" name="Hibernate Console Exporter" schema="schema/exporters.exsd"/>
+
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ icon="icons/hibernate_small_icon.gif"
+ class="org.hibernate.eclipse.console.HibernateConsolePerspectiveFactory"
+ name="Hibernate"
+ id="org.hibernate.eclipse.console.HibernateConsolePerspective"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ name="Hibernate"
+ id="hibernatecategory"/>
+ <view
+ icon="icons/hibernate_small_icon.gif"
+ class="org.hibernate.eclipse.console.views.KnownConfigurationsView"
+ category="hibernatecategory"
+ name="Hibernate Configurations"
+ id="org.hibernate.eclipse.console.views.KnownConfigurationsView"/>
+ <!-- <view
+ category="hibernatecategory"
+ class="org.hibernate.eclipse.graph.EntityGraphView"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.graph.EntityGraphView"
+ name="Hibernate Entity Model"/>
+ <view
+ category="hibernatecategory"
+ class="org.hibernate.eclipse.graph.RelationalGraphView"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.graph.RelationalGraphView"
+ name="Hibernate Relational Model"/> -->
+ <view
+ icon="icons/hibernate_small_icon.gif"
+ class="org.hibernate.eclipse.console.views.QueryPageTabView"
+ category="hibernatecategory"
+ name="Hibernate Query Result"
+ id="org.hibernate.eclipse.console.views.QueryPageTabView"/>
+ <view
+ category="hibernatecategory"
+ class="org.hibernate.eclipse.console.views.DynamicSQLPreviewView"
+ icon="icons/images/hibernate_small_icon.jpg"
+ id="org.hibernate.eclipse.console.views.DynamicSQLPreviewView"
+ name="Hibernate Dynamic SQL Preview"/>
+ <view
+ category="hibernatecategory"
+ class="org.hibernate.eclipse.console.views.QueryParametersView"
+ icon="icons/images/parameter.gif"
+ id="org.hibernate.eclipse.console.views.QueryParametersView"
+ name="Query Parameters"/>
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="Hibernate"
+ id="hibernatewizards"/>
+ <wizard
+ category="hibernatewizards"
+ class="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"
+ name="Hibernate XML Mapping file (hbm.xml)"/>
+ <wizard
+ category="hibernatewizards"
+ class="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"
+ name="Hibernate Configuration File (cfg.xml)">
+ <description>Create a new hibernate.cfg.xml file (Helping with the initial JDBC setup etc.)</description>
+ </wizard>
+ <wizard
+ category="hibernatewizards"
+ class="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"
+ descriptionImage="icons/hibernate_small_icon.gif"
+ finalPerspective="org.hibernate.eclipse.console.HibernateConsolePerspective"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"
+ name="Hibernate Console Configuration"
+ preferredPerspectives="org.hibernate.eclipse.console.HibernateConsolePerspective">
+ <description>Creates a new Hibernate Console Configuration</description>
+ </wizard>
+ <wizard
+ canFinishEarly="false"
+ category="hibernatewizards"
+ class="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"
+ name="Hibernate Reverse Engineering File (reveng.xml)">
+ <description>Create a new hibernate.reveng.xml (Helping with the initial table and type filtering)</description>
+ </wizard>
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.xml"
+ id="org.hibernate.eclipse.console.jtidyformat">
+ <menu
+ label="JTidy"
+ path="additions"
+ id="org.hibernate.eclipse.console.jtidymenu">
+ <separator name="group1"/>
+ </menu>
+ <action
+ label="Format with JTidy"
+ class="org.hibernate.eclipse.console.actions.JTidyFormatAction"
+ menubarPath="org.hibernate.eclipse.console.jtidymenu/group1"
+ id="org.hibernate.eclipse.console.jtidyformat"/>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
+ id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
+ name="Hibernate Settings"
+ objectClass="org.eclipse.jdt.core.IJavaProject">
+ </page>
+ <page
+ class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
+ id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
+ name="Hibernate Settings"
+ objectClass="org.eclipse.core.resources.IProject">
+ <filter
+ name="nature"
+ value="org.eclipse.jdt.core.javanature"/>
+ </page>
+
+ </extension>
+
+ <extension point="org.eclipse.ui.popupMenus">
+ <!--objectContribution id="mappingEditorAction" objectClass="org.hibernate.mapping.RootClass">
+ <menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openMappingAction"
+ label="Open Mapping File"
+ class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
+ </action>
+ </objectContribution>
+ <objectContribution id="mappingEditorAction2" objectClass="org.hibernate.mapping.Property">
+ <menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openMappingAction"
+ label="Open Mapping File"
+ class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
+ </action>
+ </objectContribution>
+ <objectContribution id="sourceEditorAction" objectClass="org.hibernate.mapping.RootClass">
+ <menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openSourceAction"
+ label="Open Source File"
+ class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
+ </action>
+ </objectContribution>
+ <objectContribution id="sourceEditorAction2" objectClass="org.hibernate.mapping.Property">
+ <menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openSourceAction"
+ label="Open Source File"
+ class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
+ </action>
+ </objectContribution-->
+ </extension>
+
+ <extension
+ id="hibernateNature"
+ name="Hibernate Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.hibernate.eclipse.nature.HibernateNature">
+ </run>
+ </runtime>
+ <requires-nature
+ id="org.eclipse.jdt.core.javanature">
+ </requires-nature>
+ </extension>
+
+ <extension
+ id="hibernateBuilder"
+ name="Hibernate Builder"
+ point="org.eclipse.core.resources.builders">
+ <builder hasNature="false">
+ <run class="org.hibernate.eclipse.builder.HibernateBuilder"/>
+ </builder>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.hibernate.eclipse.hqleditor.HQLEditor"
+ contributorClass="org.hibernate.eclipse.hqleditor.HQLEditorActionContributor"
+ extensions="hql"
+ icon="icons/images/hql_editor.gif"
+ id="org.hibernate.eclipse.hqleditor.HQLEditor"
+ name="HQL Editor">
+ </editor>
+ <editor
+ class="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"
+ contributorClass="org.hibernate.eclipse.criteriaeditor.CriteriaEditorActionContributor"
+ extensions="crit"
+ icon="icons/images/criteria_editor.gif"
+ id="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"
+ name="Criteria Editor"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.hibernate.eclipse.console.actionSet"
+ label="HQL"
+ visible="false">
+ <menu
+ id="HQL"
+ label="H&QL">
+ <separator name="hqlGroup"/>
+ </menu>
+ <action
+ allowLabelUpdate="true"
+ icon="icons/images/execute.gif"
+ id="org.hibernate.eclipse.console.actions.ExecuteQueryAction"
+ definitionId="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
+ label="Run Query"
+ retarget="true"
+ tooltip="Run HQL Query from current editor">
+ </action>
+ </actionSet>
+ <actionSet
+ label="Hibernate Code Generation"
+ id="org.hibernate.eclipse.launch.actionset">
+ <!-- the menu is here to stop eclipse complaining about a menu entry that might not yet have started (see HBX-863) -->
+ <menu
+ id="org.eclipse.ui.run"
+ label="&Run">
+ <groupMarker name="HibernateToolsGroup"/>
+ </menu>
+ <action
+ label="Hibernate Code Generation..."
+ style="pulldown"
+ icon="icons/images/hibernate_launch.png"
+ class="org.hibernate.eclipse.launch.LaunchMenuDelegate"
+ menubarPath="org.eclipse.ui.run/HibernateToolsGroup"
+ id="org.hibernate.eclipse.launch.LaunchMenuDelegateMenu">
+ </action>
+ <action
+ label="Hibernate Code Generation..."
+ style="pulldown"
+ icon="icons/images/hibernate_launch.png"
+ tooltip="Generate code via Hibernate Tools"
+ class="org.hibernate.eclipse.launch.LaunchMenuDelegate"
+ toolbarPath="org.eclipse.debug.ui.launchActionSet/hibernatetool"
+ id="org.hibernate.eclipse.launch.LaunchMenuDelegateToolBar">
+ </action>
+ <action
+ definitionId="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations"
+ label="Hibernate Tools ..."
+ class="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations"
+ id="org.hibernate.eclipse.launch.OpenHibernateToolsConfigurations">
+ </action>
+ </actionSet>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.ui.category.edit"
+ id="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
+ name="Run Query command"/>
+</extension>
+<extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.hibernate.eclipse.console.actions.ExecuteHQLActionCommand"
+ contextId="org.hibernate.eclipse.console.hql"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+ENTER"/>
+</extension>
+
+ <extension point="org.eclipse.ui.actionSetPartAssociations">
+ <actionSetPartAssociation targetID="org.hibernate.eclipse.console.actionSet">
+ <part id="org.hibernate.eclipse.hqleditor.HQLEditor"/>
+ <part id="org.hibernate.eclipse.criteriaeditor.CriteriaEditor"/>
+ </actionSetPartAssociation>
+ </extension>
+ <!--extension
+ point="org.eclipse.ui.editorActions">
+ <editorContribution
+ id="org.hibernate.eclipse.hqleditor.HQLEditorContributions"
+ targetID="org.hibernate.eclipse.hqleditor.HQLEditor">
+ <action
+ actionID="clearEditor"
+ class="org.hibernate.eclipse.console.actions.ClearHQLEditorAction"
+ icon="icons/images/clear.gif"
+ id="org.hibernate.eclipse.console.actions.ClearHQLEditorAction"
+ label="&Clear HQL Editor"
+ menubarPath="HQL/hqlGroup"
+ style="push"
+ toolbarPath="hqlGroup"
+ tooltip="Clear HQL Editor">
+ </action>
+ <menu
+ id="HQL"
+ label="H&QL">
+ <separator name="hqlGroup"/>
+ </menu>
+ </editorContribution>
+ </extension-->
+
+ <extension
+ point = "org.eclipse.ui.elementFactories">
+ <factory
+ id ="org.hibernate.eclipse.hqleditor.HQLEditorInputFactory"
+ class="org.hibernate.eclipse.hqleditor.HQLEditorInputFactory">
+ </factory>
+ <factory
+ id ="org.hibernate.eclipse.criteriaeditor.CriteriaEditorInputFactory"
+ class="org.hibernate.eclipse.criteriaeditor.CriteriaEditorInputFactory">
+ </factory>
+ </extension>
+ <!-- Only Show Hibernate Launch Action Set in the following perspectives (as well as the Hibernate Console perspective-->
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <actionSet id="org.hibernate.eclipse.launch.actionset"/>
+ </perspectiveExtension>
+ <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaBrowsingPerspective">
+ <actionSet id="org.hibernate.eclipse.launch.actionset"/>
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension targetID="org.hibernate.eclipse.console.HibernateConsolePerspective">
+ <actionSet id="org.hibernate.eclipse.launch.actionset"/>
+ <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewHibernateMappingFileWizard"/>
+ <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewConfigurationWizard"/>
+ <newWizardShortcut id="org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard"/>
+ <newWizardShortcut id="org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard"/>
+ <viewShortcut id="org.hibernate.eclipse.console.views.KnownConfigurationsView"/>
+ <viewShortcut id="org.hibernate.eclipse.graph.EntityGraphView"/>
+ <viewShortcut id="org.hibernate.eclipse.console.views.QueryPageTabView"/>
+ <viewShortcut id="org.hibernate.eclipse.console.views.DynamicQueryTranslatorView"/>
+ </perspectiveExtension>
+ </extension>
+ <extension
+ point="org.eclipse.ui.contexts">
+ <context
+ id="org.hibernate.eclipse.console.hql"
+ name="Editing HQL"
+ parentId="org.eclipse.ui.textEditorScope"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.debug.core.launchConfigurationTypes">
+ <launchConfigurationType
+ category="org.hibernate.eclipse.launchcategory"
+ delegate="org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate"
+ id="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"
+ modes="run"
+ name="Hibernate Code Generation"
+ public="true"/>
+ <launchConfigurationType
+ delegate="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchDelegate"
+ id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"
+ modes="run"
+ name="Hibernate Console Configuration"
+ public="true"/>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTypeImages">
+ <launchConfigurationTypeImage
+ icon="icons/images/hibernate_launch.png"
+ configTypeID="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"
+ id="org.hibernate.eclipse.launch.CodeGenerationLaunchImage"/>
+ <launchConfigurationTypeImage
+ icon="icons/images/hibernate_config.gif"
+ configTypeID="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"
+ id="org.hibernate.eclipse.launch.ConsoleConfiguraitonLaunchImage"/>
+ </extension>
+ <extension
+ point="org.eclipse.debug.ui.launchConfigurationTabGroups">
+ <launchConfigurationTabGroup
+ class="org.hibernate.eclipse.launch.LaunchConfigurationTabGroup"
+ description="Select or configure a code generation"
+ id="org.hibernate.eclipse.launch.CodeGenerationLaunchTabGroup"
+ type="org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"/>
+ <launchConfigurationTabGroup
+ class="org.hibernate.eclipse.launch.ConsoleConfigurationTabGroup"
+ description="Select or configure a Console Configuration"
+ id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchTabGroup"
+ type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.debug.ui.launchGroups">
+ <launchGroup
+ bannerImage="icons/images/newhibernate_wiz.gif"
+ category="org.hibernate.eclipse.launchcategory"
+ id="org.hibernate.eclipse.launch.CodeGenerationLaunchGroup"
+ image="icons/images/hibernate_launch.png"
+ label="Hibernate Code Generation"
+ mode="run"
+ title="Select or configure a code generation to run"/>
+ <launchGroup
+ bannerImage="icons/images/newhibernate_wiz.gif"
+ category="org.hibernate.eclipse.launchcategory"
+ id="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchGroup"
+ image="icons/images/hibernate_launch.png"
+ label="Hibernate Console Configuration"
+ mode="run"
+ title="Select or configure a console configuration to run"/>
+ </extension>
+ <extension
+ point="org.eclipse.debug.core.statusHandlers">
+ <statusHandler
+ class="org.hibernate.eclipse.launch.GeneralExceptionStatusHandler"
+ code="666"
+ id="org.hibernate.eclipse.launch.GeneralExceptionStatusHandler"
+ plugin="org.hibernate.eclipse.console"/>
+ </extension>
+ <extension
+ point="org.hibernate.eclipse.console.exporters">
+ <exporter
+ classname="org.hibernate.tool.hbm2x.POJOExporter"
+ description="Domain code (.java)"
+ icon="icons/images/mapped_class.gif"
+ id="org.hibernate.tools.hbm2java">
+ <property
+ description="Generate EJB3 annotations"
+ name="ejb3"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Generate Java 5 syntax"
+ name="jdk5"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ </exporter>
+ <exporter
+ classname="org.hibernate.tool.hbm2x.HibernateMappingExporter"
+ description="Hibernate XML Mappings (.hbm.xml)"
+ icon="icons/images/hibernate_mapping.gif"
+ id="org.hibernate.tools.hbm2hbmxml">
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ </exporter>
+ <exporter
+ classname="org.hibernate.tool.hbm2x.DAOExporter"
+ description="DAO code (.java)"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.tools.hbm2dao">
+ <property
+ description="Generate EJB3 annotations"
+ name="ejb3"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Generate Java syntax"
+ name="jdk5"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ </exporter>
+ <exporter
+ classname="org.hibernate.tool.hbm2x.GenericExporter"
+ description="Generic Exporter (<hbmtemplate>)"
+ icon="icons/images/hibernate_mapping.gif"
+ id="org.hibernate.tools.hbmtemplate">
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ <property
+ description="File pattern"
+ name="file_pattern"
+ type="string"
+ value="${package-name}/${class-name}.java"/>
+ <property
+ description="For each"
+ name="for_each"
+ type="string"
+ value="entity, component"/>
+ <property
+ description="Template name"
+ name="template_name"
+ type="string"
+ value="pojo/Pojo.ftl"/>
+ </exporter>
+
+ <exporter
+ classname="org.hibernate.tool.hbm2x.HibernateConfigurationExporter"
+ description="Hibernate XML Configuration (.cfg.xml)"
+ icon="icons/hibernate_small_icon.gif"
+ id="org.hibernate.tools.hbm2cfgxml">
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ </exporter>
+ <exporter
+ classname="org.hibernate.tool.hbm2x.DocExporter"
+ description="Schema Documentation (.html)"
+ icon="icons/images/schema.gif"
+ id="org.hibernate.tools.hbm2doc">
+ <property
+ description="executable to run GraphViz"
+ name="dot.executable"
+ type="string"
+ value="dot.exe"/>
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Template directory"
+ name="template_path"
+ type="path"
+ value=""/>
+ </exporter>
+ <exporter
+ classname="org.hibernate.tool.hbm2x.Hbm2DDLExporter"
+ description="Schema Export (.ddl)"
+ icon="icons/images/schema.gif"
+ id="org.hibernate.tools.hbm2ddl">
+ <property
+ description="Output directory"
+ name="outputdir"
+ type="directory"
+ value=""/>
+ <property
+ description="Output file name"
+ name="outputFileName"
+ type="string"
+ value="schema.sql"/>
+ <property
+ description="Export to database"
+ name="exportToDatabase"
+ type="boolean"
+ value="true"/> <!-- we set this to false in the ui to avoid users to delete their databases with a single click -->
+ <property
+ description="Script to console"
+ name="scriptToConsole"
+ type="boolean"
+ value="true"/>
+ <property
+ description="Update schema"
+ name="schemaUpdate"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Delimiter used in output file"
+ name="delimiter"
+ type="string"
+ value=";"/>
+ <property
+ description="Generate Drop statements"
+ name="drop"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Generate Create statements"
+ name="create"
+ type="boolean"
+ value="true"/>
+ <property
+ description="Format generated SQL"
+ name="format"
+ type="boolean"
+ value="false"/>
+ <property
+ description="Halt on error"
+ name="haltOnError"
+ type="boolean"
+ value="false"/>
+ </exporter>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePage"
+ id="org.hibernate.eclipse.hqleditor.preferences.HQLEditorPreferencePage"
+ name="HQL editor">
+ <keywordReference id="org.hibernate.eclipse.hqleditor.preferencekeywords"/>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.hibernate.eclipse.hqleditor.preferences.PreferenceInitializer"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.keywords">
+ <keyword
+ id="org.hibernate.eclipse.hqleditor.preferencekeywords"
+ label="hql editor colors coloring highlighting query"/>
+ </extension>
+ <extension
+ point="org.eclipse.ltk.core.refactoring.renameParticipants">
+ <!--renameParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.RenameProjectParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.RenameProjectParticipant"
+ name="Launch Configurations projectrename updates">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.jdt.core.IJavaProject"/>
+ </with>
+ </enablement>
+ </renameParticipant>
+ <renameParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.RenamePackageParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.RenamePackageParticipant"
+ name="Launch Configurations package rename updates">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
+ </with>
+ </enablement>
+ </renameParticipant-->
+ <renameParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.RenameResourceParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.RenameResourceParticipant"
+ name="Launch Configurations resource rename updates">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </with>
+ </enablement>
+ </renameParticipant>
+ </extension>
+ <extension
+ point="org.eclipse.ltk.core.refactoring.moveParticipants">
+ <moveParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.MoveResourceParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.MoveResourceParticipant"
+ name="Launch Configurations resource move updates">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </with>
+ </enablement>
+ </moveParticipant>
+ <!--moveParticipant
+ class="org.hibernate.eclipse.launch.core.refactoring.MovePackageParticipant"
+ id="org.hibernate.eclipse.launch.core.refactoring.MovePackageParticipant"
+ name="Launch Configurations resource move updates">
+ <enablement>
+ <with variable="element">
+ <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
+ </with>
+ </enablement>
+ </moveParticipant-->
+
+ </extension>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <!--<objectContribution
+ id="org.hibernate.eclipse.console.objectContribution2"
+ objectClass="org.hibernate.mapping.Table">
+ <action
+ class="org.hibernate.eclipse.console.GenerateEntitiesAction"
+ id="org.hibernate.eclipse.console.action1"
+ label="%GenerateEntities">
+ </action>-->
+ </extension>
+ <!-- <extension
+ point="org.eclipse.ui.themes">
+ <themeElementCategory
+ id="org.hibernate.eclipse.presentation.hql"
+ label="HQL"/>
+
+ <fontDefinition
+ label="HQL editor text font"
+ defaultsTo="org.eclipse.jface.textfont"
+ categoryId="org.hibernate.eclipse.presentation.hql"
+ id="org.hibernate.eclipse.presentation.hql.textfont">
+ <description>
+ The HQL editor text font is used by HQL editors.
+ </description>
+ </fontDefinition>
+
+ </extension>
+ -->
+
+<!-- Do not expose the facet before the id's are stable
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <category id="org.hibernate.eclipse.facet.category">
+ <label>Hibernate Facet</label>
+ </category>
+ <project-facet id="org.hibernate.eclipse.facet.hibernate-core">
+ <label>Hibernate Core</label>
+ <description>Enables support for Hibernate</description>
+ </project-facet>
+ <project-facet-version
+ facet="org.hibernate.eclipse.facet.hibernate-core"
+ version="3.2.0.0">
+ <action type="install">
+ <delegate class="org.hibernate.eclipse.facet.HibernateCoreFacetInstallDelegate"/>
+ </action>
+ </project-facet-version>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <facet id="org.hibernate.eclipse.facet.hibernate-core"/>
+ <runtime-component any="true"/>
+ </supported>
+ </extension>
+ -->
+<!-- <extension
+ point="org.eclipse.ui.views">
+ <view
+ allowMultiple="false"
+ category="hibernatecategory"
+ class="org.hibernate.eclipse.console.views.navigator.KnownConfigurationsNaviagtor"
+ id="org.hibernate.eclipse.navigator.KnownConfigurationsViewer"
+ name="Hibernate Configurations"/>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.viewer">
+ <viewer viewerId="org.hibernate.eclipse.navigator.KnownConfigurationsViewer"/>
+ <viewerContentBinding viewerId="org.hibernate.eclipse.navigator.KnownConfigurationsViewer">
+ <includes>
+ <contentExtension
+ isRoot="true"
+ pattern="org.hibernate.eclipse.navigator.KnownConfigurationsContent"/>
+ </includes>
+ </viewerContentBinding>
+ <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
+ <includes>
+ <contentExtension pattern="org.hibernate.eclipse.navigator.KnownConfigurationsContent"/>
+ </includes>
+ </viewerContentBinding>
+ </extension>
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <navigatorContent
+ activeByDefault="true"
+ contentProvider="org.hibernate.eclipse.console.views.NavigatorProvider"
+ id="org.hibernate.eclipse.navigator.KnownConfigurationsContent"
+ labelProvider="org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider"
+ name="Hibernate Known Configurations">
+ <possibleChildren>
+ <instanceof value="java.lang.Object"/>
+ </possibleChildren>
+ </navigatorContent>
+ </extension>
+-->
+
+
+ <!--
+ <extension
+ point="org.eclipse.ui.themes">
+ <themeElementCategory
+ id="org.hibernate.eclipse.console.theme.HQLColors"
+ label="HQL Colors"/>
+ <colorDefinition
+ categoryId="org.hibernate.eclipse.console.theme.HQLColors"
+ id="HQL_KEYWORD"
+ isEditable="true"
+ label="HQL Keyword"
+ value="123,45,3">
+ <description>Color for a HQL keyword</description>
+ </colorDefinition>
+ </extension>
+-->
+</plugin>
15 years, 9 months
JBoss Tools SVN: r9468 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-08-01 08:44:08 -0400 (Fri, 01 Aug 2008)
New Revision: 9468
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
swallowing of exception was removed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-01 12:14:29 UTC (rev 9467)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-01 12:44:08 UTC (rev 9468)
@@ -1120,7 +1120,7 @@
selectionManager.setSelection(mouseEvent);
} catch (Exception e) {
-
+ VpePlugin.reportProblem(e);
} finally {
switcher.stopActiveEditor();
}
15 years, 9 months
JBoss Tools SVN: r9467 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: edit and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-08-01 08:14:29 -0400 (Fri, 01 Aug 2008)
New Revision: 9467
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDDirectEditPolicy.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDEditManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2589
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java 2008-08-01 10:44:13 UTC (rev 9466)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java 2008-08-01 12:14:29 UTC (rev 9467)
@@ -16,6 +16,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.swt.widgets.Display;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
@@ -288,7 +289,23 @@
* <!-- end-user-doc -->
* @generated NOT
*/
- public void nodeChanged(XModelTreeEvent event) {
+ public void nodeChanged(final XModelTreeEvent event) {
+ if(Display.getCurrent() != null){
+ nodeChangedInternal(event);
+ }else{
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run(){
+ nodeChangedInternal(event);
+ }
+ });
+ }
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ private void nodeChangedInternal(XModelTreeEvent event) {
if(getData() == null) return;
XModelObject diagramXML = (XModelObject)getData();
String newPath = event.getModelObject().getPath();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-01 10:44:13 UTC (rev 9466)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-01 12:14:29 UTC (rev 9467)
@@ -138,6 +138,9 @@
}else if (req.getType() == GraphicalPartFactory.REQ_INIT_EDIT) {
new ViewIDEditManager(this, new ViewIDEditorLocator(
(PageFigure) getFigure())).show();
+ }else if (req.getType() == RequestConstants.REQ_DIRECT_EDIT) {
+ new ViewIDEditManager(this, new ViewIDEditorLocator(
+ (PageFigure) getFigure()), true).show();
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDDirectEditPolicy.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDDirectEditPolicy.java 2008-08-01 10:44:13 UTC (rev 9466)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDDirectEditPolicy.java 2008-08-01 12:14:29 UTC (rev 9467)
@@ -12,10 +12,18 @@
import java.util.Properties;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.editpolicies.DirectEditPolicy;
import org.eclipse.gef.requests.DirectEditRequest;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.jst.web.model.ReferenceObject;
+import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
+import org.jboss.tools.seam.pages.xml.model.handlers.RenameViewSupport;
+import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesDiagramHelper;
+import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesDiagramStructureHelper;
+import org.jboss.tools.seam.ui.pages.SeamUiPagesPlugin;
import org.jboss.tools.seam.ui.pages.editor.commands.AddExceptionOnDiagramHandler;
import org.jboss.tools.seam.ui.pages.editor.commands.AddPageOnDiagramHandler;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
@@ -27,12 +35,16 @@
/**
* @see DirectEditPolicy#getDirectEditCommand(DirectEditRequest)
*/
- protected Command getDirectEditCommand(DirectEditRequest edit) {
- String labelText = (String) edit.getCellEditor().getValue();
+ protected Command getDirectEditCommand(DirectEditRequest request) {
+ String labelText = (String) request.getCellEditor().getValue();
PagesEditPart node = (PagesEditPart) getHost();
PagesElement element = node.getElementModel();
if (element != null) {
- return new FlowNameCommand(element, labelText);
+ Object rename = request.getExtendedData().get("rename");
+ if(rename != null && rename instanceof Boolean && ((Boolean)rename).booleanValue())
+ return new RenameViewCommand(element, labelText);
+ else
+ return new InitViewCommand(element, labelText);
}
return null;
}
@@ -43,13 +55,13 @@
protected void showCurrentEditValue(DirectEditRequest request) {
}
- public class FlowNameCommand extends Command {
+ public class InitViewCommand extends Command {
PagesElement node;
String value;
XModelObject object;
- public FlowNameCommand(PagesElement node, String value) {
+ public InitViewCommand(PagesElement node, String value) {
this.node = node;
this.value = value;
object = (XModelObject)node.getPagesModel().getData();
@@ -80,5 +92,48 @@
AddExceptionOnDiagramHandler.createException(object, value, props);
}
}
+
+ public class RenameViewCommand extends Command {
+ PagesElement node;
+ String value;
+ XModelObject object;
+ String oldValue;
+
+ public RenameViewCommand(PagesElement node, String value) {
+ this.node = node;
+ this.value = value;
+ object = (XModelObject)node.getData();
+ oldValue = object.getAttributeValue(SeamPagesConstants.ATTR_PATH);
+ }
+
+ public boolean canExecute() {
+ ViewIDValidator val = new ViewIDValidator(object);
+ String message = val.isValid(value);
+
+ if (message == null || "".equals(message))
+ return true;
+ return false;
+ }
+
+ public boolean canUndo() {
+ return false;
+ }
+
+ public void execute() {
+ if(node instanceof Page && object instanceof ReferenceObject){
+ SeamPagesDiagramHelper h = SeamPagesDiagramHelper.getHelper(SeamPagesDiagramStructureHelper.instance.getDiagram(object));
+ h.addUpdateLock(this);
+ try{
+ RenameViewSupport.replace((ReferenceObject)object, oldValue, value);
+ }catch(XModelException ex){
+ SeamUiPagesPlugin.log(ex);
+ } finally {
+ h.removeUpdateLock(this);
+ h.updateDiagram();
+ }
+ }
+
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDEditManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDEditManager.java 2008-08-01 10:44:13 UTC (rev 9466)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ViewIDEditManager.java 2008-08-01 12:14:29 UTC (rev 9467)
@@ -13,9 +13,11 @@
import java.text.MessageFormat;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.draw2d.ColorConstants;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.editparts.ZoomListener;
import org.eclipse.gef.editparts.ZoomManager;
+import org.eclipse.gef.requests.DirectEditRequest;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.jface.action.IAction;
@@ -57,18 +59,38 @@
}
};
- XModelObject target;
+ private XModelObject target;
+
+ private boolean rename = false;
public ViewIDEditManager(GraphicalEditPart source, CellEditorLocator locator) {
super(source, null, locator);
target = (XModelObject) ((PagesDiagramEditPart) source.getParent())
.getPagesModel().getData();
}
+
+ public ViewIDEditManager(GraphicalEditPart source, CellEditorLocator locator, boolean rename) {
+ this(source, locator);
+ this.rename = rename;
+ }
+
+ /**
+ * Creates and returns the DirectEditRequest.
+ * @return the direct edit request
+ */
+ protected DirectEditRequest createDirectEditRequest() {
+ DirectEditRequest req = super.createDirectEditRequest();
+ if(rename){
+ req.getExtendedData().put("rename", new Boolean(true));
+ }
+ return req;
+ }
/**
* @see org.eclipse.gef.tools.DirectEditManager#bringDown()
*/
protected void bringDown() {
+ if(getEditPart().getParent() == null)return;
ZoomManager zoomMgr = (ZoomManager) getEditPart().getViewer()
.getProperty(ZoomManager.class.toString());
if (zoomMgr != null)
@@ -89,7 +111,8 @@
PagesElement element = ((PagesEditPart) getEditPart())
.getElementModel();
- element.setParent(null);
+ if(!rename)
+ element.setParent(null);
}
protected CellEditor createCellEditorOn(Composite composite) {
@@ -127,6 +150,7 @@
protected Control createControl(Composite parent) {
Control control = super.createControl(parent);
+ control.setBackground(ColorConstants.white);
setErrorMessage("");
return control;
}
15 years, 9 months
JBoss Tools SVN: r9466 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-08-01 06:44:13 -0400 (Fri, 01 Aug 2008)
New Revision: 9466
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
Log:
Fix NullPointerException.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2008-08-01 09:22:16 UTC (rev 9465)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2008-08-01 10:44:13 UTC (rev 9466)
@@ -93,8 +93,10 @@
if (file != null) {
final String findString = ElService.getInstance().reverseReplace(file, node.getNodeValue());
-
- start = pageContext.getSourceBuilder().getStructuredTextViewer().getTextWidget().getText().indexOf(findString);
+
+ if ((findString != null) && (pageContext.getSourceBuilder().getStructuredTextViewer().getTextWidget().getText() != null)) {
+ start = pageContext.getSourceBuilder().getStructuredTextViewer().getTextWidget().getText().indexOf(findString);
+ }
}
}
pageContext.getSourceBuilder().getStructuredTextViewer().setSelectedRange(start + offset, length);
@@ -202,8 +204,8 @@
//gets visual selection range
Point sourceRange = new Point(0, 0);
//converts to source selection
- sourceRange.x = TextUtil.sourcePosition(sourceNode.getNodeValue(), focusedNode.getNodeValue(), selection.getFocusOffset());
- sourceRange.y = TextUtil.sourcePosition(sourceNode.getNodeValue(), focusedNode.getNodeValue(), selection.getAnchorOffset())-sourceRange.x;
+ sourceRange.x = TextUtil.sourcePosition(sourceNode.getNodeValue(), focusedNode.getNodeValue(), selection.getFocusOffset());
+ sourceRange.y = TextUtil.sourcePosition(sourceNode.getNodeValue(), focusedNode.getNodeValue(), selection.getAnchorOffset())-sourceRange.x;
return sourceRange;
}
15 years, 9 months
JBoss Tools SVN: r9465 - trunk/documentation/movies/index/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-08-01 05:22:16 -0400 (Fri, 01 Aug 2008)
New Revision: 9465
Modified:
trunk/documentation/movies/index/en/master.xml
Log:
JBDS-352- correcting index page, adding a new movie name
Modified: trunk/documentation/movies/index/en/master.xml
===================================================================
--- trunk/documentation/movies/index/en/master.xml 2008-08-01 09:14:04 UTC (rev 9464)
+++ trunk/documentation/movies/index/en/master.xml 2008-08-01 09:22:16 UTC (rev 9465)
@@ -42,6 +42,13 @@
</primaryie>
</indexentry>
+ <indexentry>
+ <primaryie>
+ <ulink url="demos/HQL_JPA-QL_queries/HQL_JPA-QL_queries.htm">Edit and run HQL/JPA-QL queries.</ulink>
+ </primaryie>
+ </indexentry>
+
+
<!--indexentry>
<primaryie>Visual Web Tools Reference Guide <ulink url="en/jsf/html/index.html"
>(html)</ulink>
15 years, 9 months
JBoss Tools SVN: r9464 - trunk/documentation/movies/cust_tag_lib_to_palette.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-01 05:14:04 -0400 (Fri, 01 Aug 2008)
New Revision: 9464
Modified:
trunk/documentation/movies/cust_tag_lib_to_palette/cust_tag_lib_to_palette.htm
Log:
https://jira.jboss.org/jira/browse/JBDS-348 - adding styles
Modified: trunk/documentation/movies/cust_tag_lib_to_palette/cust_tag_lib_to_palette.htm
===================================================================
--- trunk/documentation/movies/cust_tag_lib_to_palette/cust_tag_lib_to_palette.htm 2008-08-01 03:09:10 UTC (rev 9463)
+++ trunk/documentation/movies/cust_tag_lib_to_palette/cust_tag_lib_to_palette.htm 2008-08-01 09:14:04 UTC (rev 9464)
@@ -1,6 +1,16 @@
-<!-- saved from url=(0014)about:internet -->
+
<HTML>
+<head>
+<link rel="stylesheet" href="../resources/tools.css" type="text/css"/>
+<link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+</head>
+
<BODY>
+<div class="book">
+<p id="title"><a href="http://www.jboss.org" class="site_href">
+<strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+<strong >Community Demos</strong></a></p>
+
<center><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH="898" HEIGHT="618" CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=7,0,0,0">
<PARAM NAME=movie VALUE="cust_tag_lib_to_palette.swf">
<PARAM NAME=play VALUE=true>
@@ -10,6 +20,8 @@
<EMBED SRC="cust_tag_lib_to_palette.swf" WIDTH=898 HEIGHT=618 quality=low loop=false wmode=transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=Sh...">
</EMBED>
</OBJECT></center>
+</div>
+
<SCRIPT src='cust_tag_lib_to_palette.js'></script>
</BODY>
</HTML>
15 years, 9 months
JBoss Tools SVN: r9463 - in workspace/Denny/org.jboss.tools.esb.editor: .settings and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-07-31 23:09:10 -0400 (Thu, 31 Jul 2008)
New Revision: 9463
Added:
workspace/Denny/org.jboss.tools.esb.editor/.classpath
workspace/Denny/org.jboss.tools.esb.editor/.project
workspace/Denny/org.jboss.tools.esb.editor/.settings/
workspace/Denny/org.jboss.tools.esb.editor/.settings/org.eclipse.jdt.core.prefs
workspace/Denny/org.jboss.tools.esb.editor/META-INF/
workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF
workspace/Denny/org.jboss.tools.esb.editor/build.properties
workspace/Denny/org.jboss.tools.esb.editor/icons/
workspace/Denny/org.jboss.tools.esb.editor/icons/sample.gif
workspace/Denny/org.jboss.tools.esb.editor/plugin.xml
workspace/Denny/org.jboss.tools.esb.editor/src/
workspace/Denny/org.jboss.tools.esb.editor/src/org/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/Activator.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/DeploymentFormPage.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedEditor.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedPageEditorContributor.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueueDetailsPage.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueuePage.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/QueueServiceBlock.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/models/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/models/QueueService.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizard.java
workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizardPage.java
Log:
prototype of esb project wizard and editor(GUI)
Added: workspace/Denny/org.jboss.tools.esb.editor/.classpath
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/.classpath (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/.classpath 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/Denny/org.jboss.tools.esb.editor/.project
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/.project (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/.project 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.esb.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/Denny/org.jboss.tools.esb.editor/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/.settings/org.eclipse.jdt.core.prefs 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,7 @@
+#Fri Jul 25 11:13:35 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Editor Plug-in
+Bundle-SymbolicName: org.jboss.tools.esb.editor; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.esb.editor.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.jface.text,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.ide,
+ org.jboss.tools.esb.ui;bundle-version="2.0.0",
+ org.jboss.tools.jst.web.ui;bundle-version="2.0.0",
+ org.jboss.tools.common.text.ext;bundle-version="2.0.0",
+ org.jboss.tools.common.model;bundle-version="2.0.0",
+ org.eclipse.ui.forms;bundle-version="3.3.100"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.jboss.tools.common.model.ui.forms
Added: workspace/Denny/org.jboss.tools.esb.editor/build.properties
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/build.properties (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/build.properties 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/
Added: workspace/Denny/org.jboss.tools.esb.editor/icons/sample.gif
===================================================================
(Binary files differ)
Property changes on: workspace/Denny/org.jboss.tools.esb.editor/icons/sample.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/Denny/org.jboss.tools.esb.editor/plugin.xml
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/plugin.xml (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/plugin.xml 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ name="ESB Compound Editor"
+ extensions="xml"
+ icon="icons/sample.gif "
+ contributorClass="org.jboss.tools.esb.editor.editors.ESBComposedPageEditorContributor"
+ class="org.jboss.tools.esb.editor.editors.ESBComposedEditor"
+ id="org.jboss.tools.esb.editor.editors.ESBComposedEditor">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ name="Sample Wizards"
+ id="org.jboss.tools.esb.editor">
+ </category>
+ <wizard
+ name="Multi-page Editor file"
+ icon="icons/sample.gif"
+ category="org.jboss.tools.esb.editor"
+ class="org.jboss.tools.esb.editor.wizards.SampleNewWizard"
+ id="org.jboss.tools.esb.editor.wizards.SampleNewWizard">
+ </wizard>
+ </extension>
+
+</plugin>
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/Activator.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/Activator.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/Activator.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,61 @@
+package org.jboss.tools.esb.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.esb.editor";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/DeploymentFormPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/DeploymentFormPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/DeploymentFormPage.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,94 @@
+package org.jboss.tools.esb.editor.editors;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+
+public class DeploymentFormPage extends FormPage {
+
+ public DeploymentFormPage(FormEditor editor, String id, String title, IFile deployment) {
+ super(editor, id, title);
+ }
+
+
+ protected void createFormContent(IManagedForm managedForm) {
+ ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Deployment"); //$NON-NLS-1$
+ //form.setBackgroundImage(FormArticlePlugin.getDefault().getImage(FormArticlePlugin.IMG_FORM_BG));
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ form.getBody().setLayout(layout);
+
+ Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR );
+ section.setText("JBOSS ESB Deployment");
+ Composite details = toolkit.createComposite(section);
+ details.setLayout(new GridLayout(2, false));
+ createDepends(toolkit,details);
+
+ section.setClient(details);
+
+ }
+
+ private void createDepends(FormToolkit toolkit, Composite details){
+
+
+
+ Table dependsTable = new Table(details, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION);
+ dependsTable.setLinesVisible(true);
+ dependsTable.setHeaderVisible(true);
+ String[] titles = { "ID", "Message Type", "Name"};
+ for (int i = 0; i < titles.length; i++) {
+ TableColumn column = new TableColumn(dependsTable, SWT.NONE);
+ column.setText(titles[i]);
+ }
+
+
+ TableItem item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(0, "jboss.esb.quickstart.destination");
+ item.setText(1, "Queue");
+ item.setText(2, "quickstart_helloworld_Request_esb");
+
+
+ item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(0, "jboss.esb.quickstart.destination");
+ item.setText(1, "Queue");
+ item.setText(2, "quickstart_helloworld_Request_gw");
+
+
+
+ for (int i = 0; i < titles.length; i++) {
+ dependsTable.getColumn(i).pack();
+ }
+ dependsTable.setSize(dependsTable.computeSize(SWT.DEFAULT, 100));
+ details.pack();
+
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.verticalSpan = 2;
+ dependsTable.setLayoutData(gd);
+ Button btnNew = toolkit.createButton(details, "New", SWT.NONE);
+ btnNew.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_END));
+ Button btnRemove = toolkit.createButton(details, "Remove", SWT.NONE);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+ btnRemove.setLayoutData(gd);
+
+
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedEditor.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedEditor.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedEditor.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,170 @@
+package org.jboss.tools.esb.editor.editors;
+
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.editors.text.TextEditor;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.internal.part.NullEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.web.ui.editors.WebCompoundEditor;
+
+/**
+ * An example showing how to create a multi-page editor.
+ * This example has 3 pages:
+ * <ul>
+ * <li>page 0 contains a nested text editor.
+ * <li>page 1 allows you to change the font used in page 2
+ * <li>page 2 shows the words in page 0 in sorted order
+ * </ul>
+ */
+public class ESBComposedEditor extends FormEditor {
+
+ @Override
+ protected void addPages() {
+ createDeploymentPage();
+ //createPage0();
+ createESBPage();
+
+ createMessagePage();
+ createTextPages();
+ }
+
+ private void createESBPage(){
+ WebCompoundEditor esbEditor = new WebCompoundEditor();
+ try {
+ int esbIndex = addPage(esbEditor, getEditorInput());
+ setPageText(esbIndex, "JBoss ESB");
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private void createDeploymentPage() {
+ DeploymentFormPage page = new DeploymentFormPage(this, "deploy", "Deployment", null);
+ int dindex;
+ try {
+ dindex = this.addPage(page);
+ setPageText(dindex, "Deployment");
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ private void createMessagePage(){
+ try {
+ int index = addPage(new MessageQueuePage(this));
+ setPageText(index, "Message");
+
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private void createTextPages(){
+ try {
+ int index = addPage(new TextEditor(), getDeploymentInput());
+ setPageText(index, "deployment.xml");
+
+ index = addPage(new TextEditor(), getMessageInput());
+ setPageText(index, "queue-service.xml");
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private IEditorInput getMessageInput(){
+ FileEditorInput fileInput = (FileEditorInput)getEditorInput();
+ IProject project = fileInput.getFile().getProject();
+ IFile messageFile = project.getFolder("ESBContent").getFile("queue-service.xml");
+ if(!messageFile.exists()){
+ createMessageQueueFile(messageFile);
+ }
+
+ return new FileEditorInput(messageFile);
+ }
+
+ private IEditorInput getDeploymentInput(){
+ FileEditorInput fileInput = (FileEditorInput)getEditorInput();
+ IProject project = fileInput.getFile().getProject();
+ IFile deployment = project.getFolder("ESBContent").getFolder("META-INF").getFile("deployment.xml");
+ if(!deployment.exists()){
+ createDeploymentFile(deployment);
+ }
+ return new FileEditorInput(deployment);
+ }
+
+ void createPage0() {
+ try {
+ TextEditor editor = new TextEditor();
+ int index = addPage(editor, getEditorInput());
+ setPageText(index, editor.getTitle());
+ } catch (PartInitException e) {
+ ErrorDialog.openError(
+ getSite().getShell(),
+ "Error creating nested text editor",
+ null,
+ e.getStatus());
+ }
+ }
+
+ private void createDeploymentFile(IFile file){
+ StringBuffer sb = new StringBuffer("<jbossesb-deployment>");
+ sb.append("\n");
+ sb.append("</jbossesb-deployment>");
+ try {
+ file.create(new ByteArrayInputStream(sb.toString().getBytes()) , true, null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ private void createMessageQueueFile(IFile file){
+ StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+ try {
+ file.create(new ByteArrayInputStream(sb.toString().getBytes()) , true, null);
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+
+
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void doSaveAs() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isSaveAsAllowed() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+
+
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedPageEditorContributor.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedPageEditorContributor.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/ESBComposedPageEditorContributor.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,108 @@
+package org.jboss.tools.esb.editor.editors;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+
+/**
+ * Manages the installation/deinstallation of global actions for multi-page editors.
+ * Responsible for the redirection of global actions to the active editor.
+ * Multi-page contributor replaces the contributors for the individual editors in the multi-page editor.
+ */
+public class ESBComposedPageEditorContributor extends MultiPageEditorActionBarContributor {
+ private IEditorPart activeEditorPart;
+ private Action sampleAction;
+ /**
+ * Creates a multi-page contributor.
+ */
+ public ESBComposedPageEditorContributor() {
+ super();
+ createActions();
+ }
+ /**
+ * Returns the action registed with the given text editor.
+ * @return IAction or null if editor is null.
+ */
+ protected IAction getAction(ITextEditor editor, String actionID) {
+ return (editor == null ? null : editor.getAction(actionID));
+ }
+ /* (non-JavaDoc)
+ * Method declared in AbstractMultiPageEditorActionBarContributor.
+ */
+
+ public void setActivePage(IEditorPart part) {
+ if (activeEditorPart == part)
+ return;
+
+ activeEditorPart = part;
+
+ IActionBars actionBars = getActionBars();
+ if (actionBars != null) {
+
+ ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
+
+ actionBars.setGlobalActionHandler(
+ ActionFactory.DELETE.getId(),
+ getAction(editor, ITextEditorActionConstants.DELETE));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.UNDO.getId(),
+ getAction(editor, ITextEditorActionConstants.UNDO));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.REDO.getId(),
+ getAction(editor, ITextEditorActionConstants.REDO));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.CUT.getId(),
+ getAction(editor, ITextEditorActionConstants.CUT));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.COPY.getId(),
+ getAction(editor, ITextEditorActionConstants.COPY));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.PASTE.getId(),
+ getAction(editor, ITextEditorActionConstants.PASTE));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.SELECT_ALL.getId(),
+ getAction(editor, ITextEditorActionConstants.SELECT_ALL));
+ actionBars.setGlobalActionHandler(
+ ActionFactory.FIND.getId(),
+ getAction(editor, ITextEditorActionConstants.FIND));
+ actionBars.setGlobalActionHandler(
+ IDEActionFactory.BOOKMARK.getId(),
+ getAction(editor, IDEActionFactory.BOOKMARK.getId()));
+ actionBars.updateActionBars();
+ }
+ }
+ private void createActions() {
+ sampleAction = new Action() {
+ public void run() {
+ MessageDialog.openInformation(null, "Editor Plug-in", "Sample Action Executed");
+ }
+ };
+ sampleAction.setText("Sample Action");
+ sampleAction.setToolTipText("Sample Action tool tip");
+ sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
+ }
+ public void contributeToMenu(IMenuManager manager) {
+ IMenuManager menu = new MenuManager("Editor &Menu");
+ manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
+ menu.add(sampleAction);
+ }
+ public void contributeToToolBar(IToolBarManager manager) {
+ manager.add(new Separator());
+ manager.add(sampleAction);
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueueDetailsPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueueDetailsPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueueDetailsPage.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,210 @@
+package org.jboss.tools.esb.editor.editors;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+
+public class MessageQueueDetailsPage extends FormPage implements IDetailsPage {
+
+ private IManagedForm mform;
+
+ public MessageQueueDetailsPage(FormEditor editor, String id, String title, IFile deployment) {
+ super(editor, id, title);
+ }
+
+ public MessageQueueDetailsPage(){
+ super("test", "Message");
+ }
+
+
+
+
+ public void createContents(Composite parent) {
+
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.topMargin = 5;
+ layout.leftMargin = 5;
+ layout.rightMargin = 2;
+ layout.bottomMargin = 2;
+ parent.setLayout(layout);
+
+ FormToolkit toolkit = mform.getToolkit();
+ Section s1 = toolkit.createSection(parent, Section.DESCRIPTION|Section.TITLE_BAR);
+ s1.marginWidth = 10;
+ s1.setText("Message Queue Details"); //$NON-NLS-1$
+ TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
+ td.grabHorizontal = true;
+ s1.setLayoutData(td);
+ Composite client = toolkit.createComposite(s1);
+ GridLayout glayout = new GridLayout();
+ glayout.marginWidth = glayout.marginHeight = 0;
+ client.setLayout(glayout);
+
+ Composite details = toolkit.createComposite(client);
+ details.setLayout(new GridLayout(2, false));
+ details.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Label lblName = toolkit.createLabel(details, "Name");
+ Text txtName = toolkit.createText(details, "quickstart_hibernate_action_Request_esb-0", SWT.BORDER);
+ txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ toolkit.createLabel(details, "Code");
+ Text txtcode = toolkit.createText(details, "org.jboss.mq.server.jmx.Queue", SWT.BORDER);
+ txtcode.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label lblattr = toolkit.createLabel(details, "Attributes:");
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ lblattr.setLayoutData(gd);
+
+ Composite tablecom = toolkit.createComposite(details);
+ tablecom.setLayout(new GridLayout(2, false));
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ tablecom.setLayoutData(gd);
+
+
+
+ Table dependsTable = new Table(tablecom, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION);
+ dependsTable.setLinesVisible(true);
+ dependsTable.setHeaderVisible(true);
+ String[] titles = { "Attribute", "Value"};
+ for (int i = 0; i < titles.length; i++) {
+ TableColumn column = new TableColumn(dependsTable, SWT.NONE);
+ column.setText(titles[i]);
+ }
+
+
+ TableItem item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(0, "RedeliveryDelay");
+ item.setText(1, "1000");
+
+ item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(0, "MaxDeliveryAttempts");
+ item.setText(1, "15");
+
+
+
+ for (int i = 0; i < titles.length; i++) {
+ dependsTable.getColumn(i).pack();
+ }
+ dependsTable.setSize(dependsTable.computeSize(SWT.DEFAULT, 100));
+ tablecom.pack();
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.verticalSpan = 2;
+ dependsTable.setLayoutData(gd);
+ Button btnNew = toolkit.createButton(tablecom, "New", SWT.NONE);
+ Button btnRemove = toolkit.createButton(tablecom, "Remove", SWT.NONE);
+
+ Label lblDepends = toolkit.createLabel(details, "Depends:");
+ gd = new GridData();
+ gd.horizontalSpan = 2;
+ lblDepends.setLayoutData(gd);
+ createDepends(toolkit, details);
+
+
+ s1.setClient(client);
+
+ }
+
+
+ private void createDepends(FormToolkit toolkit, Composite details){
+ Composite tablecom = toolkit.createComposite(details);
+ tablecom.setLayout(new GridLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ tablecom.setLayoutData(gd);
+
+
+
+ Table dependsTable = new Table(tablecom, SWT.MULTI | SWT.BORDER
+ | SWT.FULL_SELECTION);
+ dependsTable.setLinesVisible(true);
+ dependsTable.setHeaderVisible(true);
+ String[] titles = { "name", "Attribute", "Value"};
+ for (int i = 0; i < titles.length; i++) {
+ TableColumn column = new TableColumn(dependsTable, SWT.NONE);
+ column.setText(titles[i]);
+ }
+
+
+ TableItem item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(0, "jboss.messaging:service=ServerPeer");
+ item = new TableItem(dependsTable, SWT.NONE);
+ item.setText(1, "optional-attribute-name");
+ item.setText(2, "ServerPeer");
+
+
+
+
+
+ for (int i = 0; i < titles.length; i++) {
+ dependsTable.getColumn(i).pack();
+ }
+ dependsTable.setSize(dependsTable.computeSize(SWT.DEFAULT, 100));
+ tablecom.pack();
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.verticalSpan = 2;
+ dependsTable.setLayoutData(gd);
+ Button btnNew = toolkit.createButton(tablecom, "New", SWT.NONE);
+ Button btnRemove = toolkit.createButton(tablecom, "Remove", SWT.NONE);
+
+
+ }
+ public void commit(boolean onSave) {
+
+ // TODO Auto-generated method stub
+
+ }
+
+ public void initialize(IManagedForm form) {
+ this.mform = form;
+
+ }
+
+ public boolean isStale() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void refresh() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean setFormInput(Object input) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+
+
+
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueuePage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueuePage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/MessageQueuePage.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,28 @@
+package org.jboss.tools.esb.editor.editors;
+
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+public class MessageQueuePage extends FormPage {
+
+ public MessageQueuePage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ private QueueServiceBlock block;
+ public MessageQueuePage(FormEditor editor) {
+ super(editor, "Queue Service", "Queue Service Details"); //$NON-NLS-1$ //$NON-NLS-2$
+ block = new QueueServiceBlock(this);
+ }
+ protected void createFormContent(final IManagedForm managedForm) {
+ final ScrolledForm form = managedForm.getForm();
+ //FormToolkit toolkit = managedForm.getToolkit();
+ form.setText("Message Queue Configuration"); //$NON-NLS-1$
+
+ block.createContent(managedForm);
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/QueueServiceBlock.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/QueueServiceBlock.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/editors/QueueServiceBlock.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,171 @@
+package org.jboss.tools.esb.editor.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.DetailsPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.MasterDetailsBlock;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.jboss.tools.esb.editor.models.QueueService;
+
+public class QueueServiceBlock extends MasterDetailsBlock {
+
+ private FormPage page;
+ public QueueServiceBlock(FormPage page) {
+ this.page = page;
+ }
+
+ class MasterContentProvider implements ITreeContentProvider {
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List){
+ return ((List)inputElement).toArray();
+ }
+ return new Object[]{inputElement};
+ }
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof List){
+ return ((List)parentElement).toArray();
+ }
+ return new Object[0];
+
+ }
+ public Object getParent(Object element) {
+ return null;
+ }
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+ }
+ class MasterLabelProvider implements
+ ILabelProvider {
+
+ public Image getImage(Object element) {
+ if (element instanceof List) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_ELEMENT);
+ }
+ if (element instanceof QueueService) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FILE);
+ }
+ return null;
+ }
+ public String getText(Object element) {
+ if(element instanceof List){
+ return "Queue Services";
+ }else if(element instanceof QueueService){
+ return ((QueueService)element).getQueueServiceName();
+ }
+ return "";
+ }
+ public void addListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+ public boolean isLabelProperty(Object element, String property) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+ public void removeListener(ILabelProviderListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+ }
+
+
+ protected void createMasterPart(final IManagedForm managedForm,
+ Composite parent) {
+ //final ScrolledForm form = managedForm.getForm();
+ FormToolkit toolkit = managedForm.getToolkit();
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR);
+ section.setText("Queue-Service"); //$NON-NLS-1$
+
+ section.marginWidth = 10;
+ section.marginHeight = 5;
+ Composite client = toolkit.createComposite(section, SWT.WRAP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginWidth = 2;
+ layout.marginHeight = 2;
+ client.setLayout(layout);
+
+ final SectionPart spart = new SectionPart(section);
+ managedForm.addPart(spart);
+ TreeViewer viewer = new TreeViewer(client, SWT.BORDER);
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ managedForm.fireSelectionChanged(spart, event.getSelection());
+ }
+ });
+ Tree qTree = viewer.getTree();
+ TreeItem item = new TreeItem(qTree, SWT.NONE);
+ item.setText("Queue Services");
+
+ qTree.setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setContentProvider(new MasterContentProvider());
+ viewer.setLabelProvider(new MasterLabelProvider());
+
+ viewer.setInput(getQueueServices());
+ viewer.expandAll();
+ section.setClient(client);
+
+
+ }
+
+ private List<QueueService> getQueueServices(){
+ List<QueueService> queues = new ArrayList<QueueService>();
+ for(int i = 0; i < 5; i++){
+ QueueService queue = new QueueService();
+ queue.setCode("org.jboss.mq.server.jmx.Queue");
+ queue.setQueueServiceName("quickstart_hibernate_action_Request_esb-" + i);
+ queue.setName("jboss.esb.quickstart.destination:service=Queue,name=quickstart_hibernate_action_Request_esb-" + i);
+ queues.add(queue);
+ }
+
+ return queues;
+ }
+ protected void createToolBarActions(IManagedForm managedForm) {
+
+
+ }
+ protected void registerPages(DetailsPart detailsPart) {
+ detailsPart.registerPage(QueueService.class, new MessageQueueDetailsPage());
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/models/QueueService.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/models/QueueService.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/models/QueueService.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,68 @@
+package org.jboss.tools.esb.editor.models;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class QueueService {
+
+ String name;
+ String queueServiceName;
+ String code;
+ List<String> depends;
+ Map<String, String> attrMap;
+
+ public void setQueueServiceName(String queueServiceName) {
+ this.queueServiceName = queueServiceName;
+ }
+
+
+ public String getQueueServiceName(){
+ return this.queueServiceName;
+ }
+
+ public String getName(){
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setCode(String code){
+ this.code = code;
+ }
+
+ public String getCode(){
+ return this.code;
+ }
+
+ public void addDepends(String depend){
+
+ getDepends().add(depend);
+ }
+
+ public List<String> getDepends(){
+ if(depends == null){
+ depends = new ArrayList<String>();
+ }
+ return this.depends;
+ }
+
+ public void addAttribute(String name, String value){
+
+ this.getAttributes().put(name, value);
+
+
+ }
+
+ public Map<String, String> getAttributes(){
+ if(attrMap == null){
+ attrMap = new HashMap<String, String>();
+ }
+
+ return this.attrMap;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizard.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizard.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizard.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,150 @@
+package org.jboss.tools.esb.editor.wizards;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jface.operation.*;
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.CoreException;
+import java.io.*;
+import org.eclipse.ui.*;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * This is a sample new wizard. Its role is to create a new file
+ * resource in the provided container. If the container resource
+ * (a folder or a project) is selected in the workspace
+ * when the wizard is opened, it will accept it as the target
+ * container. The wizard creates one file with the extension
+ * "mpe". If a sample multi-page editor (also available
+ * as a template) is registered for the same extension, it will
+ * be able to open it.
+ */
+
+public class SampleNewWizard extends Wizard implements INewWizard {
+ private SampleNewWizardPage page;
+ private ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizard.
+ */
+ public SampleNewWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages() {
+ page = new SampleNewWizardPage(selection);
+ addPage(page);
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in
+ * the wizard. We will create an operation and run it
+ * using wizard as execution context.
+ */
+ public boolean performFinish() {
+ final String containerName = page.getContainerName();
+ final String fileName = page.getFileName();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException {
+ try {
+ doFinish(containerName, fileName, monitor);
+ } catch (CoreException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ };
+ try {
+ getContainer().run(true, false, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ Throwable realException = e.getTargetException();
+ MessageDialog.openError(getShell(), "Error", realException.getMessage());
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * The worker method. It will find the container, create the
+ * file if missing or just replace its contents, and open
+ * the editor on the newly created file.
+ */
+
+ private void doFinish(
+ String containerName,
+ String fileName,
+ IProgressMonitor monitor)
+ throws CoreException {
+ // create a sample file
+ monitor.beginTask("Creating " + fileName, 2);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource resource = root.findMember(new Path(containerName));
+ if (!resource.exists() || !(resource instanceof IContainer)) {
+ throwCoreException("Container \"" + containerName + "\" does not exist.");
+ }
+ IContainer container = (IContainer) resource;
+ final IFile file = container.getFile(new Path(fileName));
+ try {
+ InputStream stream = openContentStream();
+ if (file.exists()) {
+ file.setContents(stream, true, true, monitor);
+ } else {
+ file.create(stream, true, monitor);
+ }
+ stream.close();
+ } catch (IOException e) {
+ }
+ monitor.worked(1);
+ monitor.setTaskName("Opening file for editing...");
+ getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchPage page =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IDE.openEditor(page, file, true);
+ } catch (PartInitException e) {
+ }
+ }
+ });
+ monitor.worked(1);
+ }
+
+ /**
+ * We will initialize file contents with a sample text.
+ */
+
+ private InputStream openContentStream() {
+ String contents =
+ "This is the initial file contents for *.mpe file that should be word-sorted in the Preview page of the multi-page editor";
+ return new ByteArrayInputStream(contents.getBytes());
+ }
+
+ private void throwCoreException(String message) throws CoreException {
+ IStatus status =
+ new Status(IStatus.ERROR, "org.jboss.tools.esb.editor", IStatus.OK, message, null);
+ throw new CoreException(status);
+ }
+
+ /**
+ * We will accept the selection in the workbench to see if
+ * we can initialize from it.
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+}
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb.editor/src/org/jboss/tools/esb/editor/wizards/SampleNewWizardPage.java 2008-08-01 03:09:10 UTC (rev 9463)
@@ -0,0 +1,185 @@
+package org.jboss.tools.esb.editor.wizards;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+/**
+ * The "New" wizard page allows setting the container for the new file as well
+ * as the file name. The page will only accept file name without the extension
+ * OR with the extension that matches the expected one (mpe).
+ */
+
+public class SampleNewWizardPage extends WizardPage {
+ private Text containerText;
+
+ private Text fileText;
+
+ private ISelection selection;
+
+ /**
+ * Constructor for SampleNewWizardPage.
+ *
+ * @param pageName
+ */
+ public SampleNewWizardPage(ISelection selection) {
+ super("wizardPage");
+ setTitle("Multi-page Editor File");
+ setDescription("This wizard creates a new file with *.mpe extension that can be opened by a multi-page editor.");
+ this.selection = selection;
+ }
+
+ /**
+ * @see IDialogPage#createControl(Composite)
+ */
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 3;
+ layout.verticalSpacing = 9;
+ Label label = new Label(container, SWT.NULL);
+ label.setText("&Container:");
+
+ containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+ containerText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+
+ Button button = new Button(container, SWT.PUSH);
+ button.setText("Browse...");
+ button.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleBrowse();
+ }
+ });
+ label = new Label(container, SWT.NULL);
+ label.setText("&File name:");
+
+ fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ fileText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ dialogChanged();
+ }
+ });
+ initialize();
+ dialogChanged();
+ setControl(container);
+ }
+
+ /**
+ * Tests if the current workbench selection is a suitable container to use.
+ */
+
+ private void initialize() {
+ if (selection != null && selection.isEmpty() == false
+ && selection instanceof IStructuredSelection) {
+ IStructuredSelection ssel = (IStructuredSelection) selection;
+ if (ssel.size() > 1)
+ return;
+ Object obj = ssel.getFirstElement();
+ if (obj instanceof IResource) {
+ IContainer container;
+ if (obj instanceof IContainer)
+ container = (IContainer) obj;
+ else
+ container = ((IResource) obj).getParent();
+ containerText.setText(container.getFullPath().toString());
+ }
+ }
+ fileText.setText("new_file.mpe");
+ }
+
+ /**
+ * Uses the standard container selection dialog to choose the new value for
+ * the container field.
+ */
+
+ private void handleBrowse() {
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(
+ getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
+ "Select new file container");
+ if (dialog.open() == ContainerSelectionDialog.OK) {
+ Object[] result = dialog.getResult();
+ if (result.length == 1) {
+ containerText.setText(((Path) result[0]).toString());
+ }
+ }
+ }
+
+ /**
+ * Ensures that both text fields are set.
+ */
+
+ private void dialogChanged() {
+ IResource container = ResourcesPlugin.getWorkspace().getRoot()
+ .findMember(new Path(getContainerName()));
+ String fileName = getFileName();
+
+ if (getContainerName().length() == 0) {
+ updateStatus("File container must be specified");
+ return;
+ }
+ if (container == null
+ || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+ updateStatus("File container must exist");
+ return;
+ }
+ if (!container.isAccessible()) {
+ updateStatus("Project must be writable");
+ return;
+ }
+ if (fileName.length() == 0) {
+ updateStatus("File name must be specified");
+ return;
+ }
+ if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
+ updateStatus("File name must be valid");
+ return;
+ }
+ int dotLoc = fileName.lastIndexOf('.');
+ if (dotLoc != -1) {
+ String ext = fileName.substring(dotLoc + 1);
+ if (ext.equalsIgnoreCase("mpe") == false) {
+ updateStatus("File extension must be \"mpe\"");
+ return;
+ }
+ }
+ updateStatus(null);
+ }
+
+ private void updateStatus(String message) {
+ setErrorMessage(message);
+ setPageComplete(message == null);
+ }
+
+ public String getContainerName() {
+ return containerText.getText();
+ }
+
+ public String getFileName() {
+ return fileText.getText();
+ }
+}
\ No newline at end of file
15 years, 9 months
JBoss Tools SVN: r9462 - workspace/Denny.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-07-31 23:08:30 -0400 (Thu, 31 Jul 2008)
New Revision: 9462
Added:
workspace/Denny/org.jboss.tools.esb.editor/
Log:
Initial import.
15 years, 9 months
JBoss Tools SVN: r9461 - in workspace/Denny/org.jboss.tools.esb: META-INF and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-07-31 23:07:32 -0400 (Thu, 31 Jul 2008)
New Revision: 9461
Added:
workspace/Denny/org.jboss.tools.esb/.classpath
workspace/Denny/org.jboss.tools.esb/.project
workspace/Denny/org.jboss.tools.esb/META-INF/
workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF
workspace/Denny/org.jboss.tools.esb/bin/
workspace/Denny/org.jboss.tools.esb/build.properties
workspace/Denny/org.jboss.tools.esb/icons/
workspace/Denny/org.jboss.tools.esb/plugin.xml
workspace/Denny/org.jboss.tools.esb/schema/
workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd
workspace/Denny/org.jboss.tools.esb/src/
workspace/Denny/org.jboss.tools.esb/src/org/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/nature/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/nature/JBossESBProjectNature.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java
Log:
prototype of esb project(GUI)
Added: workspace/Denny/org.jboss.tools.esb/.classpath
===================================================================
--- workspace/Denny/org.jboss.tools.esb/.classpath (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/.classpath 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/Denny/org.jboss.tools.esb/.project
===================================================================
--- workspace/Denny/org.jboss.tools.esb/.project (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/.project 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.esb</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Esbproject Plug-in
+Bundle-SymbolicName: org.jboss.tools.esb;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.esb.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.pde.ui,
+ org.eclipse.pde.ui.templates,
+ org.eclipse.wst.common.project.facet.core,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.wst.web.ui,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.common.frameworks.ui,
+ org.eclipse.wst.common.core,
+ org.eclipse.wst.common.project.facet.ui,
+ org.eclipse.wst.server.ui,
+ org.eclipse.wst.web,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.wst.server.core,
+ org.eclipse.jst.server.core,
+ org.eclipse.jst.servlet.ui;bundle-version="1.1.200",
+ org.eclipse.jst.common.frameworks;bundle-version="1.1.200",
+ org.eclipse.jst.common.project.facet.core;bundle-version="1.3.0",
+ org.jboss.tools.esb.editor;bundle-version="1.0.0",
+ org.eclipse.jst.j2ee;bundle-version="1.1.200",
+ org.eclipse.jst.j2ee.web;bundle-version="1.1.200",
+ org.eclipse.jst.j2ee.core;bundle-version="1.1.200",
+ org.eclipse.jst.j2ee.ui;bundle-version="1.1.200"
+Eclipse-LazyStart: true
+Export-Package: org.jboss.tools.esb.projects.wizards.pages
Added: workspace/Denny/org.jboss.tools.esb/build.properties
===================================================================
--- workspace/Denny/org.jboss.tools.esb/build.properties (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/build.properties 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Added: workspace/Denny/org.jboss.tools.esb/plugin.xml
===================================================================
--- workspace/Denny/org.jboss.tools.esb/plugin.xml (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/plugin.xml 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension-point id="org.jboss.tools.esb.project.template" name="ESB Template" schema="schema/org.jboss.tools.esb.project.template.exsd"/>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ category="org.jboss.tools.esb.category1"
+ class="org.jboss.tools.esb.projects.wizards.ESBProjectCreationWizard"
+ id="JBoss.ESB.Project.Wizard"
+ name="ESB Project Wizard"
+ project="true">
+ </wizard>
+ <category
+ id="org.jboss.tools.esb.category1"
+ name="ESB Wizard">
+ </category>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <project-facet
+ id="jboss.esb">
+ <label>
+ JBoss ESB
+ </label>
+ </project-facet>
+ <project-facet-version
+ facet="jboss.esb"
+ version="4.2">
+ <action
+ facet="jboss.esb"
+ type="install"
+ version="4.2">
+ <delegate
+ class="org.jboss.tools.esb.JBossESBFacetInstallationDelegate">
+ </delegate>
+ <config-factory
+ class="org.jboss.tools.esb.JBossESBFacetInstallationConfig">
+ </config-factory>
+ </action>
+ </project-facet-version>
+ <project-facet-version
+ facet="jboss.esb"
+ version="4.3">
+ <action
+ facet="jboss.esb"
+ id="jboss.esb.install"
+ type="install"
+ version="4.3">
+ <delegate
+ class="org.jboss.tools.esb.JBossESBFacetInstallationDelegate">
+ </delegate>
+ <config-factory
+ class="org.jboss.tools.esb.JBossESBFacetInstallationConfig">
+ </config-factory>
+ </action>
+ </project-facet-version>
+ <template
+ id="template.jboss.esb">
+ <label>
+ label body text
+ </label>
+ <fixed
+ facet="jboss.esb">
+ </fixed>
+ <fixed
+ facet="jst.java">
+ </fixed>
+ </template>
+ </extension>
+ <extension
+ id="esbnature"
+ name="JBoss ESB Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.esb.projects.nature.JBossESBProjectNature">
+ </run>
+ </runtime>
+ <requires-nature
+ id="org.eclipse.wst.common.project.facet.core.nature">
+ </requires-nature>
+ </extension>
+ <extension
+ point="org.eclipse.ui.ide.projectNatureImages">
+ <image
+ icon="esbproject.image3"
+ id="org.jboss.esb.project.esbnature.image"
+ natureId="org.jboss.esb.project.esbnature">
+ </image>
+ </extension>
+ <extension
+ point="org.eclipse.wst.server.core.moduleTypes">
+ <moduleType
+ id="jboss.esb"
+ name="JBoss ESB Module">
+ </moduleType>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+ <wizard-pages
+ action="jboss.esb.install">
+ <page
+ class="org.jboss.tools.esb.projects.wizards.pages.ESBFacetInstallationPage">
+ </page>
+ </wizard-pages>
+ </extension>
+
+</plugin>
Added: workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd
===================================================================
--- workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,120 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.esb" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.esb" id="org.jboss.tools.esb.project.template" name="ESB Template"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <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="template">
+ <complexType>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="ESBversion" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </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>
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,50 @@
+package org.jboss.tools.esb;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "esbproject";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,7 @@
+package org.jboss.tools.esb;
+
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+public interface IJBossESBFacetDataModelProperties extends IActionConfigFactory {
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,25 @@
+package org.jboss.tools.esb;
+
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+
+public class JBossESBFacetInstallationConfig extends
+ FacetInstallDataModelProvider implements
+ IJBossESBFacetDataModelProperties {
+
+ public Object create() {
+ // TODO Auto-generated method stub
+ return DataModelFactory.createDataModel(this);
+
+ }
+
+ public Object getDefaultProperty(String propertyName) {
+ if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
+
+ return "jboss.esb";
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,61 @@
+package org.jboss.tools.esb;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.StringBufferInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+public class JBossESBFacetInstallationDelegate implements IDelegate {
+
+ private IDataModel model;
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ System.out.print(config);
+ IFile esbFile = null;
+ model = (IDataModel)config;
+ IFolder esbContent = project.getFolder("ESBContent");
+ if(!esbContent.exists()) {
+ esbContent.create(true, true, null);
+ }
+
+ esbContent.getFolder("lib").create(true, true, null);
+ esbContent.getFolder("META-INF").create(true, true, null);
+ esbFile = createJBossESBXML(esbContent.getFolder("META-INF"));
+
+ project.refreshLocal(IResource.DEPTH_ZERO, null);
+
+
+ //String prjName = model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ //IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
+
+
+ }
+
+ private IFile createJBossESBXML(IFolder folder) throws CoreException{
+ StringBuffer emptyESB = new StringBuffer();
+ emptyESB.append("<?xml version = \"1.0\" encoding = \"UTF-8\"?>");
+ emptyESB.append("\n");
+ emptyESB.append("<jbossesb xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs=\"5\">");
+ emptyESB.append("\n");
+ emptyESB.append("</jbossesb>");
+ IFile esbfile = folder.getFile("jboss-esb.xml");
+ esbfile.create(new ByteArrayInputStream(emptyESB.toString().getBytes()), true, null);
+
+ return esbfile;
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/nature/JBossESBProjectNature.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/nature/JBossESBProjectNature.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/nature/JBossESBProjectNature.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,29 @@
+package org.jboss.tools.esb.projects.nature;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+
+public class JBossESBProjectNature implements IProjectNature {
+
+ public void configure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void deconfigure() throws CoreException {
+ // TODO Auto-generated method stub
+
+ }
+
+ public IProject getProject() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setProject(IProject project) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,465 @@
+package org.jboss.tools.esb.projects.wizards;
+
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
+import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IPreset;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
+import org.eclipse.wst.web.internal.DelegateConfigurationElement;
+import org.eclipse.wst.web.ui.internal.Logger;
+import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
+
+public abstract class AbstractESBProjectCreationWizard extends ModifyFacetedProjectWizard implements INewWizard, IFacetProjectCreationDataModelProperties {
+
+ protected IDataModel model = null;
+ private final IFacetedProjectTemplate template;
+ private IWizardPage[] beginingPages;
+ private IConfigurationElement configurationElement;
+
+ public AbstractESBProjectCreationWizard(IDataModel model)
+ {
+ this.model = ( model == null ? createDataModel() : model );
+ this.template = getTemplate();
+
+ setFacetedProjectWorkingCopy((IFacetedProjectWorkingCopy)this.model.getProperty(FACETED_PROJECT_WORKING_COPY));
+ getFacetedProjectWorkingCopy().setFixedProjectFacets( this.template.getFixedProjectFacets() );
+ setDefaultPageImageDescriptor(getDefaultPageImageDescriptor());
+ setShowFacetsSelectionPage( false );
+ }
+
+ public AbstractESBProjectCreationWizard()
+ {
+ this( null );
+ }
+
+ public IDataModel getDataModel() {
+ return model;
+ }
+
+ protected abstract IDataModel createDataModel();
+
+ protected abstract ImageDescriptor getDefaultPageImageDescriptor();
+
+ protected abstract IFacetedProjectTemplate getTemplate();
+
+ /**
+ * Returns the first page that shows up before the facets page. If multiple pages are required,
+ * also override {@link #createBeginingPages()}.
+ *
+ * @return
+ */
+ protected abstract IWizardPage createFirstPage();
+
+ /**
+ * Subclasses should override to add more than one page before the facets page. If only one page
+ * is required, then use {@link #createFirstPage()}. The default implementation will return the
+ * result of {@link #createFirstPage()}.
+ *
+ * @return
+ */
+ protected IWizardPage[] createBeginingPages() {
+ return new IWizardPage[]{createFirstPage()};
+ }
+
+ public void addPages() {
+ beginingPages = createBeginingPages();
+ for (int i = 0; i < beginingPages.length; i++) {
+ addPage(beginingPages[i]);
+ }
+
+ super.addPages();
+
+ getFacetedProjectWorkingCopy().addListener
+ (
+ new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ facetSelectionChangedEvent();
+ }
+ },
+ IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED
+ );
+ }
+
+ public void createPageControls(Composite container) {
+ super.createPageControls(container);
+
+ final IPreset preset = this.template.getInitialPreset();
+ final IRuntime runtime = (IRuntime) model.getProperty( FACET_RUNTIME );
+
+ if( preset == null )
+ {
+ // If no preset is specified, select the runtime and it's default
+ // facets.
+
+ setRuntimeAndDefaultFacets( runtime );
+ }
+ else
+ {
+ // If preset is specified, select the runtime only if supports all
+ // of the facets included in the preset.
+
+ getFacetedProjectWorkingCopy().setSelectedPreset( preset.getId() );
+
+ boolean supports = false;
+
+ if( runtime != null )
+ {
+ supports = true;
+
+ for( Iterator itr = preset.getProjectFacets().iterator(); itr.hasNext(); )
+ {
+ final IProjectFacetVersion fv = (IProjectFacetVersion) itr.next();
+
+ if( ! runtime.supports( fv ) )
+ {
+ supports = false;
+ break;
+ }
+ }
+ }
+
+ if( supports )
+ {
+ getFacetedProjectWorkingCopy().setTargetedRuntimes( Collections.singleton( runtime ) );
+ }
+ else
+ {
+ model.setProperty( FACET_RUNTIME, null );
+ }
+ }
+
+ synchRuntimes();
+ }
+
+ public IWizardPage[] getPages() {
+ final IWizardPage[] base = super.getPages();
+ final IWizardPage[] pages = new IWizardPage[base.length + beginingPages.length];
+
+ for (int i = 0; i < beginingPages.length; i++) {
+ pages[i] = beginingPages[i];
+ }
+
+ System.arraycopy(base, 0, pages, beginingPages.length, base.length);
+
+ return pages;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ protected void synchRuntimes()
+ {
+ final Boolean[] suppressBackEvents = { Boolean.FALSE };
+
+ model.addListener(new IDataModelListener() {
+ public void propertyChanged(DataModelEvent event) {
+ if (IDataModel.VALUE_CHG == event.getFlag() || IDataModel.DEFAULT_CHG == event.getFlag()) {
+ if (FACET_RUNTIME.equals(event.getPropertyName())) {
+ if( ! suppressBackEvents[ 0 ].booleanValue() ) {
+ IRuntime runtime = (IRuntime) event.getProperty();
+ setRuntimeAndDefaultFacets( runtime );
+ }
+ }
+ }
+ }
+ });
+
+ getFacetedProjectWorkingCopy().addListener
+ (
+ new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ suppressBackEvents[ 0 ] = Boolean.TRUE;
+ model.setProperty(FACET_RUNTIME, getFacetedProjectWorkingCopy().getPrimaryRuntime());
+ suppressBackEvents[ 0 ] = Boolean.FALSE;
+ }
+ },
+ IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED
+ );
+ }
+
+ protected void setRuntimeAndDefaultFacets( final IRuntime runtime )
+ {
+ final IFacetedProjectWorkingCopy dm = getFacetedProjectWorkingCopy();
+
+ dm.setTargetedRuntimes( Collections.<IRuntime>emptySet() );
+
+ if( runtime != null )
+ {
+ final Set<IProjectFacetVersion> minFacets = new HashSet<IProjectFacetVersion>();
+
+ try
+ {
+ for( IProjectFacet f : dm.getFixedProjectFacets() )
+ {
+ minFacets.add( f.getLatestSupportedVersion( runtime ) );
+ }
+ }
+ catch( CoreException e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ dm.setProjectFacets( minFacets );
+
+ dm.setTargetedRuntimes( Collections.singleton( runtime ) );
+ }
+
+ dm.setSelectedPreset( FacetedProjectFramework.DEFAULT_CONFIGURATION_PRESET_ID );
+ }
+
+ public String getProjectName() {
+ return model.getStringProperty(IFacetProjectCreationDataModelProperties.FACET_PROJECT_NAME);
+ }
+
+ protected void performFinish(final IProgressMonitor monitor)
+
+ throws CoreException
+
+ {
+ monitor.beginTask("", 10); //$NON-NLS-1$
+ storeDefaultSettings();
+ try {
+ super.performFinish(new SubProgressMonitor(monitor, 8));
+
+ try {
+ getFacetProjectNotificationOperation().execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ String msg = e.getMessage();
+ if( msg == null ) msg = ""; //$NON-NLS-1$
+ final IStatus st = new Status( IStatus.ERROR, WSTWebUIPlugin.PLUGIN_ID, 0, msg, e );
+ throw new CoreException( st );
+ }
+ } finally {
+ monitor.done();
+ }
+ }
+
+ public boolean performFinish() {
+ if (super.performFinish() == false) {
+ return false;
+ }
+
+ try {
+ postPerformFinish();
+ } catch (InvocationTargetException e) {
+ Logger.logException(e);
+ }
+
+ return true;
+ }
+
+ /**
+ * <p>
+ * Override to return the final perspective ID (if any). The final perspective ID can be
+ * hardcoded by the subclass or determined programmatically (possibly using the value of a field
+ * on the Wizard's WTP Operation Data Model).
+ * </p>
+ * <p>
+ * The default implementation returns no perspective id unless overriden by product definition
+ * via the "wtp.project.final.perspective" property.
+ * </p>
+ *
+ * @return Returns the ID of the Perspective which is preferred by this wizard upon completion.
+ */
+
+ protected String getFinalPerspectiveID() {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * <p>
+ * The configuration element is saved to use when the wizard completes in order to change the
+ * current perspective using either (1) the value specified by {@link #getFinalPerspectiveID()}
+ * or (2) the value specified by the finalPerspective attribute in the Wizard's configuration
+ * element.
+ * </p>
+ *
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
+ * java.lang.String, java.lang.Object)
+ */
+ public final void setInitializationData(IConfigurationElement aConfigurationElement, String aPropertyName, Object theData) throws CoreException {
+ configurationElement = aConfigurationElement;
+ doSetInitializeData(aConfigurationElement, aPropertyName, theData);
+
+ }
+
+ /**
+ * <p>
+ * Override method for clients that wish to take advantage of the information provided by
+ * {@see #setInitializationData(IConfigurationElement, String, Object)}.
+ * </p>
+ *
+ * @param aConfigurationElement
+ * The configuration element provided from the templated method.
+ * @param aPropertyName
+ * The property name provided from the templated method.
+ * @param theData
+ * The data provided from the templated method.
+ */
+ protected void doSetInitializeData(IConfigurationElement aConfigurationElement, String aPropertyName, Object theData) {
+ // Default do nothing
+ }
+
+ /**
+ * <p>
+ * Returns the an id component used for Activity filtering.
+ * </p>
+ *
+ * <p>
+ * The Plugin ID is determined from the configuration element specified in
+ * {@see #setInitializationData(IConfigurationElement, String, Object)}.
+ * </p>
+ *
+ * @return Returns the plugin id associated with this wizard
+ */
+ public final String getPluginId() {
+ return (configurationElement != null) ? configurationElement.getDeclaringExtension().getNamespace() : ""; //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * <p>
+ * Invoked after the user has clicked the "Finish" button of the wizard. The default
+ * implementation will attempt to update the final perspective to the value specified by
+ * {@link #getFinalPerspectiveID() }
+ * </p>
+ *
+ * @throws InvocationTargetException
+ *
+ * @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#postPerformFinish()
+ */
+ protected void postPerformFinish() throws InvocationTargetException {
+ if (getFinalPerspectiveID() != null && getFinalPerspectiveID().length() > 0) {
+ final IConfigurationElement element = new DelegateConfigurationElement(configurationElement) {
+ public String getAttribute(String aName) {
+ if (aName.equals("finalPerspective")) { //$NON-NLS-1$
+ return getFinalPerspectiveID();
+ }
+ return super.getAttribute(aName);
+ }
+ };
+ BasicNewProjectResourceWizard.updatePerspective(element);
+ } else
+ BasicNewProjectResourceWizard.updatePerspective(configurationElement);
+
+ String projName = getProjectName();
+ BasicNewResourceWizard.selectAndReveal(ResourcesPlugin.getWorkspace().getRoot().getProject(projName), WSTWebUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
+ }
+
+ protected IDataModelOperation getFacetProjectNotificationOperation() {
+ return new DataModelPausibleOperationImpl(new AbstractDataModelOperation(this.model) {
+ public String getID() {
+ return AbstractESBProjectCreationWizard.class.getName();
+ }
+
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ return AbstractDataModelProvider.OK_STATUS;
+ }
+ });
+ }
+
+ /**
+ * Need to keep the model in sync with the UI. This method will pickup changes coming from the
+ * UI and push them into the model
+ */
+ protected void facetSelectionChangedEvent() {
+ Set actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
+ Iterator iterator = actions.iterator();
+ Set activeIds = new HashSet();
+ while (iterator.hasNext()) {
+ IFacetedProject.Action action = (IFacetedProject.Action) iterator.next();
+ String id = action.getProjectFacetVersion().getProjectFacet().getId();
+ activeIds.add(id);
+ }
+ // First handle all the actions tracked by IDataModels
+ FacetDataModelMap dataModelMap = (FacetDataModelMap) model.getProperty(FACET_DM_MAP);
+ iterator = dataModelMap.keySet().iterator();
+ while (iterator.hasNext()) {
+ String id = (String) iterator.next();
+ IDataModel configDM = (IDataModel) dataModelMap.get(id);
+ boolean active = activeIds.contains(id);
+ configDM.setBooleanProperty(IFacetDataModelProperties.SHOULD_EXECUTE, active);
+ activeIds.remove(id);
+ }
+ // Now handle the actions not tracked by IDataModels
+ FacetActionMap actionMap = (FacetActionMap) model.getProperty(FACET_ACTION_MAP);
+ actionMap.clear();
+ iterator = actions.iterator();
+ while (iterator.hasNext()) {
+ IFacetedProject.Action action = (IFacetedProject.Action) iterator.next();
+ String id = action.getProjectFacetVersion().getProjectFacet().getId();
+ if (activeIds.contains(id)) {
+ actionMap.add(action);
+ }
+ }
+ model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
+ }
+
+ protected void storeDefaultSettings() {
+ IWizardPage[] pages = getPages();
+ for (int i = 0; i < pages.length; i++)
+ storeDefaultSettings(pages[i], i);
+ }
+
+ /**
+ * Subclasses may override if they need to do something special when storing the default
+ * settings for a particular page.
+ *
+ * @param page
+ * @param pageIndex
+ */
+ protected void storeDefaultSettings(IWizardPage page, int pageIndex) {
+ if (page instanceof DataModelWizardPage)
+ ((DataModelWizardPage) page).storeDefaultSettings();
+ }
+
+
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,85 @@
+package org.jboss.tools.esb.projects.wizards;
+
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.project.facet.IProductConstants;
+import org.eclipse.wst.project.facet.ProductManager;
+import org.eclipse.wst.project.facet.SimpleWebFacetProjectCreationDataModelProvider;
+import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
+import org.jboss.tools.esb.projects.wizards.pages.ESBProjectTemplateWizardPage;
+import org.jboss.tools.esb.projects.wizards.pages.NewESBProjectWizardPage;
+import org.jboss.tools.esb.projects.wizards.pages.TemplagePackageNameWizardPage;
+
+public class ESBProjectCreationWizard extends AbstractESBProjectCreationWizard{
+
+ protected IDataModel createDataModel() {
+ return DataModelFactory.createDataModel(new JBossESBFacetProjectCreationDataModelProvider());
+ }
+
+ protected ImageDescriptor getDefaultPageImageDescriptor() {
+ return WSTWebUIPlugin.getDefault().getImageDescriptor("newwprj_wiz"); //$NON-NLS-1$
+ }
+
+ protected IFacetedProjectTemplate getTemplate() {
+ return ProjectFacetsManager.getTemplate("template.jboss.esb"); //$NON-NLS-1$
+ }
+
+ protected IWizardPage createFirstPage() {
+ return new NewESBProjectWizardPage(model, "first.page"); //$NON-NLS-1$
+ }
+
+ protected String getFinalPerspectiveID() {
+ return ProductManager.getProperty(IProductConstants.FINAL_PERSPECTIVE_STATICWEB);
+ }
+
+ protected IWizardPage[] createBeginingPages() {
+ return new IWizardPage[]{createFirstPage(), new ESBProjectTemplateWizardPage(this.model, "Templates"),
+ new TemplagePackageNameWizardPage(this.model, "Set Package Name")};
+ }
+
+
+ @Override
+ public void addPages() {
+ new NewESBProjectWizardPage(model, "first.page"); //$NON-NLS-1$
+
+ super.addPages();
+ }
+
+ @Override
+ public boolean performFinish() {
+
+ boolean rtn = super.performFinish();
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(this.getProjectName());
+ IFile esbFile = project.getFile("/ESBContent/META-INF/jboss-esb.xml");
+
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if(esbFile != null){
+ try {
+ IDE.openEditor(page, esbFile, "org.jboss.tools.esb.editor.editors.ESBComposedEditor", true);
+ } catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ return rtn;
+ }
+
+
+
+}
+
+
+
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,43 @@
+package org.jboss.tools.esb.projects.wizards;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
+import org.eclipse.jst.common.project.facet.JavaFacetUtils;
+import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.project.facet.ProductManager;
+
+public class JBossESBFacetProjectCreationDataModelProvider extends
+ FacetProjectCreationDataModelProvider {
+
+
+ public void init() {
+ super.init();
+
+ Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
+ requiredFacets.add(JavaFacetUtils.JAVA_FACET);
+ requiredFacets.add(ProjectFacetsManager.getProjectFacet("jboss.esb"));
+ setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
+
+ FacetDataModelMap map = (FacetDataModelMap) getProperty(FACET_DM_MAP);
+ IDataModel javaFacet = map.getFacetDataModel( JavaFacetUtils.JAVA_FACET.getId() );
+ javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, "src");
+ // If using optimized single root structure, set the output folder to "<content folder>/WEB-INF/classes"
+ /*if (ProductManager.shouldUseSingleRootStructure())
+ javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, webRoot+"/"+J2EEConstants.WEB_INF_CLASSES); //$NON-NLS-1$
+*/
+ }
+
+ public Object getDefaultProperty(String propertyName) {
+ if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
+
+ return "jboss.esb";
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,144 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetInstallDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
+import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
+import org.eclipse.wst.common.project.facet.ui.IWizardContext;
+import org.eclipse.wst.web.internal.ResourceHandler;
+import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
+import org.eclipse.wst.web.ui.internal.wizards.IWstWebUIContextIds;
+import org.jboss.tools.esb.IJBossESBFacetDataModelProperties;
+
+public class ESBFacetInstallationPage extends AbstractFacetWizardPage implements IFacetWizardPage, IJBossESBFacetDataModelProperties {
+
+ private Label configFolderLabel;
+ private Text configFolder;
+ private Label contextRootLabel;
+ private Text contextRoot;
+ private IDataModel model;
+
+ public ESBFacetInstallationPage() {
+ super( "simpleweb.facet.install.page"); //$NON-NLS-1$
+ setTitle("Install ESB Facet");
+ setDescription("Configure project structure");
+ }
+
+
+ protected Composite createTopLevelComposite(Composite parent) {
+ //setInfopopID(IWstWebUIContextIds.NEW_STATIC_WEB_PROJECT_PAGE3);
+ final Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(1, false));
+
+ createProjectGroup(composite);
+ createRuntimeGroup(composite);
+
+
+ //synchHelper.synchText(configFolder, CONTENT_DIR, null);
+ Dialog.applyDialogFont(parent);
+
+ return composite;
+ }
+
+ private void createProjectGroup(Composite parent){
+
+ Group prjGroup = new Group(parent, SWT.BORDER);
+ prjGroup.setText("Project Folders");
+ prjGroup.setLayout(new GridLayout(1, false));
+ prjGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+
+ this.contextRootLabel = new Label(prjGroup, SWT.NONE);
+ this.contextRootLabel.setText("Content Directory");
+ this.contextRootLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ this.contextRoot = new Text(prjGroup, SWT.BORDER);
+ this.contextRoot.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ this.contextRoot.setData("label", this.contextRootLabel); //$NON-NLS-1$
+ this.contextRoot.setText("ESBContent");
+ //synchHelper.synchText(contextRoot, CONTEXT_ROOT, new Control[]{contextRootLabel});
+
+ configFolderLabel = new Label(prjGroup, SWT.NONE);
+ configFolderLabel.setText("Java Source Sirectory");
+ configFolderLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ configFolder = new Text(prjGroup, SWT.BORDER);
+ configFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ configFolder.setData("label", configFolderLabel); //$NON-NLS-1$
+ configFolder.setText("src");
+ }
+
+ private void createRuntimeGroup(Composite parent){
+
+ Group runtimeGroup = new Group(parent, SWT.BORDER);
+ runtimeGroup.setText("ESB Runtime");
+ runtimeGroup.setLayout(new GridLayout(4, false));
+ runtimeGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Button btnServerSupplied = new Button(runtimeGroup, SWT.RADIO);
+
+ GridData gd = new GridData();
+
+ gd.horizontalSpan = 1;
+ btnServerSupplied.setLayoutData(gd);
+
+ Label lblServerSupplied = new Label(runtimeGroup, SWT.NONE);
+
+ lblServerSupplied.setText("Server supplied ESB Runtime");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ lblServerSupplied.setLayoutData(gd);
+
+ Button btnUserSupplied = new Button(runtimeGroup, SWT.RADIO);
+
+
+ Combo cmbRuntimes = new Combo(runtimeGroup, SWT.READ_ONLY);
+ cmbRuntimes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+
+
+ Button btnNew = new Button(runtimeGroup, SWT.NONE);
+ btnNew.setText("New");
+
+
+
+ }
+
+ private void fillMessageGroup(Composite parent){
+ Group messageGroup = new Group(parent, SWT.BORDER);
+ messageGroup.setText("Target Message Product");
+ messageGroup.setLayout(new GridLayout(1, false));
+ messageGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ }
+
+ public void setConfig(Object config) {
+ this.model = (IDataModel)config;
+ }
+
+
+ public void createControl(Composite parent) {
+
+ setControl(createTopLevelComposite(parent));
+ }
+
+
+ public Object create() throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+}
\ No newline at end of file
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,56 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+
+public class ESBProjectTemplateWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
+
+ public ESBProjectTemplateWizardPage(IDataModel model, String pageName) {
+ super(model, pageName);
+ }
+
+ @Override
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ top.setLayout(layout);
+
+ Button btnUseTemplate = new Button(top, SWT.CHECK);
+ btnUseTemplate.setText("Create a ESB Project use one of the templates");
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ btnUseTemplate.setLayoutData(gd);
+
+ Label lblAvailable = new Label(top, SWT.NONE);
+ lblAvailable.setText("Available templates:");
+ lblAvailable.setLayoutData(gd);
+
+
+ TreeViewer templates = new TreeViewer(top,SWT.BORDER);
+ templates.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Text txtDescription = new Text(top, SWT.READ_ONLY | SWT.BORDER);
+ txtDescription.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ return top;
+ }
+
+ @Override
+ protected String[] getValidationPropertyNames() {
+ return null;
+ }
+
+
+}
+
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,261 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
+import org.eclipse.wst.common.frameworks.internal.ui.NewProjectGroup;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IPreset;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.events.IProjectFacetsChangedEvent;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.common.project.facet.core.util.AbstractFilter;
+import org.eclipse.wst.common.project.facet.core.util.FilterEvent;
+import org.eclipse.wst.common.project.facet.core.util.IFilter;
+import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterEvent;
+import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
+import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
+import org.eclipse.wst.project.facet.ProductManager;
+import org.eclipse.wst.server.ui.ServerUIUtil;
+import org.eclipse.wst.web.internal.ResourceHandler;
+import org.eclipse.wst.web.internal.facet.RuntimePresetMappingRegistry;
+import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage.Messages;
+
+public class NewESBProjectWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
+
+ protected NewProjectGroup projectNameGroup;
+ protected Combo serverTargetCombo;
+ private final IFacetedProjectWorkingCopy fpjwc;
+ private final IFacetedProjectListener fpjwcListener;
+ protected IProjectFacet primaryProjectFacet = null;
+ protected Combo primaryVersionCombo = null;
+
+
+
+ public NewESBProjectWizardPage(IDataModel model, String pageName) {
+ super(model, pageName);
+
+ this.fpjwc = (IFacetedProjectWorkingCopy) this.model.getProperty( FACETED_PROJECT_WORKING_COPY );
+
+ this.fpjwcListener = new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ validatePage();
+ }
+ };
+
+ this.fpjwc.addListener( this.fpjwcListener, IFacetedProjectEvent.Type.VALIDATION_PROBLEMS_CHANGED );
+ }
+
+ @Override
+
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(top, getInfopopID());
+ top.setLayout(new GridLayout());
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+ createProjectGroup(top);
+ createServerTargetComposite(top);
+ createPrimaryFacetComposite(top);
+ //createPresetPanel(top);
+ return top;
+ }
+
+ protected void createPresetPanel(Composite top) {
+ final IFacetedProjectWorkingCopy fpjwc
+ = ( (ModifyFacetedProjectWizard) getWizard() ).getFacetedProjectWorkingCopy();
+
+ final IFilter<IPreset> filter = new AbstractFilter<IPreset>()
+ {
+ {
+ fpjwc.addListener
+ (
+ new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ handleProjectFacetsChangedEvent( (IProjectFacetsChangedEvent) event );
+ }
+ },
+ IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED
+ );
+ }
+
+ public boolean check( final IPreset preset )
+ {
+ return true;
+ }
+
+ private void handleProjectFacetsChangedEvent( final IProjectFacetsChangedEvent event )
+ {
+
+ }
+ };
+
+ final PresetSelectionPanel ppanel = new PresetSelectionPanel( top, fpjwc, filter );
+
+ ppanel.setLayoutData( gdhfill() );
+ }
+
+ protected static GridData gdhfill() {
+ return new GridData(GridData.FILL_HORIZONTAL);
+ }
+
+ protected void createServerTargetComposite(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText(ResourceHandler.TargetRuntime);
+ group.setLayoutData(gdhfill());
+ group.setLayout(new GridLayout(2, false));
+ serverTargetCombo = new Combo(group, SWT.BORDER | SWT.READ_ONLY);
+ serverTargetCombo.setLayoutData(gdhfill());
+ Button newServerTargetButton = new Button(group, SWT.NONE);
+ newServerTargetButton.setText(ResourceHandler.NewDotDotDot);
+
+ Control[] deps = new Control[]{newServerTargetButton};
+ synchHelper.synchCombo(serverTargetCombo, FACET_RUNTIME, deps);
+ if (serverTargetCombo.getSelectionIndex() == -1 && serverTargetCombo.getVisibleItemCount() != 0)
+ serverTargetCombo.select(0);
+ }
+
+ protected void createPrimaryFacetComposite(Composite top) {
+ primaryProjectFacet = ProjectFacetsManager.getProjectFacet( getModuleTypeID() );
+ if (primaryProjectFacet.getVersions().size() <= 1){
+ //there is no need to create this section if there is only one
+ //facet version to choose from (e.g. utility and static web)
+ return;
+ }
+
+ final Group group = new Group( top, SWT.NONE );
+ group.setLayoutData( gdhfill() );
+ group.setLayout( new GridLayout( 1, false ) );
+ group.setText( Messages.bind( Messages.FACET_VERSION, new Object [] {primaryProjectFacet.getLabel()}));
+
+ primaryVersionCombo = new Combo( group, SWT.BORDER | SWT.READ_ONLY );
+ primaryVersionCombo.setLayoutData( gdhfill() );
+ updatePrimaryVersions();
+
+ primaryVersionCombo.addSelectionListener
+ (
+ new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected( final SelectionEvent e )
+ {
+ //handlePrimaryFacetVersionSelectedEvent();
+ }
+ }
+ );
+
+ fpjwc.addListener(new IFacetedProjectListener() {
+ public void handleEvent(IFacetedProjectEvent event) {
+ if(event.getType() == IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED){
+ //this block is to update the combo when the underlying facet version changes
+ IProjectFacetsChangedEvent actionEvent = (IProjectFacetsChangedEvent)event;
+ Set<IProjectFacetVersion> changedVersions = actionEvent.getFacetsWithChangedVersions();
+
+ boolean foundComboVersion = false;
+ for(Iterator <IProjectFacetVersion> iterator = changedVersions.iterator(); iterator.hasNext() && !foundComboVersion;){
+ IProjectFacetVersion next = iterator.next();
+ if(next.getProjectFacet().equals(primaryProjectFacet)){
+ foundComboVersion = true;
+ final IProjectFacetVersion selectedVersion = next;
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ String selectedText = primaryVersionCombo.getItem(primaryVersionCombo.getSelectionIndex());
+ if(!selectedText.equals(selectedVersion.getVersionString())){
+ String [] items = primaryVersionCombo.getItems();
+ int selectedVersionIndex = -1;
+ for(int i=0;i<items.length && selectedVersionIndex == -1; i++){
+ if(items[i].equals(selectedVersion.getVersionString())){
+ selectedVersionIndex = i;
+ primaryVersionCombo.select(selectedVersionIndex);
+ }
+ }
+ }
+ }
+ });
+ }
+ }
+ } else if(event.getType() == IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED){
+ //this block updates the items in the combo when the runtime changes
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ updatePrimaryVersions();
+ }
+ });
+ }
+ }
+
+ }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
+ }
+
+ protected void createProjectGroup(Composite parent) {
+ IDataModel nestedProjectDM = model.getNestedModel(NESTED_PROJECT_DM);
+ nestedProjectDM.addListener(this);
+ projectNameGroup = new NewProjectGroup(parent, nestedProjectDM);
+ }
+
+ @Override
+ protected String[] getValidationPropertyNames() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getModuleTypeID(){
+ return "jboss.esb";
+ }
+
+ protected void updatePrimaryVersions(){
+ IProjectFacetVersion selectedVersion = fpjwc.getProjectFacetVersion(primaryProjectFacet);
+ SortedSet<IProjectFacetVersion> initialVersions = fpjwc.getAvailableVersions(primaryProjectFacet);
+ String [] items = new String[initialVersions.size()];
+ int i=0;
+ int selectedVersionIndex = -1;
+ for(Iterator <IProjectFacetVersion> iterator = initialVersions.iterator(); iterator.hasNext(); i++){
+ items[i] = iterator.next().getVersionString();
+ if(selectedVersionIndex == -1 && items[i].equals(selectedVersion.getVersionString())){
+ selectedVersionIndex = i;
+ }
+ }
+ primaryVersionCombo.clearSelection();
+ primaryVersionCombo.setItems(items);
+ primaryVersionCombo.select(selectedVersionIndex);
+ }
+
+
+}
+
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java 2008-08-01 03:07:32 UTC (rev 9461)
@@ -0,0 +1,44 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+
+public class TemplagePackageNameWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
+
+ public TemplagePackageNameWizardPage(IDataModel model, String pageName) {
+ super(model, pageName);
+ }
+
+ @Override
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ top.setLayout(layout);
+
+ Label lblPackage = new Label(top, SWT.NONE);
+ lblPackage.setText("Java Package Name:");
+
+ Text txtPkg = new Text(top, SWT.BORDER);
+ txtPkg.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return top;
+ }
+
+ @Override
+ protected String[] getValidationPropertyNames() {
+ return null;
+ }
+
+
+}
+
15 years, 9 months