JBoss Tools SVN: r16112 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-06-22 09:18:38 -0400 (Mon, 22 Jun 2009)
New Revision: 16112
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolverFactoryManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Errors in cycle variable usage fixed.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolverFactoryManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolverFactoryManager.java 2009-06-22 13:03:23 UTC (rev 16111)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolverFactoryManager.java 2009-06-22 13:18:38 UTC (rev 16112)
@@ -70,7 +70,7 @@
IExtension extension = extensions[i];
IConfigurationElement[] elements = extension.getConfigurationElements();
for(int j=0; j<elements.length; j++) {
- IConfigurationElement[] natures = elements[i].getChildren("project-nature"); //$NON-NLS-1$
+ IConfigurationElement[] natures = elements[j].getChildren("project-nature"); //$NON-NLS-1$
for (int k = 0; k < natures.length; k++) {
String natureId = natures[k].getAttribute("id"); //$NON-NLS-1$
try {
@@ -88,7 +88,7 @@
Activator.getPluginLog().logError(e);
}
}
- IConfigurationElement[] factories = elements[i].getChildren("factory"); //$NON-NLS-1$
+ IConfigurationElement[] factories = elements[j].getChildren("factory"); //$NON-NLS-1$
for (int k = 0; k < factories.length; k++) {
try {
Object factory = factories[k].createExecutableExtension("class"); //$NON-NLS-1$
15 years, 6 months
JBoss Tools SVN: r16111 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-06-22 09:03:23 -0400 (Mon, 22 Jun 2009)
New Revision: 16111
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
Log:
Rename Seam Context Variable https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-22 08:28:57 UTC (rev 16110)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameSeamContextVariableProcessor.java 2009-06-22 13:03:23 UTC (rev 16111)
@@ -24,6 +24,8 @@
import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamContextShortVariable;
+import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
@@ -91,23 +93,35 @@
return rootChange;
}
+ private boolean checked = false;
+
+ public String getOldName(){
+ if(!checked){
+ ISeamComponent component = checkComponent();
+ if(component != null){
+ setOldName(component.getName());
+ }
+ checked = true;
+ }
+ return super.getOldName();
+ }
+
private ISeamComponent checkComponent(){
IProject project = file.getProject();
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
if (seamProject != null) {
- return seamProject.getComponent(getOldName());
-// Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
-// for(ISeamComponent component : components){
-// ISeamJavaComponentDeclaration declaration = component.getJavaDeclaration();
-// if(declaration != null){
-// IResource resource = declaration.getResource();
-// if(resource != null && resource.getFullPath().equals(file.getFullPath())){
-// if(declaration.getName().equals(component.getName())){
-// return component;
-// }
-// }
-// }
-// }
+ ISeamComponent component = seamProject.getComponent(super.getOldName());
+ if(component != null)
+ return component;
+
+ Set<ISeamContextVariable> variables = seamProject.getVariablesByName(super.getOldName());
+ for(ISeamContextVariable variable : variables){
+ if(variable instanceof ISeamContextShortVariable){
+ ISeamContextVariable original = ((ISeamContextShortVariable)variable).getOriginal();
+ if(original instanceof ISeamComponent)
+ return (ISeamComponent)original;
+ }
+ }
}
return null;
}
15 years, 6 months
JBoss Tools SVN: r16110 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-22 04:28:57 -0400 (Mon, 22 Jun 2009)
New Revision: 16110
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
Log:
Cleaned up a bit
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2009-06-22 07:59:54 UTC (rev 16109)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModule.java 2009-06-22 08:28:57 UTC (rev 16110)
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.esb.core.module;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-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.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.internal.ModuleType;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.model.ModuleFactoryDelegate;
-import org.jboss.tools.esb.core.ESBProjectConstant;
-import org.jboss.tools.esb.core.ESBProjectCorePlugin;
-
-public class JBossESBModule implements IModule{
-
- private IProject project;
- private ModuleFactoryDelegate factory;
- private String factoryId;
- public JBossESBModule(IProject project, ModuleFactoryDelegate factory, String factoryId){
- this.project = project;
- this.factory = factory;
- this.factoryId = factoryId;
-
- }
- public Object getAdapter(Class adapter) {
- return null;
- }
-
- public String getId() {
- return factoryId + ":" + project.getName();
- }
-
- public IModuleType getModuleType() {
- IFacetedProject facetPrj;
- try {
- facetPrj = ProjectFacetsManager.create(project);
- if (facetPrj == null) {
- return null;
- }
- final IProjectFacet esbfacet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
- final IProjectFacetVersion fv = facetPrj.getInstalledVersion(esbfacet);
- return ModuleType.getModuleType(esbfacet.getId(), fv.getVersionString());
- } catch (CoreException e) {
- ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
- }
-
- return null;
- }
-
- public String getName() {
- return project.getName();
- }
-
- public IProject getProject() {
- return project;
- }
-
- public boolean isExternal() {
- return false;
- }
-
- public Object loadAdapter(Class adapter, IProgressMonitor monitor) {
- ModuleDelegate delegate = factory.getModuleDelegate(this);
- if(adapter.isInstance(delegate))
- return delegate;
- return null;
- }
-
- public boolean exists() {
- return false;
- }
-
-}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2009-06-22 07:59:54 UTC (rev 16109)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleFactory.java 2009-06-22 08:28:57 UTC (rev 16110)
@@ -10,11 +10,14 @@
******************************************************************************/
package org.jboss.tools.esb.core.module;
+import java.util.HashMap;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
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.server.core.IModule;
import org.eclipse.wst.server.core.internal.ModuleFactory;
@@ -23,9 +26,12 @@
import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.ESBProjectCorePlugin;
+import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
public class JBossESBModuleFactory extends ProjectModuleFactoryDelegate {
public static final String FACTORY_ID = "org.jboss.tools.esb.project.core.moduleFactory";
+ public static final String MODULE_TYPE = IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID;
+ public static final String MODULE_ID_PREFIX = IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID + ".";
private static ModuleFactory factory;
private static JBossESBModuleFactory factDelegate;
@@ -47,16 +53,21 @@
return factDelegate;
}
+
+ private HashMap<IModule, JBossESBModuleDelegate> moduleToDelegate;
public JBossESBModuleFactory() {
+ moduleToDelegate = new HashMap<IModule, JBossESBModuleDelegate>();
}
@Override
+ protected void clearCache(IProject project) {
+ super.clearCache(project);
+ moduleToDelegate.remove(project);
+ }
+
+ @Override
public ModuleDelegate getModuleDelegate(IModule module) {
- if (module instanceof JBossESBModule) {
- IProject project = module.getProject();
- return new JBossESBModuleDelegate(project);
- }
- return null;
+ return moduleToDelegate.get(module);
}
protected IModule[] createModules(IProject project) {
@@ -70,8 +81,14 @@
.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
if (facetProject.hasProjectFacet(esbFacet)) {
- JBossESBModule module = new JBossESBModule(project, this, this
- .getId());
+ IProjectFacetVersion version = facetProject.getProjectFacetVersion(esbFacet);
+ IModule module = createModule(
+ MODULE_ID_PREFIX + project.getName(),
+ project.getName(),
+ MODULE_TYPE,
+ version.getVersionString(),
+ project);
+ moduleToDelegate.put(module, new JBossESBModuleDelegate(project));
return new IModule[] { module };
}
} catch (CoreException e) {
15 years, 6 months
JBoss Tools SVN: r16109 - in trunk/as/plugins: org.jboss.ide.eclipse.as.wtp.override.core and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-22 03:59:54 -0400 (Mon, 22 Jun 2009)
New Revision: 16109
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.classpath
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.project
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.settings/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.settings/org.eclipse.jdt.core.prefs
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java
Log:
adding a wtp core overrides
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.classpath (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.classpath 2009-06-22 07:59:54 UTC (rev 16109)
@@ -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: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.project
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.project (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.project 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.ide.eclipse.as.wtp.override.core</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: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/.settings/org.eclipse.jdt.core.prefs 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,8 @@
+#Mon Jun 22 15:49:07 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WTP Overrides Core
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.wtp.override.core
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.ide.eclipse.as.wtp.override.core.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.server.core;bundle-version="1.1.101"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,50 @@
+package org.jboss.ide.eclipse.as.wtp.override.core;
+
+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.ide.eclipse.as.wtp.override.core";
+
+ // 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: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java 2009-06-22 07:59:54 UTC (rev 16109)
@@ -0,0 +1,23 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.modules;
+
+import org.eclipse.wst.server.core.IModule;
+
+
+public interface IChildModuleProvider {
+ /**
+ * Returns the modules contained within this module. The returned modules
+ * can be either modulecore projects or representations of binary jars
+ *
+ * @return a possibly empty array of modules contained within this application
+ */
+ public IModule[] getModules();
+
+ /**
+ * Returns the URI of the given module within this enterprise application.
+ *
+ * @param module a module within this application
+ * @return the URI of the given module, or <code>null</code> if the URI could
+ * not be found
+ */
+ public String getURI(IModule module);
+}
15 years, 6 months
JBoss Tools SVN: r16108 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common: ant/model/handlers and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-06-22 03:22:50 -0400 (Mon, 22 Jun 2009)
New Revision: 16108
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/CreateAntFileSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaBeanGenerator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaPropertyGenerator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/model/handler/CreateJavaFileHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XAction.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XActionInvoker.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/CompoundAdoptManager.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/AntEntityRecognizer.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -28,7 +28,7 @@
public String getEntityName(String ext, String body) {
if(body == null) return null;
- IContentType cd = Platform.getContentTypeManager().getContentType("org.eclipse.ant.core.antBuildFile");
+ IContentType cd = Platform.getContentTypeManager().getContentType("org.eclipse.ant.core.antBuildFile"); //$NON-NLS-1$
AntBuildfileContentDescriber d = new AntBuildfileContentDescriber();
int i = -1;
try {
@@ -39,7 +39,7 @@
} catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
- return i == 2 ? "FileANT" : null;
+ return i == 2 ? "FileANT" : null; //$NON-NLS-1$
// AntParser p = new AntParser(body);
// return (p.getTargets() != null) ? "FileANT" : null;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/CreateAntFileSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/CreateAntFileSupport.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/CreateAntFileSupport.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -16,11 +16,11 @@
protected String modifyBody(String body) {
if(body == null || body.length() == 0) {
- body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
- "<project basedir=\".\" default=\"build\">\n" +
- " <target name=\"build\">\n\n" +
- " </target>\n" +
- "</project>\n";
+ body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + //$NON-NLS-1$
+ "<project basedir=\".\" default=\"build\">\n" + //$NON-NLS-1$
+ " <target name=\"build\">\n\n" + //$NON-NLS-1$
+ " </target>\n" + //$NON-NLS-1$
+ "</project>\n"; //$NON-NLS-1$
}
return body;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/parser/AntParser.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -25,13 +25,13 @@
private String[] targets = null;
public AntParser(String body) {
- if(body == null || body.indexOf("<project") < 0) return;
+ if(body == null || body.indexOf("<project") < 0) return; //$NON-NLS-1$
Element element = XMLUtil.getElement(new StringReader(body));
if(element == null) return;
- if(!"project".equals(element.getNodeName())) return;
- if(element.hasAttribute("xmlns")) return;
- if(element.hasAttribute("xsi:schemaLocation")) return;
- NodeList es = element.getElementsByTagName("target");
+ if(!"project".equals(element.getNodeName())) return; //$NON-NLS-1$
+ if(element.hasAttribute("xmlns")) return; //$NON-NLS-1$
+ if(element.hasAttribute("xsi:schemaLocation")) return; //$NON-NLS-1$
+ NodeList es = element.getElementsByTagName("target"); //$NON-NLS-1$
for (int i = 0; i < es.getLength(); i++)
if(!((Element)es.item(i)).hasAttribute(XModelObjectConstants.ATTR_NAME)) return;
targets = new String[es.getLength()];
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaBeanGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaBeanGenerator.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaBeanGenerator.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -42,15 +42,15 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class JavaBeanGenerator {
- public static String PARAM_PACKAGENAME = "packageName";
- public static String PARAM_SHORTNAME = "shortName";
- public static String PARAM_ACCESS = "access";
- public static String PARAM_EXTENDS = "extends";
- public static String PARAM_IMPLEMENTS = "implements";
- public static String PARAM_INTERFACE = "interface";
+ public static String PARAM_PACKAGENAME = "packageName"; //$NON-NLS-1$
+ public static String PARAM_SHORTNAME = "shortName"; //$NON-NLS-1$
+ public static String PARAM_ACCESS = "access"; //$NON-NLS-1$
+ public static String PARAM_EXTENDS = "extends"; //$NON-NLS-1$
+ public static String PARAM_IMPLEMENTS = "implements"; //$NON-NLS-1$
+ public static String PARAM_INTERFACE = "interface"; //$NON-NLS-1$
- public static String ATT_CLASS_NAME = "class name";
- public static String ATT_ACCESS_MODIFIER = "access modifier";
+ public static String ATT_CLASS_NAME = "class name"; //$NON-NLS-1$
+ public static String ATT_ACCESS_MODIFIER = "access modifier"; //$NON-NLS-1$
protected XModelObject context;
protected Properties input;
@@ -75,20 +75,20 @@
if(srcpath == null) return;
String qclsname = input.getProperty(ATT_CLASS_NAME);
- String filepath = srcpath + XModelObjectConstants.SEPARATOR + qclsname.replace('.', '/') + ".java";
+ String filepath = srcpath + XModelObjectConstants.SEPARATOR + qclsname.replace('.', '/') + ".java"; //$NON-NLS-1$
if(new File(filepath).exists()) return;
int lastDot = qclsname.lastIndexOf('.');
Properties p = new Properties();
p.setProperty(PARAM_SHORTNAME, qclsname.substring(lastDot + 1));
- p.setProperty(PARAM_PACKAGENAME, (lastDot < 0) ? "" : qclsname.substring(0, lastDot));
+ p.setProperty(PARAM_PACKAGENAME, (lastDot < 0) ? "" : qclsname.substring(0, lastDot)); //$NON-NLS-1$
// String pkgname = (lastDot < 0) ? "" : qclsname.substring(0, lastDot);
String access = input.getProperty(ATT_ACCESS_MODIFIER);
- if(access == null || "default".equals(access)) access = "";
+ if(access == null || "default".equals(access)) access = ""; //$NON-NLS-1$ //$NON-NLS-2$
p.setProperty(PARAM_ACCESS, access);
- p.setProperty(PARAM_EXTENDS, input.getProperty("extends"));
- p.setProperty(PARAM_IMPLEMENTS, input.getProperty("implements").replace(';', ','));
- p.setProperty(PARAM_INTERFACE, input.getProperty("interface").replace(';', ','));
+ p.setProperty(PARAM_EXTENDS, input.getProperty("extends")); //$NON-NLS-1$
+ p.setProperty(PARAM_IMPLEMENTS, input.getProperty("implements").replace(';', ',')); //$NON-NLS-1$
+ p.setProperty(PARAM_INTERFACE, input.getProperty("interface").replace(';', ',')); //$NON-NLS-1$
doGenerateJava(javaproject, filepath, p);
}
@@ -118,8 +118,8 @@
String shortname = p.getProperty(PARAM_SHORTNAME);
- String lineDelimiter = System.getProperty("line.separator", "\n");
- ICompilationUnit parentCU = pack.createCompilationUnit(shortname + ".java", "", false, null);
+ String lineDelimiter = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ ICompilationUnit parentCU = pack.createCompilationUnit(shortname + ".java", "", false, null); //$NON-NLS-1$ //$NON-NLS-2$
ICompilationUnit createdWorkingCopy = (ICompilationUnit) parentCU.getWorkingCopy(null);
/// imports= new ImportsStructure(createdWorkingCopy, prefOrder, threshold, false);
@@ -164,9 +164,9 @@
}
StringBuffer sb = new StringBuffer();
if(!p.isDefaultPackage()) {
- sb.append("package ");
+ sb.append("package "); //$NON-NLS-1$
sb.append(p.getElementName());
- sb.append(';'); //$NON-NLS-1$
+ sb.append(';');
}
for (int i = 0; i < 2; i++) sb.append(lineDelimiter);
if(comments != null) {
@@ -201,37 +201,37 @@
StringBuffer sb = new StringBuffer();
// String pkgname = p.getProperty(PARAM_PACKAGENAME);
String access = p.getProperty(PARAM_ACCESS);
- if(access == null) access = ""; else if(access.length() > 0) access += " ";
+ if(access == null) access = ""; else if(access.length() > 0) access += " "; //$NON-NLS-1$ //$NON-NLS-2$
boolean isInterface = XModelObjectConstants.TRUE.equals(p.getProperty(PARAM_INTERFACE));
- String kind = isInterface ? "interface " : "class ";
+ String kind = isInterface ? "interface " : "class "; //$NON-NLS-1$ //$NON-NLS-2$
String shortname = p.getProperty(PARAM_SHORTNAME);
String _extends = p.getProperty(PARAM_EXTENDS);
- if(_extends == null) _extends = ""; else if(_extends.length() > 0) _extends = "extends " + _extends + " ";
+ if(_extends == null) _extends = ""; else if(_extends.length() > 0) _extends = "extends " + _extends + " "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String _implements = formatImplements(p.getProperty(PARAM_IMPLEMENTS));
if(_implements == null) {
- _implements = "";
+ _implements = ""; //$NON-NLS-1$
} else if(_implements.length() > 0) {
if(isInterface) {
- _implements = "extends " + _implements + " ";
+ _implements = "extends " + _implements + " "; //$NON-NLS-1$ //$NON-NLS-2$
} else {
- _implements = "implements " + _implements + " ";
+ _implements = "implements " + _implements + " "; //$NON-NLS-1$ //$NON-NLS-2$
}
}
- String header = access + kind + shortname + " " + _extends + _implements + "{" + lineDelimiter;
+ String header = access + kind + shortname + " " + _extends + _implements + "{" + lineDelimiter; //$NON-NLS-1$ //$NON-NLS-2$
sb.append(header);
if(!isInterface) {
- sb.append("public " + shortname + "() {" + lineDelimiter + "}" + lineDelimiter); // constructor
+ sb.append("public " + shortname + "() {" + lineDelimiter + "}" + lineDelimiter); // constructor //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- sb.append("}" + lineDelimiter);
+ sb.append("}" + lineDelimiter); //$NON-NLS-1$
return sb.toString();
}
private String formatImplements(String s) {
StringBuffer sb = new StringBuffer();
- StringTokenizer st = new StringTokenizer(s, ",;");
+ StringTokenizer st = new StringTokenizer(s, ",;"); //$NON-NLS-1$
while(st.hasMoreTokens()) {
sb.append(st.nextToken());
- if(st.hasMoreTokens()) sb.append(", ");
+ if(st.hasMoreTokens()) sb.append(", "); //$NON-NLS-1$
}
return sb.toString();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaPropertyGenerator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaPropertyGenerator.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/generation/JavaPropertyGenerator.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -25,8 +25,8 @@
}
public void generate(String name, String javatype, String access, boolean field, boolean getter, boolean setter) throws CoreException {
- if("default".equals(access)) access = ""; else access += " ";
- String fa = (getter && setter) ? "private " : access;
+ if("default".equals(access)) access = ""; else access += " "; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String fa = (getter && setter) ? "private " : access; //$NON-NLS-1$
ICompilationUnit parentCU = owner.getCompilationUnit();
String lineDelimiter = getLineDelimiterUsed(parentCU);
ICompilationUnit createdWorkingCopy = (ICompilationUnit) parentCU.getWorkingCopy(null);
@@ -39,7 +39,7 @@
if(field && !isInterface &&
(createdType.getField(name) == null || !createdType.getField(name).exists())
) {
- String fieldContents = "\t" + fa + javatype + " " + name + ";" + lineDelimiter;
+ String fieldContents = "\t" + fa + javatype + " " + name + ";" + lineDelimiter; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
createdType.createField(fieldContents, null, true, null);
synchronized(cu) {
cu.reconcile(ICompilationUnit.NO_AST, true, null, null);
@@ -56,15 +56,15 @@
}
public static void createGetter(ICompilationUnit cu, IType type, String access, String javatype, String name, String lineDelimiter) throws CoreException {
- String methodName = getAccessorName("get", name);
+ String methodName = getAccessorName("get", name); //$NON-NLS-1$
if(findGetter(type, methodName) != null) return;
- String methodHeader = access + javatype + " " + methodName + "()";
+ String methodHeader = access + javatype + " " + methodName + "()"; //$NON-NLS-1$ //$NON-NLS-2$
String stub = null;
if(!type.isInterface()) {
- methodHeader += " {" + lineDelimiter;
- stub = methodHeader + "}" + lineDelimiter;
+ methodHeader += " {" + lineDelimiter; //$NON-NLS-1$
+ stub = methodHeader + "}" + lineDelimiter; //$NON-NLS-1$
} else {
- methodHeader += ";" + lineDelimiter;
+ methodHeader += ";" + lineDelimiter; //$NON-NLS-1$
stub = methodHeader;
}
IMethod m = type.createMethod(stub, null, true, null);
@@ -88,19 +88,19 @@
}
public static void createSetter(ICompilationUnit cu, IType type, String access, String javatype, String name, String lineDelimiter) throws CoreException {
- String methodName = getAccessorName("set", name);
- String methodHeader = access + "void " + methodName + "(" + javatype + " " + name + ")";
+ String methodName = getAccessorName("set", name); //$NON-NLS-1$
+ String methodHeader = access + "void " + methodName + "(" + javatype + " " + name + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
String stub = null;
if(!type.isInterface()) {
- methodHeader += " {" + lineDelimiter;
- stub = methodHeader + "}" + lineDelimiter;
+ methodHeader += " {" + lineDelimiter; //$NON-NLS-1$
+ stub = methodHeader + "}" + lineDelimiter; //$NON-NLS-1$
} else {
- methodHeader += ";" + lineDelimiter;
+ methodHeader += ";" + lineDelimiter; //$NON-NLS-1$
stub = methodHeader;
}
IMethod m = type.createMethod(stub, null, true, null);
String methodComment = CodeGeneration.getSetterComment(cu, type.getElementName(), m.getElementName(), name, javatype, name, name, lineDelimiter);
- String methodContent = (type.isInterface()) ? null : CodeGeneration.getSetterMethodBodyContent(cu, cu.getElementName(), m.getElementName(), "this." + name, name, lineDelimiter);
+ String methodContent = (type.isInterface()) ? null : CodeGeneration.getSetterMethodBodyContent(cu, cu.getElementName(), m.getElementName(), "this." + name, name, lineDelimiter); //$NON-NLS-1$
editMethod(cu, m, methodHeader, methodComment, methodContent, lineDelimiter);
}
@@ -116,10 +116,10 @@
}
sb.append(methodHeader);
if(methodContent != null) {
- sb.append(methodContent).append("}").append(lineDelimiter);
+ sb.append(methodContent).append("}").append(lineDelimiter); //$NON-NLS-1$
}
String formattedContent = JavaBeanGenerator.codeFormat2(CodeFormatter.K_CLASS_BODY_DECLARATIONS, sb.toString(), 1, lineDelimiter, cu.getJavaProject());
- if(formattedContent != null && formattedContent.startsWith("\t")) {
+ if(formattedContent != null && formattedContent.startsWith("\t")) { //$NON-NLS-1$
formattedContent = formattedContent.substring(1);
}
buf.replace(range.getOffset(), range.getLength(), formattedContent);
@@ -132,7 +132,7 @@
public static String getLineDelimiterUsed(ICompilationUnit cu) {
if (cu == null || !cu.exists()) {
- return System.getProperty("line.separator", "\n");
+ return System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
IBuffer buf = null;
try {
@@ -141,7 +141,7 @@
ModelPlugin.getPluginLog().logError(e);
}
if (buf == null) {
- return System.getProperty("line.separator", "\n");
+ return System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
int length = buf.getLength();
for (int i = 0; i < length; i++) {
@@ -149,15 +149,15 @@
if (ch == SWT.CR) {
if (i + 1 < length) {
if (buf.getChar(i + 1) == SWT.LF) {
- return "\r\n";
+ return "\r\n"; //$NON-NLS-1$
}
}
- return "\r";
+ return "\r"; //$NON-NLS-1$
} else if (ch == SWT.LF) {
- return "\n";
+ return "\n"; //$NON-NLS-1$
}
}
- return System.getProperty("line.separator", "\n");
+ return System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/model/handler/CreateJavaFileHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/model/handler/CreateJavaFileHandler.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/java/model/handler/CreateJavaFileHandler.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -27,7 +27,7 @@
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
- SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizard.newfile.NewClassCreationWizard");
+ SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.wizard.newfile.NewClassCreationWizard"); //$NON-NLS-1$
wizard.setObject(object);
wizard.execute();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/SignificanceMessageFactory.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -20,7 +20,7 @@
public class SignificanceMessageFactory {
- static public final String MESSAGE_CLASS_NAME_PARAMETER = "significanceMessageClass";
+ static public final String MESSAGE_CLASS_NAME_PARAMETER = "significanceMessageClass"; //$NON-NLS-1$
static private SignificanceMessage defaultFactory = new SignificanceMessageImpl();
static private SignificanceMessage defaultReplaceFactory = new ReplaceSignificanceMessageImpl();
@@ -37,7 +37,7 @@
public String getMessage(XAction action, XModelObject object, XModelObject[] objects) {
String ms = action.getProperty(MESSAGE_CLASS_NAME_PARAMETER);
if(ms == null || ms.length() == 0) return defaultFactory.getMessage(action, object, objects);
- if("%Replace%".equals(ms)) {
+ if("%Replace%".equals(ms)) { //$NON-NLS-1$
return defaultReplaceFactory.getMessage(action, object, objects);
}
SignificanceMessage specificMessage = (SignificanceMessage)map.get(ms);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XAction.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XAction.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -14,16 +14,16 @@
import org.jboss.tools.common.model.event.*;
public interface XAction extends XActionItem, XActionHandler {
- public String HIDE_NEVER = "never";
- public String HIDE_DISABLED = "disabled";
- public String HIDE_ALWAYS = "always";
+ public String HIDE_NEVER = "never"; //$NON-NLS-1$
+ public String HIDE_DISABLED = "disabled"; //$NON-NLS-1$
+ public String HIDE_ALWAYS = "always"; //$NON-NLS-1$
// standart actions paths
- public static final String CUT = "CopyActions.Cut";
- public static final String COPY = "CopyActions.Copy";
- public static final String DELETE = "DeleteActions.Delete";
- public static final String PASTE = "CopyActions.Paste";
+ public static final String CUT = "CopyActions.Cut"; //$NON-NLS-1$
+ public static final String COPY = "CopyActions.Copy"; //$NON-NLS-1$
+ public static final String DELETE = "DeleteActions.Delete"; //$NON-NLS-1$
+ public static final String PASTE = "CopyActions.Paste"; //$NON-NLS-1$
public String getWizardClassName();
public XEntityData[] getEntityData(XModelObject object);
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XActionInvoker.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XActionInvoker.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/XActionInvoker.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -19,23 +19,23 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
public class XActionInvoker {
- static SpecialWizard sw = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.action.XModelObjectActionInvoker");
+ static SpecialWizard sw = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.ui.action.XModelObjectActionInvoker"); //$NON-NLS-1$
public static void invoke(String invokerEntity, String actionPath, XModelObject object, Properties runningProperties) {
if(object == null) {
- ModelPlugin.getPluginLog().logError("Cannot invoke action " + actionPath + " on null object.");
+ ModelPlugin.getPluginLog().logError("Cannot invoke action " + actionPath + " on null object."); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
XModelEntity entity = object.getModel().getMetaData().getEntity(invokerEntity);
if(entity == null) {
- ModelPlugin.getPluginLog().logError("Entity " + invokerEntity + " is not found.");
+ ModelPlugin.getPluginLog().logError("Entity " + invokerEntity + " is not found."); //$NON-NLS-1$ //$NON-NLS-2$
}
invoke(entity, actionPath, object, runningProperties);
}
public static void invoke(String actionPath, XModelObject object, Properties runningProperties) {
if(object == null) {
- ModelPlugin.getPluginLog().logError("Cannot invoke action " + actionPath + " on null object.");
+ ModelPlugin.getPluginLog().logError("Cannot invoke action " + actionPath + " on null object."); //$NON-NLS-1$ //$NON-NLS-2$
} else {
invoke(object.getModelEntity(), actionPath, object, runningProperties);
}
@@ -43,11 +43,11 @@
public static void invoke(XModelEntity invoker, String actionPath, XModelObject object, Properties runningProperties) {
if(sw == null) {
- ModelPlugin.getPluginLog().logError("XActionInvoker could not be loaded");
+ ModelPlugin.getPluginLog().logError("XActionInvoker could not be loaded"); //$NON-NLS-1$
} else {
XAction a = getAction(invoker, actionPath);
if(a == null) {
- ModelPlugin.getPluginLog().logError("Cannot find action " + actionPath + " in entity " + invoker.getName());
+ ModelPlugin.getPluginLog().logError("Cannot find action " + actionPath + " in entity " + invoker.getName()); //$NON-NLS-1$ //$NON-NLS-2$
} else {
sw.setObject(new Object[]{a, object, runningProperties});
sw.execute();
@@ -61,11 +61,11 @@
public static void invoke(XModelEntity invoker, String actionPath, XModelObject object, XModelObject[] targets, Properties runningProperties) {
if(sw == null) {
- ModelPlugin.getPluginLog().logError("XActionInvoker could not be loaded");
+ ModelPlugin.getPluginLog().logError("XActionInvoker could not be loaded"); //$NON-NLS-1$
} else {
XAction a = getAction(invoker, actionPath);
if(a == null) {
- ModelPlugin.getPluginLog().logError("Cannot find action " + actionPath + " in entity " + invoker.getName());
+ ModelPlugin.getPluginLog().logError("Cannot find action " + actionPath + " in entity " + invoker.getName()); //$NON-NLS-1$ //$NON-NLS-2$
} else {
sw.setObject(new Object[]{a, object, runningProperties, targets});
sw.execute();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/CompoundAdoptManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/CompoundAdoptManager.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/CompoundAdoptManager.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -22,25 +22,25 @@
protected synchronized final XAdoptManager[] loadManagers(String extensionPoint) {
IExtensionPoint p = Platform.getExtensionRegistry().getExtensionPoint(extensionPoint);
if(p == null) {
- ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load extension point " + extensionPoint + ".", null));
+ ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load extension point " + extensionPoint + ".", null)); //$NON-NLS-1$ //$NON-NLS-2$
return new XAdoptManager[0];
}
IConfigurationElement[] es = p.getConfigurationElements();
XAdoptManager[] array = new XAdoptManager[es.length];
int length = 0;
for (int i = 0; i < es.length; i++) {
- String cls = es[i].getAttribute("class");
+ String cls = es[i].getAttribute("class"); //$NON-NLS-1$
if(cls == null || cls.length() == 0) continue;
try {
- XAdoptManager m = (XAdoptManager)es[i].createExecutableExtension("class");
+ XAdoptManager m = (XAdoptManager)es[i].createExecutableExtension("class"); //$NON-NLS-1$
if(m != null) {
array[length] = m;
length++;
}
} catch (CoreException e) {
- ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load class " + cls + ".", e));
+ ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load class " + cls + ".", e)); //$NON-NLS-1$ //$NON-NLS-2$
} catch (ClassCastException e2) {
- ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load class " + cls + ".", e2));
+ ModelPlugin.getDefault().getLog().log(new Status(Status.ERROR, ModelPlugin.PLUGIN_ID, Status.OK, "Model warning: Cannot load class " + cls + ".", e2)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
if(length < array.length) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2009-06-22 07:16:29 UTC (rev 16107)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/DefaultWizardDataValidator.java 2009-06-22 07:22:50 UTC (rev 16108)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl;
+import java.text.MessageFormat;
import java.util.*;
import org.jboss.tools.common.meta.XChild;
@@ -42,7 +43,7 @@
XEntityData[] ds = support.getEntityData();
if(ds.length <= step) return;
if(support.action != null) {
- if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.add")) && step == 0) {
+ if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.add")) && step == 0) { //$NON-NLS-1$
String entity = support.action.getProperty(XMetaDataConstants.ENTITY);
if(entity == null) entity = ds[step].getModelEntity().getName();
if(!checkChild(support.getTarget(), entity, data)) return;
@@ -52,11 +53,17 @@
XChild c = support.getTarget().getModelEntity().getChild(entity);
int max = c == null ? 0 : c.getMaxCount();
if(c != null && max <= childCount) {
- message = DefaultCreateHandler.title(parent, true) + " can contain only " + max +
- ((max == 1) ? " child " : " children ") +
- "with entity " + entity + ".";
+ String parentTitle = DefaultCreateHandler.title(parent, true);
+ // TODO (i18n) this assumes Germanic-type plurals
+ message = ((max == 1) ?
+ MessageFormat.format(
+ "{0} can contain only {1} child with entity {2}.",
+ parentTitle, max, entity)
+ : MessageFormat.format(
+ "{0} can contain only {1} children with entity {2}.",
+ parentTitle, max, entity));
}
- } else if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.edit"))) {
+ } else if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.edit"))) { //$NON-NLS-1$
String entity = support.action.getProperty(XMetaDataConstants.ENTITY);
if(entity == null) entity = ds[step].getModelEntity().getName();
if(!checkChild(support.getTarget().getParent(), entity, data)) return;
@@ -67,20 +74,20 @@
for (int i = 0; i < as.length; i++) {
String n = as[i].getAttribute().getName();
String value = data.getProperty(n);
- if(value == null) value = "";
+ if(value == null) value = ""; //$NON-NLS-1$
if(!support.isFieldEditorEnabled(step, n, data)) continue;
message = DefaultCreateHandler.validateAttribute(as[i], value);
if(message != null) return;
}
if(message != null || support.action == null) return;
- if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.addfile")) && step == 0) {
+ if(XModelObjectConstants.TRUE.equals(support.action.getProperty("validator.addfile")) && step == 0) { //$NON-NLS-1$
validateAddFile(ds, data);
}
- String resourceAttr = support.action.getProperty("validator.resource");
+ String resourceAttr = support.action.getProperty("validator.resource"); //$NON-NLS-1$
if(resourceAttr != null) {
String value = data.getProperty(resourceAttr);
if(value != null && (!new java.io.File(value).exists())) {
- message = "Resource " + value + " does not exist.";
+ message = MessageFormat.format("Resource {0} does not exist.", value);
}
}
}
15 years, 6 months
JBoss Tools SVN: r16107 - in trunk: portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-06-22 03:16:29 -0400 (Mon, 22 Jun 2009)
New Revision: 16107
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/BasePortletClasspathContainer.java
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/JSFPortlet10LibrariesContainerInitializer.java
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/BasePortletClasspathContainer.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/BasePortletClasspathContainer.java 2009-06-22 07:15:03 UTC (rev 16106)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/BasePortletClasspathContainer.java 2009-06-22 07:16:29 UTC (rev 16107)
@@ -8,7 +8,7 @@
AbstractClasspathContainer {
protected static final String PORTLET_FOLDER = "portlet"; //$NON-NLS-1$
- public final static String SUFFIX = PORTLET_FOLDER;//$NON-NLS-1$
+ public final static String SUFFIX = PORTLET_FOLDER;
public final static String PREFIX = "org.jboss.tools.portlet.core"; //$NON-NLS-1$
public BasePortletClasspathContainer(IJavaProject project, IPath path,
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/JSFPortlet10LibrariesContainerInitializer.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/JSFPortlet10LibrariesContainerInitializer.java 2009-06-22 07:15:03 UTC (rev 16106)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/JSFPortlet10LibrariesContainerInitializer.java 2009-06-22 07:16:29 UTC (rev 16107)
@@ -54,7 +54,7 @@
private class JSFPortlet10ClasspathContainer extends AbstractClasspathContainer {
- public final static String SUFFIX = PortletCoreActivator.JSFPORTLET_FOLDER;//$NON-NLS-1$
+ public final static String SUFFIX = PortletCoreActivator.JSFPORTLET_FOLDER;
public final static String PREFIX = "org.jboss.tools.portlet.core"; //$NON-NLS-1$
public JSFPortlet10ClasspathContainer(IPath path, IJavaProject javaProject) {
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java 2009-06-22 07:15:03 UTC (rev 16106)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/internal/project/facet/PortletPostInstallListener.java 2009-06-22 07:16:29 UTC (rev 16107)
@@ -218,7 +218,7 @@
});
String clientURI = ""; //$NON-NLS-1$
for (File file : earJars) {
- clientURI += " " + file.getName(); //$NON-NLS-1$ //$NON-NLS-2$
+ clientURI += " " + file.getName(); //$NON-NLS-1$
}
try {
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2009-06-22 07:15:03 UTC (rev 16106)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/SeamComponentsFileFormLayoutData.java 2009-06-22 07:16:29 UTC (rev 16107)
@@ -72,7 +72,7 @@
private final static IFormData[] FILE_12_DEFINITIONS = new IFormData[] {
new FormData(
- "Seam Components 1.2 File",
+ "Seam Components 1.2 File", //$NON-NLS-1$
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_12)
),
@@ -83,7 +83,7 @@
private final static IFormData[] FILE_20_DEFINITIONS = new IFormData[] {
new FormData(
- "Seam Components 2.0 File",
+ "Seam Components 2.0 File", //$NON-NLS-1$
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_20)
),
@@ -95,7 +95,7 @@
private final static IFormData[] FILE_21_DEFINITIONS = new IFormData[] {
new FormData(
- "Seam Components 2.1 File",
+ "Seam Components 2.1 File", //$NON-NLS-1$
SeamXMLFormLayoutData.EMPTY_DESCRIPTION,
FormLayoutDataUtil.createGeneralFormAttributeData(ENT_SEAM_COMPONENTS_21)
),
Modified: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java 2009-06-22 07:15:03 UTC (rev 16106)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java 2009-06-22 07:16:29 UTC (rev 16107)
@@ -32,11 +32,11 @@
.toString();
Bundle xulRunnerBundle = Platform.getBundle(XULRUNNER_BUNDLE);
if (xulRunnerBundle == null) {
- System.out.println(NLS.bind(Messages.XULRunnerInitializer_Bundle_is_not_found, XULRUNNER_BUNDLE )); //$NON-NLS-2$
+ System.out.println(NLS.bind(Messages.XULRunnerInitializer_Bundle_is_not_found, XULRUNNER_BUNDLE ));
} else {
URL url = xulRunnerBundle.getEntry(XULRUNNER_ENTRY);
if (url == null) {
- System.out.println(NLS.bind(Messages.XULRunnerInitializer_Bundle_doesnt_contain, new Object[] {XULRUNNER_BUNDLE,XULRUNNER_ENTRY})); //$NON-NLS-2$
+ System.out.println(NLS.bind(Messages.XULRunnerInitializer_Bundle_doesnt_contain, new Object[] {XULRUNNER_BUNDLE,XULRUNNER_ENTRY}));
} else {
File xulrunnerFile;
try {
15 years, 6 months
JBoss Tools SVN: r16106 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-06-22 03:15:03 -0400 (Mon, 22 Jun 2009)
New Revision: 16106
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-06-22 06:50:49 UTC (rev 16105)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-06-22 07:15:03 UTC (rev 16106)
@@ -440,7 +440,7 @@
}
private String safeText(String text) {
- return text==null?"":text;
+ return text==null?"":text; //$NON-NLS-1$
}
private String strOrNull(String text) {
15 years, 6 months
JBoss Tools SVN: r16105 - in trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui: schema and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-06-22 02:50:49 -0400 (Mon, 22 Jun 2009)
New Revision: 16105
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/schema/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/schema/moduleDependencyPropertyPage.exsd
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/DependencyPageExtensionManager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IModuleDependenciesControl.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java
Log:
Changes to the main page to allow ESB to at least show this page for testing. Added an extension point to allow subclassing while having sane reference-providing defaults.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml 2009-06-22 06:39:57 UTC (rev 16104)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml 2009-06-22 06:50:49 UTC (rev 16105)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
+ <extension-point id="moduleDependencyPropertyPage" name="org.jboss.ide.eclipse.as.wtp.override.moduleDependencyPropertyPage" schema="schema/moduleDependencyPropertyPage.exsd"/>
<extension point="org.eclipse.ui.propertyPages">
@@ -8,36 +9,23 @@
<page
adaptable="true"
objectClass="org.eclipse.core.resources.IProject"
- name="JEE Module Dependencies (JBT Beta)"
+ name="Module Dependencies (JBT)"
class="org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage"
id="org.jboss.ide.eclipse.as.wtp.override.ui.J2EEDependenciesPage">
<enabledWhen>
<and>
<adapt
type="org.eclipse.core.resources.IProject">
- <or>
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.web" />
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.ejb" />
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.utility" />
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.ear" />
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.appclient" />
- <test forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jst.connector" />
- </or>
</adapt>
</and>
</enabledWhen>
</page>
</extension>
+ <extension
+ point="org.jboss.ide.eclipse.as.wtp.override.ui.moduleDependencyPropertyPage">
+ <dependencyPage
+ class="org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl.EarModuleDependencyPageProvider"
+ id="org.jboss.ide.eclipse.as.wtp.override.ui.earDependencyPage">
+ </dependencyPage>
+ </extension>
</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/schema/moduleDependencyPropertyPage.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/schema/moduleDependencyPropertyPage.exsd (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/schema/moduleDependencyPropertyPage.exsd 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.ide.eclipse.as.wtp.override.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.ide.eclipse.as.wtp.override.ui" id="moduleDependencyPropertyPage" name="org.jboss.ide.eclipse.as.wtp.override.moduleDependencyPropertyPage"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="dependencyPage"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="dependencyPage">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.IDependencyPageProvider"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-22 06:39:57 UTC (rev 16104)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -51,7 +51,6 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
-import org.eclipse.jst.j2ee.internal.IJ2EEDependenciesControl;
import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
@@ -94,10 +93,16 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-public abstract class AddModuleDependenciesPropertiesPage implements Listener,
- IJ2EEDependenciesControl {
+public class AddModuleDependenciesPropertiesPage implements Listener,
+ IModuleDependenciesControl {
+ private static final String REFERENCE_PROPERTY = new Integer(0).toString();
+ private static final String DEPLOY_PATH_PROPERTY = new Integer(1).toString();
+ private static final String SOURCE_PROPERTY = new Integer(2).toString();
+
+
protected final String PATH_SEPARATOR = ComponentDependencyContentProvider.PATH_SEPARATOR;
+ private boolean hasInitialized = false;
protected final IProject project;
protected final J2EEDependenciesPage propPage;
protected IVirtualComponent rootComponent = null;
@@ -118,11 +123,6 @@
// This should keep a list of all elements currently in the list (not removed)
protected HashMap<Object, String> objectToRuntimePath = new HashMap<Object, String>();
- // [Bug 238264] the cached list elements that are new and need to be
- // manually added to the viewer
- // Can be an IProject or IVirtualComponent
- protected ArrayList<Object> addedElements = new ArrayList<Object>();
-
/**
* Constructor for AddModulestoEARPropertiesControl.
*/
@@ -354,11 +354,12 @@
}
protected void addDoubleClickListener() {
- availableComponentsViewer.setColumnProperties(new String[] { "a", "b",
- "c" });
+ availableComponentsViewer.setColumnProperties(new String[] {
+ REFERENCE_PROPERTY, DEPLOY_PATH_PROPERTY, SOURCE_PROPERTY
+ });
CellEditor[] editors = new CellEditor[] { new TextCellEditor(),
- new TextCellEditor(),
- new TextCellEditor(availableComponentsViewer.getTable()) };
+ new TextCellEditor(availableComponentsViewer.getTable()),
+ new TextCellEditor()};
availableComponentsViewer.setCellEditors(editors);
availableComponentsViewer
.setCellModifier(new RuntimePathCellModifier());
@@ -385,10 +386,7 @@
private class RuntimePathCellModifier implements ICellModifier {
public boolean canModify(Object element, String property) {
- int columnIndex = Arrays.asList(
- availableComponentsViewer.getColumnProperties()).indexOf(
- property);
- if (columnIndex == 2) {
+ if( property.equals(DEPLOY_PATH_PROPERTY)) {
if (element instanceof VirtualArchiveComponent) {
try {
boolean sameProject = ((VirtualArchiveComponent) element)
@@ -413,10 +411,10 @@
}
public void modify(Object element, String property, Object value) {
- if (element instanceof TableItem) {
+ if (property.equals(DEPLOY_PATH_PROPERTY)) {
TableItem item = (TableItem) element;
- item.setText(2, (String) value);
objectToRuntimePath.put(item.getData(), (String) value);
+ refresh();
}
}
@@ -442,7 +440,6 @@
IProject selected = (IProject) d.getFirstResult();
Object selected2 = ModuleCoreNature.isFlexibleProject(selected) ?
ComponentCore.createComponent(selected) : selected;
- addedElements.add(selected2);
objectToRuntimePath.put(selected2, "/");
refresh();
TableItem[] items = availableComponentsViewer.getTable().getItems();
@@ -547,7 +544,6 @@
// also force check it
if (!refAlreadyExists) {
this.objectToRuntimePath.put(archive, new Path("/").toString());
- this.addedElements.add(archive);
availableComponentsViewer.add(archive);
TableItem[] items = availableComponentsViewer.getTable().getItems();
for (int i = 0; i < items.length; i++) {
@@ -636,17 +632,17 @@
// table columns
TableColumn fileNameColumn = new TableColumn(table, SWT.NONE, 0);
- fileNameColumn.setText(ManifestUIResourceHandler.JAR_Module_UI_);
+ fileNameColumn.setText("Reference");
fileNameColumn.setResizable(true);
- TableColumn projectColumn = new TableColumn(table, SWT.NONE, 1);
- projectColumn.setText(ManifestUIResourceHandler.Project_UI_);
- projectColumn.setResizable(true);
-
- TableColumn bndColumn = new TableColumn(table, SWT.NONE, 2);
- bndColumn.setText(ManifestUIResourceHandler.Packed_In_Lib_UI_);
+ TableColumn bndColumn = new TableColumn(table, SWT.NONE, 1);
+ bndColumn.setText("Deploy Path");
bndColumn.setResizable(true);
+ TableColumn projectColumn = new TableColumn(table, SWT.NONE, 2);
+ projectColumn.setText("Source");
+ projectColumn.setResizable(true);
+
tableLayout.layout(table, true);
return availableComponentsViewer;
@@ -682,8 +678,6 @@
}
- private boolean hasInitialized = false;
-
/**
* This should only be called on changes, such as adding a project
* reference, adding a lib reference etc.
@@ -759,12 +753,14 @@
* This is where the OK work goes. Lots of it. Watch your head.
* xiao xin
*/
-
-
-
- protected abstract boolean preHandleChanges(IProgressMonitor monitor);
- protected abstract boolean postHandleChanges(IProgressMonitor monitor);
+ protected boolean preHandleChanges(IProgressMonitor monitor) {
+ return true;
+ }
+ protected boolean postHandleChanges(IProgressMonitor monitor) {
+ return true;
+ }
+
public boolean performOk() {
// grab what's checked
ArrayList<Object> checked = new ArrayList<Object>();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-06-22 06:39:57 UTC (rev 16104)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -17,7 +17,6 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -52,7 +51,7 @@
Object[] empty = new Object[0];
if( !(inputElement instanceof IWorkspaceRoot))
return empty;
- return runtimePaths.keySet().toArray();
+ return runtimePaths.keySet().toArray();
}
public Image getColumnImage(Object element, int columnIndex) {
@@ -65,15 +64,15 @@
if( columnIndex == 0 ){
return comp.getName();
} else if (columnIndex == 1) {
- return comp.getProject().getName();
- } else if (columnIndex == 2) {
if( runtimePaths == null || runtimePaths.get(element) == null) {
return new Path(PATH_SEPARATOR).toString();
}
return runtimePaths.get(element);
+ } else if (columnIndex == 2) {
+ return comp.getProject().getName();
}
} else if (element instanceof IProject){
- if (columnIndex != 2) {
+ if (columnIndex != 1) {
return ((IProject)element).getName();
} else {
if( runtimePaths == null || runtimePaths.get(element) == null) {
@@ -81,7 +80,7 @@
}
return runtimePaths.get(element);
}
- }
+ }
return null;
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/DependencyPageExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/DependencyPageExtensionManager.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/DependencyPageExtensionManager.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,50 @@
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.jboss.ide.eclipse.as.wtp.override.ui.WTPOveridePlugin;
+
+public class DependencyPageExtensionManager {
+ private static DependencyPageExtensionManager manager = null;
+ public static DependencyPageExtensionManager getManager() {
+ if( manager == null )
+ manager = new DependencyPageExtensionManager();
+ return manager;
+ }
+
+ private HashMap<String, IDependencyPageProvider> providers = null;
+
+ public IDependencyPageProvider getProvider(IFacetedProject project) {
+ if( providers == null )
+ loadProviders();
+ Iterator<IDependencyPageProvider> i = providers.values().iterator();
+ IDependencyPageProvider temp;
+ while(i.hasNext()) {
+ temp = i.next();
+ if( temp.canHandle(project))
+ return temp;
+ }
+ return null;
+ }
+
+ private void loadProviders() {
+ HashMap<String, IDependencyPageProvider> temp = new HashMap<String, IDependencyPageProvider>();
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(
+ WTPOveridePlugin.PLUGIN_ID, "moduleDependencyPropertyPage");
+ for( int i = 0; i < cf.length; i++ ) {
+ try {
+ temp.put(cf[i].getAttribute("id"), //$NON-NLS-1$
+ (IDependencyPageProvider)cf[i].createExecutableExtension("class")); //$NON-NLS-1$
+ } catch( CoreException ce ) {}
+ }
+ providers = temp;
+ }
+
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-22 06:39:57 UTC (rev 16104)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -1,196 +0,0 @@
-package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
-
-import java.util.ArrayList;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
-import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
-import org.eclipse.jst.j2ee.internal.dialogs.ChangeLibDirDialog;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.model.IEARModelProvider;
-import org.eclipse.jst.j2ee.model.ModelProviderManager;
-import org.eclipse.jst.j2ee.project.EarUtilities;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
-import org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler;
-import org.eclipse.jst.javaee.application.Application;
-import org.eclipse.jst.jee.project.facet.EarCreateDeploymentFilesDataModelProvider;
-import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public class EarModuleDependenciesPropertyPage extends
- AddModuleDependenciesPropertiesPage {
- protected Button changeLibPathButton;
- protected String libDir = null;
- protected String oldLibDir;
- protected boolean isVersion5;
- public EarModuleDependenciesPropertyPage(IProject project,
- J2EEDependenciesPage page) {
- super(project, page);
- initMemberVariables();
- }
-
- protected void initMemberVariables() {
- boolean hasEE5Facet = false;
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if(facetedProject != null){
- IProjectFacetVersion facetVersion = facetedProject.getProjectFacetVersion(EarUtilities.ENTERPRISE_APPLICATION_FACET);
- if(facetVersion.equals(EarUtilities.ENTERPRISE_APPLICATION_50)){
- hasEE5Facet = true;
- }
- }
- } catch (CoreException e) {
- J2EEUIPlugin.logError(e);
- }
-
- if(hasEE5Facet){
- String earDDVersion = JavaEEProjectUtilities.getJ2EEDDProjectVersion(project);
- if (earDDVersion.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
- isVersion5 = true;
- Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- if (app != null)
- oldLibDir = app.getLibraryDirectory();
- if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- libDir = oldLibDir;
- }
- }
- }
-
- protected void createPushButtons() {
- super.createPushButtons();
- if (isVersion5)
- changeLibPathButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.CHANGE_LIB_DIR));//$NON-NLS-1$
-
- }
-
- public void handleEvent(Event event) {
- if( event.widget == changeLibPathButton)
- handleChangeLibDirButton(true);
- else
- super.handleEvent(event);
- }
-
-
- private void handleChangeLibDirButton(boolean warnBlank) {
- IVirtualFile vFile = rootComponent.getRootFolder().getFile(new Path(J2EEConstants.APPLICATION_DD_URI));
- if (!vFile.exists()) {
- if (!MessageDialog.openQuestion(null,
- J2EEUIMessages.getResourceString(J2EEUIMessages.NO_DD_MSG_TITLE),
- J2EEUIMessages.getResourceString(J2EEUIMessages.GEN_DD_QUESTION))) return;
- createDD(new NullProgressMonitor());
- }
- Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- if (libDir == null) {
- libDir = app.getLibraryDirectory();
- if (libDir == null) libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- }
-
- ChangeLibDirDialog dlg = new ChangeLibDirDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
- .getShell(), libDir, warnBlank);
- if (dlg.open() == Dialog.CANCEL) return;
- libDir = dlg.getValue().trim();
- if (libDir.length() > 0) {
- if (!libDir.startsWith(J2EEConstants.EAR_ROOT_DIR)) libDir = IPath.SEPARATOR + libDir;
- }
- }
-
- protected void createDD(IProgressMonitor monitor) {
- if( rootComponent != null ){
- IDataModelOperation op = generateEARDDOperation();
- try {
- op.execute(monitor, null);
- } catch (ExecutionException e) {
- J2EEUIPlugin.logError(e);
- }
- }
- }
-
- protected IDataModelOperation generateEARDDOperation() {
- IDataModel model = DataModelFactory.createDataModel(new EarCreateDeploymentFilesDataModelProvider());
- model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, rootComponent);
- model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, project);
- return model.getDefaultOperation();
- }
-
- private void updateLibDir(IProgressMonitor monitor) {
- if (libDir.equals(oldLibDir)) return;
- final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(project);
- final Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
- oldLibDir = app.getLibraryDirectory();
- if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
- earModel.modify(new Runnable() {
- public void run() {
- app.setLibraryDirectory(libDir);
- }}, null);
- }
-
- public boolean postHandleChanges(IProgressMonitor monitor) {
- return true;
- }
-
- public boolean preHandleChanges(IProgressMonitor monitor) {
- if (isVersion5) {
- if (libDir.length() == 0) {
-
- MessageDialog dlg = new MessageDialog(null,
- J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR),
- null, J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR_WARN_QUESTION),
- MessageDialog.QUESTION, new String[] {J2EEUIMessages.YES_BUTTON,
- J2EEUIMessages.NO_BUTTON,
- J2EEUIMessages.CANCEL_BUTTON}, 1);
- switch (dlg.open()) {
- case 0: break;
- case 1: {
- handleChangeLibDirButton(false);
- return false;
- }
- case 2: return false;
- default: return false;
- }
- }
- updateLibDir(monitor);
- }
- return true;
- }
-
- protected void handleRemoved(ArrayList<IVirtualComponent> removed) {
- super.handleRemoved(removed);
- J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(rootComponent.getProject());
- }
-
- protected IDataModelProvider getRemoveReferenceDataModelProvider(Object component) {
- return new RemoveComponentFromEnterpriseApplicationDataModelProvider();
- }
-
- protected void postAddProjects(Set moduleProjects) throws CoreException {
- EarFacetRuntimeHandler.updateModuleProjectRuntime(rootComponent.getProject(), moduleProjects, new NullProgressMonitor());
- }
-
- protected IDataModelProvider getAddReferenceDataModelProvider(IVirtualComponent component) {
- return new AddComponentToEnterpriseApplicationDataModelProvider();
- }
-}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,10 @@
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+
+public interface IDependencyPageProvider {
+ public boolean canHandle(IFacetedProject project);
+ public IModuleDependenciesControl[] createPages(IFacetedProject project, J2EEDependenciesPage parent);
+ public Composite createRootControl(IModuleDependenciesControl[] pages, Composite parent);
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IModuleDependenciesControl.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IModuleDependenciesControl.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IModuleDependenciesControl.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,42 @@
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+
+import org.eclipse.swt.widgets.Composite;
+
+public interface IModuleDependenciesControl {
+ /**
+ * Creates the Composite associated with this control.
+ * @param parent Parent Composite.
+ * @return Composite for the control.
+ */
+ Composite createContents(Composite parent);
+
+ /**
+ * Called when the property page's <code>performOk()</code> method is called.
+ * @return
+ */
+ boolean performOk();
+
+ /**
+ * Called when the property page's <code>performDefaults()</code> method is called.
+ * @return
+ */
+ void performDefaults();
+
+ /**
+ * Called when the property page's <code>performCancel()</code> method is called.
+ * @return
+ */
+ boolean performCancel();
+
+ /**
+ * Called when the property page's <code>setVisible()</code> method is called.
+ * @return
+ */
+ void setVisible(boolean visible);
+
+ /**
+ * Called when the property page's <code>dispose()</code> method is called.
+ * @return
+ */
+ void dispose();
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java 2009-06-22 06:39:57 UTC (rev 16104)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -15,50 +15,47 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jst.j2ee.internal.IJ2EEDependenciesControl;
-import org.eclipse.jst.j2ee.internal.JARDependencyPropertiesPage;
-import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
-import org.eclipse.jst.j2ee.internal.WebLibDependencyPropertiesPage;
-import org.eclipse.jst.j2ee.internal.WebRefDependencyPropertiesPage;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.ui.dialogs.PropertyPage;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl.EarModuleDependenciesPropertyPage;
/*
* The only change in this file between here and upstream is
* the method createEARContent
+ *
+ * We'd obviously prefer to remove the extension of the superclass here
+ * but elements in the web ui demand we be a part of that tree for right now
+ * Also we'd switch to depending on IModuleDependenciesControl (local)
*/
/**
* Primary project property page for J2EE dependencies; content is dynamically
* generated based on the project facets and will be comprised by a
* set of IJ2EEDependenciesControl implementations.
+ *
*/
-public class J2EEDependenciesPage extends org.eclipse.jst.j2ee.internal.J2EEDependenciesPage {
+public class J2EEDependenciesPage extends PropertyPage {
- public String DESCRIPTION = J2EEUIMessages.getResourceString("DESCRIPTION"); //$NON-NLS-1$
+ public String DESCRIPTION = "ModuleDependency Page Description";
private IProject project;
- private IJ2EEDependenciesControl[] controls = new IJ2EEDependenciesControl[0];
+ private IModuleDependenciesControl[] controls = new IModuleDependenciesControl[0];
public J2EEDependenciesPage() {
super();
}
private Composite getFacetErrorComposite(final Composite parent) {
- final String errorCheckingFacet = ManifestUIResourceHandler.Error_Checking_Project_Facets;
+ final String errorCheckingFacet = "Error Checking Project Facets";
setErrorMessage(errorCheckingFacet);
setValid(false);
return getErrorComposite(parent, errorCheckingFacet);
@@ -76,12 +73,6 @@
return composite;
}
- private Composite getUnreferencedErrorComposite(final Composite parent) {
- final String msg = ManifestUIResourceHandler.Unreferenced_Module_Error;
- setErrorMessage(msg);
- return getErrorComposite(parent, msg);
- }
-
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
@@ -166,20 +157,26 @@
// Need to find out what type of project we are handling
project = (IProject) getElement().getAdapter(IResource.class);
- Control created = null;
- try {
- final IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- if (facetedProject == null) {
- return getFacetErrorComposite(parent);
+ if( project != null ) {
+ try {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ IDependencyPageProvider provider = null;
+ if( facetedProject == null )
+ return getFacetErrorComposite(parent);
+
+ provider = DependencyPageExtensionManager.getManager().getProvider(facetedProject);
+ if( provider != null ) {
+ controls = provider.createPages(facetedProject, this);
+ return provider.createRootControl(controls, parent);
+ }
+ AddModuleDependenciesPropertiesPage page = new AddModuleDependenciesPropertiesPage(project, this);
+ controls = new IModuleDependenciesControl[1];
+ controls[0] = page;
+ return page.createContents(parent);
+ } catch( CoreException ce ) {
}
- created = createContents2(parent, facetedProject);
- } catch (CoreException ce) {
- return getFacetErrorComposite(parent);
}
-
- if( created == null )
- return createNonEARContent(parent);
- return created;
+ return getFacetErrorComposite(parent);
}
/*
@@ -187,14 +184,13 @@
* This is the area that needs to be extended.
*/
protected Control createContents2(Composite parent, IFacetedProject facetedProject) {
-
- boolean isEAR = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE));
- boolean isWEB = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE));
- if (isEAR) {
- return createEARContent(parent);
- } else if (isWEB) {
- return createWebContent(parent);
- }
+// boolean isEAR = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE));
+// boolean isWEB = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE));
+// if (isEAR) {
+// return createEARContent(parent);
+// } else if (isWEB) {
+// return createWebContent(parent);
+// }
return null;
}
@@ -205,57 +201,57 @@
private Composite createEARContent(final Composite parent) {
//AddModuleDependenciesPropertiesPage page = new AddModuleDependenciesPropertiesPage(project, this);
EarModuleDependenciesPropertyPage page = new EarModuleDependenciesPropertyPage(project, this);
- controls = new IJ2EEDependenciesControl[1];
+ controls = new IModuleDependenciesControl[1];
controls[0] = page;
return page.createContents(parent);
}
- private Composite createWebContent(final Composite parent) {
- final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
-
- if (standalone) {
- // only need to create the Web Libraries page
- controls = new IJ2EEDependenciesControl[1];
- controls[0] = new WebLibDependencyPropertiesPage(project, this);
- return controls[0].createContents(parent);
- } else {
- // Create a tabbed folder with both "J2EE Modules" and "Web Libraries"
- final TabFolder folder = new TabFolder(parent, SWT.LEFT);
- folder.setLayoutData(new GridData(GridData.FILL_BOTH));
- folder.setFont(parent.getFont());
-
- // Create the two tabs
- controls = new IJ2EEDependenciesControl[2];
-
- controls[0] = new JARDependencyPropertiesPage(project, this);
- TabItem tab = new TabItem(folder, SWT.NONE);
- tab.setControl(controls[0].createContents(folder));
- tab.setText(ManifestUIResourceHandler.J2EE_Modules);
- controls[1] = new WebLibDependencyPropertiesPage(project, this);
- tab = new TabItem(folder, SWT.NONE);
- tab.setControl(controls[1].createContents(folder));
- tab.setText(ManifestUIResourceHandler.Web_Libraries);
-
- folder.setSelection(0);
- return folder;
- }
- }
-
- private Composite createNonEARContent(final Composite parent) {
- controls = new IJ2EEDependenciesControl[1];
- final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
- if (standalone) {
- // if not referenced by an EAR, check if referenced by a dynamic web project
- if (J2EEProjectUtilities.getReferencingWebProjects(project).length > 0) {
- controls[0] = new WebRefDependencyPropertiesPage(project, this);
- } else {
- return getUnreferencedErrorComposite(parent);
- }
- } else {
- controls[0] = new JARDependencyPropertiesPage(project, this);
- }
-
- return controls[0].createContents(parent);
- }
-
+// private Composite createWebContent(final Composite parent) {
+// final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
+//
+// if (standalone) {
+// // only need to create the Web Libraries page
+// controls = new IJ2EEDependenciesControl[1];
+// controls[0] = new WebLibDependencyPropertiesPage(project, this);
+// return controls[0].createContents(parent);
+// } else {
+// // Create a tabbed folder with both "J2EE Modules" and "Web Libraries"
+// final TabFolder folder = new TabFolder(parent, SWT.LEFT);
+// folder.setLayoutData(new GridData(GridData.FILL_BOTH));
+// folder.setFont(parent.getFont());
+//
+// // Create the two tabs
+// controls = new IJ2EEDependenciesControl[2];
+//
+// controls[0] = new JARDependencyPropertiesPage(project, this);
+// TabItem tab = new TabItem(folder, SWT.NONE);
+// tab.setControl(controls[0].createContents(folder));
+// tab.setText(ManifestUIResourceHandler.J2EE_Modules);
+// controls[1] = new WebLibDependencyPropertiesPage(project, this);
+// tab = new TabItem(folder, SWT.NONE);
+// tab.setControl(controls[1].createContents(folder));
+// tab.setText(ManifestUIResourceHandler.Web_Libraries);
+//
+// folder.setSelection(0);
+// return folder;
+// }
+// }
+//
+// private Composite createNonEARContent(final Composite parent) {
+// controls = new IJ2EEDependenciesControl[1];
+// final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
+// if (standalone) {
+// // if not referenced by an EAR, check if referenced by a dynamic web project
+// if (J2EEProjectUtilities.getReferencingWebProjects(project).length > 0) {
+// controls[0] = new WebRefDependencyPropertiesPage(project, this);
+// } else {
+// return getUnreferencedErrorComposite(parent);
+// }
+// } else {
+// controls[0] = new JARDependencyPropertiesPage(project, this);
+// }
+//
+// return controls[0].createContents(parent);
+// }
+//
}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java (from rev 16039, trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/EarModuleDependenciesPropertyPage.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,198 @@
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl;
+
+import java.util.ArrayList;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jst.j2ee.application.internal.operations.AddComponentToEnterpriseApplicationDataModelProvider;
+import org.eclipse.jst.j2ee.application.internal.operations.RemoveComponentFromEnterpriseApplicationDataModelProvider;
+import org.eclipse.jst.j2ee.internal.J2EEConstants;
+import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
+import org.eclipse.jst.j2ee.internal.dialogs.ChangeLibDirDialog;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
+import org.eclipse.jst.j2ee.model.IEARModelProvider;
+import org.eclipse.jst.j2ee.model.ModelProviderManager;
+import org.eclipse.jst.j2ee.project.EarUtilities;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.EarFacetRuntimeHandler;
+import org.eclipse.jst.javaee.application.Application;
+import org.eclipse.jst.jee.project.facet.EarCreateDeploymentFilesDataModelProvider;
+import org.eclipse.jst.jee.project.facet.ICreateDeploymentFilesDataModelProperties;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.AddModuleDependenciesPropertiesPage;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage;
+
+public class EarModuleDependenciesPropertyPage extends
+ AddModuleDependenciesPropertiesPage {
+ protected Button changeLibPathButton;
+ protected String libDir = null;
+ protected String oldLibDir;
+ protected boolean isVersion5;
+ public EarModuleDependenciesPropertyPage(IProject project,
+ J2EEDependenciesPage page) {
+ super(project, page);
+ initMemberVariables();
+ }
+
+ protected void initMemberVariables() {
+ boolean hasEE5Facet = false;
+ try {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ if(facetedProject != null){
+ IProjectFacetVersion facetVersion = facetedProject.getProjectFacetVersion(EarUtilities.ENTERPRISE_APPLICATION_FACET);
+ if(facetVersion.equals(EarUtilities.ENTERPRISE_APPLICATION_50)){
+ hasEE5Facet = true;
+ }
+ }
+ } catch (CoreException e) {
+ J2EEUIPlugin.logError(e);
+ }
+
+ if(hasEE5Facet){
+ String earDDVersion = JavaEEProjectUtilities.getJ2EEDDProjectVersion(project);
+ if (earDDVersion.equals(J2EEVersionConstants.VERSION_5_0_TEXT)) {
+ isVersion5 = true;
+ Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
+ if (app != null)
+ oldLibDir = app.getLibraryDirectory();
+ if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+ libDir = oldLibDir;
+ }
+ }
+ }
+
+ protected void createPushButtons() {
+ super.createPushButtons();
+ if (isVersion5)
+ changeLibPathButton = createPushButton(J2EEUIMessages.getResourceString(J2EEUIMessages.CHANGE_LIB_DIR));//$NON-NLS-1$
+
+ }
+
+ public void handleEvent(Event event) {
+ if( event.widget == changeLibPathButton)
+ handleChangeLibDirButton(true);
+ else
+ super.handleEvent(event);
+ }
+
+
+ private void handleChangeLibDirButton(boolean warnBlank) {
+ IVirtualFile vFile = rootComponent.getRootFolder().getFile(new Path(J2EEConstants.APPLICATION_DD_URI));
+ if (!vFile.exists()) {
+ if (!MessageDialog.openQuestion(null,
+ J2EEUIMessages.getResourceString(J2EEUIMessages.NO_DD_MSG_TITLE),
+ J2EEUIMessages.getResourceString(J2EEUIMessages.GEN_DD_QUESTION))) return;
+ createDD(new NullProgressMonitor());
+ }
+ Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
+ if (libDir == null) {
+ libDir = app.getLibraryDirectory();
+ if (libDir == null) libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+ }
+
+ ChangeLibDirDialog dlg = new ChangeLibDirDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getShell(), libDir, warnBlank);
+ if (dlg.open() == Dialog.CANCEL) return;
+ libDir = dlg.getValue().trim();
+ if (libDir.length() > 0) {
+ if (!libDir.startsWith(J2EEConstants.EAR_ROOT_DIR)) libDir = IPath.SEPARATOR + libDir;
+ }
+ }
+
+ protected void createDD(IProgressMonitor monitor) {
+ if( rootComponent != null ){
+ IDataModelOperation op = generateEARDDOperation();
+ try {
+ op.execute(monitor, null);
+ } catch (ExecutionException e) {
+ J2EEUIPlugin.logError(e);
+ }
+ }
+ }
+
+ protected IDataModelOperation generateEARDDOperation() {
+ IDataModel model = DataModelFactory.createDataModel(new EarCreateDeploymentFilesDataModelProvider());
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.GENERATE_DD, rootComponent);
+ model.setProperty(ICreateDeploymentFilesDataModelProperties.TARGET_PROJECT, project);
+ return model.getDefaultOperation();
+ }
+
+ private void updateLibDir(IProgressMonitor monitor) {
+ if (libDir.equals(oldLibDir)) return;
+ final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(project);
+ final Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
+ oldLibDir = app.getLibraryDirectory();
+ if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+ earModel.modify(new Runnable() {
+ public void run() {
+ app.setLibraryDirectory(libDir);
+ }}, null);
+ }
+
+ public boolean postHandleChanges(IProgressMonitor monitor) {
+ return true;
+ }
+
+ public boolean preHandleChanges(IProgressMonitor monitor) {
+ if (isVersion5) {
+ if (libDir.length() == 0) {
+
+ MessageDialog dlg = new MessageDialog(null,
+ J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR),
+ null, J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR_WARN_QUESTION),
+ MessageDialog.QUESTION, new String[] {J2EEUIMessages.YES_BUTTON,
+ J2EEUIMessages.NO_BUTTON,
+ J2EEUIMessages.CANCEL_BUTTON}, 1);
+ switch (dlg.open()) {
+ case 0: break;
+ case 1: {
+ handleChangeLibDirButton(false);
+ return false;
+ }
+ case 2: return false;
+ default: return false;
+ }
+ }
+ updateLibDir(monitor);
+ }
+ return true;
+ }
+
+ protected void handleRemoved(ArrayList<IVirtualComponent> removed) {
+ super.handleRemoved(removed);
+ J2EEComponentClasspathUpdater.getInstance().queueUpdateEAR(rootComponent.getProject());
+ }
+
+ protected IDataModelProvider getRemoveReferenceDataModelProvider(Object component) {
+ return new RemoveComponentFromEnterpriseApplicationDataModelProvider();
+ }
+
+ protected void postAddProjects(Set moduleProjects) throws CoreException {
+ EarFacetRuntimeHandler.updateModuleProjectRuntime(rootComponent.getProject(), moduleProjects, new NullProgressMonitor());
+ }
+
+ protected IDataModelProvider getAddReferenceDataModelProvider(IVirtualComponent component) {
+ return new AddComponentToEnterpriseApplicationDataModelProvider();
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java 2009-06-22 06:50:49 UTC (rev 16105)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl;
+
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.IDependencyPageProvider;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.IModuleDependenciesControl;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage;
+
+public class EarModuleDependencyPageProvider implements IDependencyPageProvider {
+
+ public boolean canHandle(IFacetedProject project) {
+ boolean isEAR = project.hasProjectFacet(ProjectFacetsManager.getProjectFacet("jst.ear"));
+ return isEAR;
+ }
+
+ public IModuleDependenciesControl[] createPages(IFacetedProject project,
+ J2EEDependenciesPage parent) {
+ return new IModuleDependenciesControl[] {
+ new EarModuleDependenciesPropertyPage(project.getProject(), parent)
+ };
+ }
+
+ public Composite createRootControl(IModuleDependenciesControl[] pages,
+ Composite parent) {
+ if( pages.length == 1 && pages[0] != null)
+ return pages[0].createContents(parent);
+ return null;
+ }
+}
15 years, 6 months
JBoss Tools SVN: r16104 - trunk/bpel.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-06-22 02:39:57 -0400 (Mon, 22 Jun 2009)
New Revision: 16104
Added:
trunk/bpel/tests/
Log:
15 years, 6 months
JBoss Tools SVN: r16103 - in trunk/seam/plugins/org.jboss.tools.seam.ui: META-INF and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-06-21 14:34:45 -0400 (Sun, 21 Jun 2009)
New Revision: 16103
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
Log:
Rename Seam Context Variable https://jira.jboss.org/jira/browse/JBIDE-1077 Added popup menu to jsp, xhtml, xml and properties editors
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-06-20 14:22:56 UTC (rev 16102)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2009-06-21 18:34:45 UTC (rev 16103)
@@ -37,7 +37,8 @@
org.eclipse.ltk.core.refactoring,
org.eclipse.ltk.ui.refactoring,
org.jboss.ide.eclipse.as.core,
- org.jboss.tools.jsf
+ org.jboss.tools.jsf,
+ org.jboss.tools.jst.web.ui;bundle-version="2.0.0"
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.actions,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-06-20 14:22:56 UTC (rev 16102)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-06-21 18:34:45 UTC (rev 16103)
@@ -541,10 +541,14 @@
<!-- Refactorng -->
<extension
point="org.eclipse.ui.menus">
- <menuContribution
+ <!--menuContribution
class="org.jboss.tools.seam.ui.refactoring.SeamRefactorContributionFactory"
locationURI="popup:#CompilationUnitEditorContext?after=org.eclipse.jdt.ui.refactoring.menu">
- </menuContribution>
+ </menuContribution-->
+ <menuContribution
+ class="org.jboss.tools.seam.ui.refactoring.SeamRefactorContributionFactory"
+ locationURI="popup:org.eclipse.ui.popup.any?after=save">
+ </menuContribution>
</extension>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-06-20 14:22:56 UTC (rev 16102)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-06-21 18:34:45 UTC (rev 16103)
@@ -32,17 +32,17 @@
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.internal.services.IWorkbenchLocationService;
import org.eclipse.ui.menus.AbstractContributionFactory;
import org.eclipse.ui.menus.IContributionRoot;
@@ -64,9 +64,12 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.propertieseditor.PropertiesCompoundEditor;
import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.ui.editors.WebCompoundEditor;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
@@ -110,8 +113,6 @@
public void createContributionItems(IServiceLocator serviceLocator,
IContributionRoot additions) {
- //System.out.println("createContributionItems");
-
if(serviceLocator.hasService(IWorkbenchLocationService.class)){
IWorkbenchLocationService service = (IWorkbenchLocationService)serviceLocator.getService(IWorkbenchLocationService.class);
editor = service.getWorkbenchWindow().getActivePage().getActiveEditor();
@@ -120,18 +121,32 @@
if(!(editor.getEditorInput() instanceof FileEditorInput))
return;
+ FileEditorInput input = (FileEditorInput)editor.getEditorInput();
+
+ editorFile = input.getFile();
+ String ext = editorFile.getFileExtension();
+
+ if (!JAVA_EXT.equalsIgnoreCase(ext)
+ && !XML_EXT.equalsIgnoreCase(ext)
+ && !XHTML_EXT.equalsIgnoreCase(ext)
+ && !JSP_EXT.equalsIgnoreCase(ext)
+ && !PROPERTIES_EXT.equalsIgnoreCase(ext))
+ return;
+
MenuManager mm = new MenuManager(SeamUIMessages.SEAM_REFACTOR);
mm.setVisible(true);
- FileEditorInput input = (FileEditorInput)editor.getEditorInput();
+ boolean separatorIsAdded = false;
- editorFile = input.getFile();
-
- ISeamComponent component = getComponent(editorFile);
- if(component != null){
- mm.add(new RenameSeamComponentAction());
-
- additions.addContributionItem(mm, null);
+ if(JAVA_EXT.equalsIgnoreCase(ext)){
+ ISeamComponent component = getComponent(editorFile);
+ if(component != null){
+ mm.add(new RenameSeamComponentAction());
+
+ additions.addContributionItem(new Separator(), null);
+ additions.addContributionItem(mm, null);
+ separatorIsAdded = true;
+ }
}
ISelection sel = editor.getEditorSite().getSelectionProvider().getSelection();
@@ -139,6 +154,19 @@
if(sel == null || sel.isEmpty())
return;
+ if(sel instanceof StructuredSelection){
+ if(editor instanceof PropertiesCompoundEditor){
+ sel = ((PropertiesCompoundEditor)editor).getActiveEditor().getSite().getSelectionProvider().getSelection();
+ }else if(editor instanceof EditorPartWrapper){
+ EditorPartWrapper wrapperEditor = (EditorPartWrapper)editor;
+ if(wrapperEditor.getEditor() instanceof WebCompoundEditor){
+ WebCompoundEditor xmlEditor = (WebCompoundEditor)wrapperEditor.getEditor();
+ sel = xmlEditor.getActiveEditor().getSite().getSelectionProvider().getSelection();
+ }
+ }else if(editor instanceof WebCompoundEditor)
+ sel = ((WebCompoundEditor)editor).getActiveEditor().getSite().getSelectionProvider().getSelection();
+ }
+
if(sel instanceof TextSelection){
TextSelection selection = (TextSelection)sel;
@@ -154,8 +182,9 @@
boolean status = false;
- String ext = editorFile.getFileExtension();
+
if(JAVA_EXT.equalsIgnoreCase(ext)){
+ // check - whether selected component's name or not
// if(checkNameAnnotation(selection)){
// mm.add(new RenameSeamComponentAction());
//
@@ -170,6 +199,8 @@
if(status){
mm.add(new RenameSeamContextVariableAction());
+ if(!separatorIsAdded)
+ additions.addContributionItem(new Separator(), null);
additions.addContributionItem(mm, null);
}
}
@@ -260,7 +291,7 @@
if (model instanceof IDOMModel) {
IDOMModel domModel = (IDOMModel) model;
IDOMDocument document = domModel.getDocument();
- scanChildNodes(file, document, selection);
+ return scanChildNodes(file, document, selection);
}
} catch (CoreException e) {
SeamCorePlugin.getDefault().logError(e);
@@ -274,20 +305,29 @@
return false;
}
- private void scanChildNodes(IFile file, Node parent, TextSelection selection) {
+ private boolean scanChildNodes(IFile file, Node parent, TextSelection selection) {
+ boolean status = false;
NodeList children = parent.getChildNodes();
for(int i=0; i<children.getLength(); i++) {
Node curentValidatedNode = children.item(i);
if(Node.ELEMENT_NODE == curentValidatedNode.getNodeType()) {
- scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, selection);
+ status = scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE, selection);
+ if(status)
+ return status;
} else if(Node.TEXT_NODE == curentValidatedNode.getNodeType()) {
- scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT, selection);
+ status = scanNodeContent(file, ((IDOMNode)curentValidatedNode).getFirstStructuredDocumentRegion(), DOMRegionContext.XML_CONTENT, selection);
+ if(status)
+ return status;
}
- scanChildNodes(file, curentValidatedNode, selection);
+ status = scanChildNodes(file, curentValidatedNode, selection);
+ if(status)
+ return status;
}
+ return false;
}
- private void scanNodeContent(IFile file, IStructuredDocumentRegion node, String regionType, TextSelection selection) {
+ private boolean scanNodeContent(IFile file, IStructuredDocumentRegion node, String regionType, TextSelection selection) {
+ boolean status = false;
ITextRegionList regions = node.getRegions();
for(int i=0; i<regions.size(); i++) {
ITextRegion region = regions.get(i);
@@ -295,10 +335,13 @@
String text = node.getFullText(region);
if(text.indexOf("{")>-1) { //$NON-NLS-1$
int offset = node.getStartOffset() + region.getStart();
- scanString(file, text, offset, selection);
+ status = scanString(file, text, offset, selection);
+ if(status)
+ return status;
}
}
}
+ return false;
}
private boolean checkContextVariableInProperties(IFile file, String content, TextSelection selection){
15 years, 6 months