JBoss Tools SVN: r38840 - in trunk/maven/plugins: org.jboss.tools.maven.core/poms and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 13:19:57 -0500 (Thu, 16 Feb 2012)
New Revision: 38840
Added:
trunk/maven/plugins/org.jboss.tools.maven.core/poms/jsf-template20.xml
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/ProjectUtil.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java
trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/internal/project/facet/MavenPostInstallListener.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java
Log:
JBIDE-10762 : cleaned up mavenification of projects, added JSF 2.0 maven library provider
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.properties 2012-02-16 18:19:57 UTC (rev 38840)
@@ -6,6 +6,7 @@
Maven_library_provider=Maven library provider
Maven_JSF_1_2_Libraries=Maven JSF 1.2 Libraries
Maven_JSF_1_1_Libraries=Maven JSF 1.1 Libraries
+Maven_JSF_2_0_Libraries=Maven JSF 2.0 Libraries
Hibernate_3_3_2_Libraries=Hibernate 3.3.2 Libraries
Maven_Portlet_1_0_Libraries=Maven Portlet 1.0 Libraries
Maven_Portlet_2_0_Libraries=Maven Portlet 2.0 Libraries
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2012-02-16 18:19:57 UTC (rev 38840)
@@ -39,6 +39,10 @@
facet="jst.connector"
soft="true"
version="[1.0"/>
+ <requires
+ facet="jst.webfragment"
+ soft="true"
+ version="[3.0"/>
</or>
</constraint>
</project-facet-version>
@@ -116,8 +120,24 @@
</enablement>
</provider>
</extension>
-
+
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
+ <provider id="jsf20-maven-library-provider" extends="maven-library-provider">
+ <label>%Maven_JSF_2_0_Libraries</label>
+ <param name="template" value="platform:/plugin/org.jboss.tools.maven.core/poms/jsf-template20.xml"/>
+ <enablement>
+ <and>
+ <with variable="projectFacets">
+ <test property="org.jboss.tools.maven.core.projectFacets" value="jst.jsf,jboss.m2" forcePluginActivation="true"/>
+ </with>
+ <with variable="requestingProjectFacet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.jsf:2.0" forcePluginActivation="true"/>
+ </with>
+ </and>
+ </enablement>
+ </provider>
+ </extension>
+ <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="hibernate332-maven-library-provider" extends="maven-library-provider">
<label>%Hibernate_3_3_2_Libraries</label>
<param name="template" value="platform:/plugin/org.jboss.tools.maven.core/poms/hibernate332-template.xml"/>
@@ -170,6 +190,7 @@
</enablement>
</provider>
</extension>
+
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="portletbridge200alpha-maven-library-provider" extends="maven-library-provider">
Added: trunk/maven/plugins/org.jboss.tools.maven.core/poms/jsf-template20.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/poms/jsf-template20.xml (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/poms/jsf-template20.xml 2012-02-16 18:19:57 UTC (rev 38840)
@@ -0,0 +1,30 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>template</groupId>
+ <artifactId>template</artifactId>
+ <packaging>pom</packaging>
+ <version>0.0.1-SNAPSHOT</version>
+ <properties>
+ <javaee6.web.spec.version>2.0.0.Final</javaee6.web.spec.version>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-web-6.0</artifactId>
+ <version>${javaee6.web.spec.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -49,17 +49,17 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.eclipse.m2e.core.internal.IMavenConstants;
import org.eclipse.m2e.core.project.IProjectConfigurationManager;
import org.eclipse.m2e.jdt.internal.BuildPathManager;
import org.eclipse.m2e.model.edit.pom.Dependency;
+import org.eclipse.m2e.model.edit.pom.DependencyManagement;
import org.eclipse.m2e.model.edit.pom.PomFactory;
import org.eclipse.m2e.model.edit.pom.PropertyElement;
import org.eclipse.m2e.model.edit.pom.Repository;
@@ -69,7 +69,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.osgi.framework.BundleContext;
/**
@@ -91,6 +91,10 @@
public static final String ENCODING = "UTF-8"; //$NON-NLS-1$
public static final List<LibraryProviderOperationConfig> libraryProviderOperationConfigs = new ArrayList<LibraryProviderOperationConfig>();
+
+ private static final String DEFAULT_COMPILER_LEVEL = "1.5"; //$NON-NLS-1$
+
+ private static final String DEFAULT_WEBCONTENT_ROOT = "src/main/webapp"; //$NON-NLS-1$
// The shared instance
private static MavenCoreActivator plugin;
@@ -165,50 +169,6 @@
}
project.open(monitor);
}
- IJavaProject javaProject = JavaCore.create(project);
- IProjectDescription description = project.getDescription();
- String[] natureIds = description.getNatureIds();
- boolean hasJavaNature = false;
- for (int i = 0; i < natureIds.length; i++) {
- if (JavaCore.NATURE_ID.equals(natureIds[i])) {
- hasJavaNature = true;
- break;
- }
- }
- if (!hasJavaNature) {
- // EAR project
- createFolder("target",monitor, project); //$NON-NLS-1$
- IFolder binFolder = createFolder("target/classes",monitor, project); //$NON-NLS-1$
- String[] newNatureIds = new String[natureIds.length + 1];
- for (int i = 0; i < natureIds.length; i++) {
- newNatureIds[i]=natureIds[i];
- }
- newNatureIds[natureIds.length] = JavaCore.NATURE_ID;
- description.setNatureIds(newNatureIds);
- project.setDescription(description, monitor);
- javaProject.setRawClasspath(new IClasspathEntry[0], monitor);
- javaProject.setOutputLocation(binFolder.getFullPath(), monitor);
- IClasspathEntry entry = JavaRuntime.getDefaultJREContainerEntry();
- IClasspathEntry[] entries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[entries.length + 1];
- System.arraycopy(entries, 0, newEntries, 0, entries.length);
- newEntries[entries.length] = entry;
- javaProject.setRawClasspath(newEntries, monitor);
- }
- if (FacetedProjectFramework.hasProjectFacet(project, IJ2EEFacetConstants.ENTERPRISE_APPLICATION)) {
- String sourceDirectory = getSourceDirectory(javaProject);
- if (sourceDirectory == null || sourceDirectory.trim().length() <= 0) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFolder rootVFolder = component.getRootFolder();
- IContainer rootFolder = rootVFolder.getUnderlyingFolder();
- IPath path = rootFolder.getFullPath();
- IClasspathEntry[] entries = javaProject.getRawClasspath();
- IClasspathEntry[] newEntries = new IClasspathEntry[entries.length + 1];
- System.arraycopy(entries, 0, newEntries, 0, entries.length);
- newEntries[entries.length] = JavaCore.newSourceEntry(path);
- javaProject.setRawClasspath(newEntries, monitor);
- }
- }
addMavenCapabilities(project, monitor, model);
return project;
}
@@ -254,8 +214,7 @@
boolean hasJavaNature = project.hasNature(JavaCore.NATURE_ID);
if (hasJavaNature) {
IJavaProject javaProject = JavaCore.create(project);
- IClasspathContainer mavenContainer = BuildPathManager
- .getMaven2ClasspathContainer(javaProject);
+ IClasspathContainer mavenContainer = BuildPathManager.getMaven2ClasspathContainer(javaProject);
if (mavenContainer == null) {
IPath path = new Path(BuildPathManager.CONTAINER_ID);
setContainerPath(monitor, javaProject, path);
@@ -325,34 +284,46 @@
public static void updateMavenProjectConfiguration(IProject project)
throws CoreException {
- IProjectConfigurationManager configurationManager = MavenPlugin
- .getDefault().getProjectConfigurationManager();
- configurationManager.updateProjectConfiguration(project,
- new NullProgressMonitor());
+ IProjectConfigurationManager configurationManager = MavenPlugin.getProjectConfigurationManager();
+ configurationManager.updateProjectConfiguration(project, new NullProgressMonitor());
}
- public static void addMavenWarPlugin(Build build, IProject project) throws JavaModelException {
- org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
- plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
- plugin.setArtifactId("maven-war-plugin"); //$NON-NLS-1$
-
- Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ public static void addMavenWarPlugin(Build build, IProject project, IProjectFacetVersion webFacetversion) throws JavaModelException {
IVirtualComponent component = ComponentCore.createComponent(project);
+ if (component == null) {
+ return;
+ }
IVirtualFolder rootFolder = component.getRootFolder();
IContainer root = rootFolder.getUnderlyingFolder();
String webContentRoot = root.getProjectRelativePath().toString();
- Xpp3Dom warSourceDirectory = new Xpp3Dom("warSourceDirectory"); //$NON-NLS-1$
- if (webContentRoot.startsWith(SEPARATOR)) {
- warSourceDirectory.setValue(MavenCoreActivator.BASEDIR + webContentRoot);
- } else {
- warSourceDirectory.setValue(MavenCoreActivator.BASEDIR + SEPARATOR + webContentRoot);
+ boolean isDefaultWarSource = DEFAULT_WEBCONTENT_ROOT.equals(webContentRoot);
+ boolean needsFailOnMissingWebXml = webFacetversion != null && JavaEEProjectUtilities.DYNAMIC_WEB_25.compareTo(webFacetversion) < 1;
+ if (isDefaultWarSource && !needsFailOnMissingWebXml) {
+ return;
}
- configuration.addChild(warSourceDirectory);
+ org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
+ plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
+ plugin.setArtifactId("maven-war-plugin"); //$NON-NLS-1$
+ plugin.setVersion("2.2");//$NON-NLS-1$
+ Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ if (!isDefaultWarSource){
+ Xpp3Dom warSourceDirectory = new Xpp3Dom("warSourceDirectory"); //$NON-NLS-1$
+ if (webContentRoot.startsWith(SEPARATOR)) {
+ warSourceDirectory.setValue(MavenCoreActivator.BASEDIR + webContentRoot);
+ } else {
+ warSourceDirectory.setValue(MavenCoreActivator.BASEDIR + SEPARATOR + webContentRoot);
+ }
+ configuration.addChild(warSourceDirectory);
+ }
+ if (needsFailOnMissingWebXml) {
+ Xpp3Dom failOnMissingWebXml = new Xpp3Dom("failOnMissingWebXml"); //$NON-NLS-1$
+ failOnMissingWebXml.setValue("false");//$NON-NLS-1$
+ configuration.addChild(failOnMissingWebXml);
+ }
+
plugin.setConfiguration(configuration);
build.getPlugins().add(plugin);
-
- addResource(build, project, null);
}
public static void addResource(Build build, IProject project, String sourceDirectory)
@@ -373,34 +344,36 @@
build.getResources().add(resource);
}
- public static void addMavenEarPlugin(Build build, IProject project, IDataModel m2FacetModel, String ejbArtifactId, boolean addModule) throws JavaModelException {
+ public static void addMavenEarPlugin(Build build, IProject project, IDataModel m2FacetModel, String ejbArtifactId,
+ IProjectFacetVersion earFacetVersion, boolean addSeamModules) throws JavaModelException {
String sourceDirectory = getEarRoot(project);
- build.setSourceDirectory(sourceDirectory);
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
plugin.setArtifactId("maven-ear-plugin"); //$NON-NLS-1$
-
+ plugin.setVersion("2.7");//$NON-NLS-1$
Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
- Xpp3Dom version = new Xpp3Dom("version"); //$NON-NLS-1$
- version.setValue("5"); //$NON-NLS-1$
- configuration.addChild(version);
- Xpp3Dom generateApplicationXml = new Xpp3Dom("generateApplicationXml"); //$NON-NLS-1$
- generateApplicationXml.setValue("true"); //$NON-NLS-1$
- configuration.addChild(generateApplicationXml);
+ if (earFacetVersion != null) {
+ String earVersion = earFacetVersion.getVersionString();
+ if (earVersion.endsWith(".0")) {//$NON-NLS-1$
+ //YYiikes
+ earVersion = ""+Double.valueOf(earVersion).intValue();//$NON-NLS-1$
+ }
+ Xpp3Dom version = new Xpp3Dom("version"); //$NON-NLS-1$
+ version.setValue(earVersion); //$NON-NLS-1$
+ configuration.addChild(version);
+ }
Xpp3Dom defaultLibBundleDir = new Xpp3Dom("defaultLibBundleDir"); //$NON-NLS-1$
defaultLibBundleDir.setValue("lib"); //$NON-NLS-1$
configuration.addChild(defaultLibBundleDir);
- Xpp3Dom earSourceDirectory = new Xpp3Dom("earSourceDirectory"); //$NON-NLS-1$
- earSourceDirectory.setValue(sourceDirectory);
- configuration.addChild(earSourceDirectory);
+ if(!"src/main/application".equals(sourceDirectory)) {//$NON-NLS-1$
+ Xpp3Dom earSourceDirectory = new Xpp3Dom("earSourceDirectory"); //$NON-NLS-1$
+ earSourceDirectory.setValue(sourceDirectory);
+ configuration.addChild(earSourceDirectory);
+ }
- if (addModule) {
+ if (addSeamModules) {
Xpp3Dom modules = new Xpp3Dom("modules"); //$NON-NLS-1$
configuration.addChild(modules);
-
- Xpp3Dom seamModule = getEarModule("ejbModule", "org.jboss.seam", //$NON-NLS-1$ //$NON-NLS-2$
- "jboss-seam", ROOT_DIR, null); //$NON-NLS-1$ //$NON-NLS-2$
- modules.addChild(seamModule);
if (ejbArtifactId != null) {
String ejbModuleName = ejbArtifactId + ".jar"; //$NON-NLS-1$
@@ -432,15 +405,10 @@
"commons-digester", "commons-digester", "/lib", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
modules.addChild(commonDigester);
- //Xpp3Dom mvel14 = getEarModule("jarModule", //$NON-NLS-1$
- // "org.mvel", "mvel14", "/", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- //modules.addChild(mvel14);
}
plugin.setConfiguration(configuration);
build.getPlugins().add(plugin);
-
- addResource(build, project, sourceDirectory);
}
private static Xpp3Dom getEarModule(String module,
@@ -467,20 +435,22 @@
return earModule;
}
- public static void addMavenEjbPlugin(Build build, IProject project) throws JavaModelException {
- org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
- plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
- plugin.setArtifactId("maven-ejb-plugin"); //$NON-NLS-1$
- plugin.setInherited("true"); //$NON-NLS-1$
-
- Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
- Xpp3Dom ejbVersion = new Xpp3Dom("ejbVersion"); //$NON-NLS-1$
- ejbVersion.setValue("3.0"); //$NON-NLS-1$
- configuration.addChild(ejbVersion);
- plugin.setConfiguration(configuration);
- build.getPlugins().add(plugin);
-
- addResource(build, project, null);
+ public static void addMavenEjbPlugin(Build build, IProject project, IProjectFacetVersion ejbFacetVersion) throws JavaModelException {
+ if (ejbFacetVersion != null) {
+ String version = ejbFacetVersion.getVersionString();
+ if (!"2.1".equals(version)) { //$NON-NLS-1$
+ org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
+ plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
+ plugin.setArtifactId("maven-ejb-plugin"); //$NON-NLS-1$
+ plugin.setVersion("2.3"); //$NON-NLS-1$
+ Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ Xpp3Dom ejbVersion = new Xpp3Dom("ejbVersion"); //$NON-NLS-1$
+ ejbVersion.setValue(version);
+ configuration.addChild(ejbVersion);
+ plugin.setConfiguration(configuration);
+ build.getPlugins().add(plugin);
+ }
+ }
}
public static String getOutputDirectory(IJavaProject javaProject) throws CoreException {
@@ -512,12 +482,21 @@
addProperties(projectModel,libraryModel);
addRepositories(projectModel,libraryModel);
addPlugins(projectModel,libraryModel);
- addDependencies(projectModel,libraryModel);
+
+ DependencyManagement depMgtProject = projectModel.getDependencyManagement();
+ DependencyManagement depMgtLibrary = libraryModel.getDependencyManagement();
+ if (depMgtLibrary != null && !depMgtLibrary.getDependencies().isEmpty()) {
+ if (depMgtProject == null) {
+ depMgtProject = PomFactory.eINSTANCE.createDependencyManagement();
+ projectModel.setDependencyManagement(depMgtProject);
+ }
+ addDependencies(projectModel.getDependencyManagement().getDependencies(),libraryModel.getDependencyManagement().getDependencies());
+ }
+ //getDependencies() never returns null
+ addDependencies(projectModel.getDependencies(),libraryModel.getDependencies());
}
- private static void addDependencies(org.eclipse.m2e.model.edit.pom.Model projectModel, org.eclipse.m2e.model.edit.pom.Model libraryModel) {
- List<org.eclipse.m2e.model.edit.pom.Dependency> projectDependencies = projectModel.getDependencies();
- List<org.eclipse.m2e.model.edit.pom.Dependency> libraryDependencies = libraryModel.getDependencies();
+ private static void addDependencies(List<org.eclipse.m2e.model.edit.pom.Dependency> projectDependencies , List<org.eclipse.m2e.model.edit.pom.Dependency> libraryDependencies) {
for (Dependency dependency:libraryDependencies) {
if (!dependencyExists(dependency,projectDependencies)) {
Dependency newDependency = (Dependency) EcoreUtil.copy(dependency);
@@ -527,8 +506,7 @@
}
- private static boolean dependencyExists(Dependency dependency,
- List<Dependency> projectDependencies) {
+ private static boolean dependencyExists(Dependency dependency, List<Dependency> projectDependencies) {
String groupId = dependency.getGroupId();
String artifactId = dependency.getArtifactId();
if (artifactId == null) {
@@ -733,12 +711,13 @@
public static void addCompilerPlugin(Build build, IProject project) {
String compilerLevel = JavaFacetUtils.getCompilerLevel(project);
- if (compilerLevel == null) {
+ if (compilerLevel == null || DEFAULT_COMPILER_LEVEL.equals(compilerLevel)) {
return;
}
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
plugin.setArtifactId("maven-compiler-plugin"); //$NON-NLS-1$
+ plugin.setVersion("2.3.2");
Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
Xpp3Dom source = new Xpp3Dom("source"); //$NON-NLS-1$
source.setValue(compilerLevel); //$NON-NLS-1$
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/ProjectUtil.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/ProjectUtil.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/ProjectUtil.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -16,10 +16,15 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualComponent;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
/**
* A utility class for Eclipse Projects.
@@ -135,4 +140,20 @@
return relative.replace('\\', '/'); //$NON-NLS-1$ //$NON-NLS-2$
}
+ public static void removeWTPContainers(IDataModel m2FacetModel, IProject project) throws JavaModelException {
+ if (m2FacetModel != null && project != null && m2FacetModel.getBooleanProperty(IJBossMavenConstants.REMOVE_WTP_CLASSPATH_CONTAINERS)) {
+ IJavaProject javaProject = JavaCore.create(project);
+ if(javaProject != null) {
+ // remove classpatch container from JavaProject
+ ArrayList<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
+ for(IClasspathEntry entry : javaProject.getRawClasspath()) {
+ String path = entry.getPath().toString();
+ if(path != null && !path.startsWith("org.eclipse.jst.j2ee.internal.")) {
+ newEntries.add(entry);
+ }
+ }
+ javaProject.setRawClasspath(newEntries.toArray(new IClasspathEntry[newEntries.size()]), null);
+ }
+ }
+ }
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDataModelProvider.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -98,8 +98,8 @@
}
}
if(propertyName.equals(IJBossMavenConstants.PACKAGING)){
- String groupId = getStringProperty(IJBossMavenConstants.PACKAGING);
- if (groupId == null || groupId.trim().length() <= 0) {
+ String packaging = getStringProperty(IJBossMavenConstants.PACKAGING);
+ if (packaging == null || packaging.trim().length() <= 0) {
status = new Status(IStatus.ERROR, MavenCoreActivator.PLUGIN_ID , Messages.MavenFacetInstallPage_The_packaging_field_is_required);
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/internal/project/facet/MavenFacetInstallDelegate.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -40,6 +40,7 @@
import org.jboss.tools.maven.core.IJBossMavenConstants;
import org.jboss.tools.maven.core.MavenCoreActivator;
import org.jboss.tools.maven.core.Messages;
+import org.jboss.tools.maven.core.ProjectUtil;
import org.jboss.tools.maven.core.libprov.MavenLibraryProviderInstallOperation;
/**
@@ -70,80 +71,74 @@
if (!pom.exists()) {
Model model = new Model();
model.setModelVersion(IJBossMavenConstants.MAVEN_MODEL_VERSION);
- model.setGroupId(config
- .getStringProperty(IJBossMavenConstants.GROUP_ID));
- String artifactId = config
- .getStringProperty(IJBossMavenConstants.ARTIFACT_ID);
+ model.setGroupId(config.getStringProperty(IJBossMavenConstants.GROUP_ID));
+ String artifactId = config.getStringProperty(IJBossMavenConstants.ARTIFACT_ID);
model.setArtifactId(artifactId);
- model.setVersion(config
- .getStringProperty(IJBossMavenConstants.VERSION));
- model.setName(config
- .getStringProperty(IJBossMavenConstants.NAME));
- model.setPackaging(config
- .getStringProperty(IJBossMavenConstants.PACKAGING));
- model.setDescription(config
- .getStringProperty(IJBossMavenConstants.DESCRIPTION));
+ model.setVersion(config.getStringProperty(IJBossMavenConstants.VERSION));
+ model.setName(config.getStringProperty(IJBossMavenConstants.NAME));
+ String packaging = config.getStringProperty(IJBossMavenConstants.PACKAGING);
+ model.setPackaging(packaging);
+ String description = config.getStringProperty(IJBossMavenConstants.DESCRIPTION);
+ if (description != null && description.trim().length() > 0) {
+ model.setDescription(description);
+ }
Build build = new Build();
model.setBuild(build);
// build.setFinalName(artifactId);
if (fpwc.hasProjectFacet(JavaFacet.FACET)) {
- String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
- build.setOutputDirectory(outputDirectory);
+// String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
+// if (!"${basedir}/target/classes".equals(outputDirectory)) {
+// build.setOutputDirectory(outputDirectory);
+// }
String sourceDirectory = MavenCoreActivator.getSourceDirectory(javaProject);
- if (sourceDirectory != null) {
+ if (sourceDirectory != null && !"${basedir}/src/main/java".equals(sourceDirectory)) {
build.setSourceDirectory(sourceDirectory);
}
+ MavenCoreActivator.addResource(build, project, sourceDirectory);
+
}
- if (fpwc.hasProjectFacet(WebFacetUtils.WEB_FACET)) {
-
- MavenCoreActivator.addMavenWarPlugin(build, project);
+ IProjectFacetVersion webFacetVersion = fpwc.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
+ if (webFacetVersion != null && "war".equals(packaging)) {
+ MavenCoreActivator.addMavenWarPlugin(build, project, webFacetVersion);
}
- if (fpwc.hasProjectFacet(IJ2EEFacetConstants.EJB_FACET)) {
-
- MavenCoreActivator.addMavenEjbPlugin(build, project);
+ IProjectFacetVersion ejbFacetVersion = fpwc.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
+ if (ejbFacetVersion != null && "ejb".equals(packaging)) {
+ MavenCoreActivator.addMavenEjbPlugin(build, project, ejbFacetVersion);
}
- if (fpwc
- .hasProjectFacet(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET)) {
- MavenCoreActivator.addMavenEarPlugin(build, project,
- config, null, false);
- MavenCoreActivator.createMavenProject(project.getName(),
- monitor, model, true);
+ IProjectFacetVersion earFacetVersion = fpwc.getProjectFacetVersion(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET);
+ if (earFacetVersion != null && "ear".equals(packaging)) {
+ MavenCoreActivator.addMavenEarPlugin(build, project, config, null, earFacetVersion, false);
+ MavenCoreActivator.createMavenProject(project.getName(), monitor, model, true);
}
IProjectFacet seamFacet = ProjectFacetsManager.getProjectFacet(SEAM_FACET_ID);
- if (!fpwc.hasProjectFacet(seamFacet)) {
+ if (!"pom".equals(packaging) && !fpwc.hasProjectFacet(seamFacet)) {
MavenCoreActivator.addCompilerPlugin(build, project);
}
if (!pom.exists()) {
- MavenModelManager modelManager = MavenPlugin.getDefault()
- .getMavenModelManager();
+ MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
modelManager.createMavenModel(pom, model);
}
}
- boolean hasMavenNature = MavenCoreActivator.addMavenNature(project,
- monitor);
+ MavenCoreActivator.addMavenNature(project, monitor);
if (fpwc.hasProjectFacet(WebFacetUtils.WEB_FACET)) {
IClasspathAttribute attribute = JavaCore
.newClasspathAttribute(
IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
- ClasspathDependencyUtil.getDefaultRuntimePath(
- true).toString());
- MavenCoreActivator.addClasspathAttribute(javaProject,
- attribute, monitor);
+ ClasspathDependencyUtil.getDefaultRuntimePath(true).toString());
+ MavenCoreActivator.addClasspathAttribute(javaProject, attribute, monitor);
}
// FIXME
IClasspathAttribute attribute = JavaCore.newClasspathAttribute(
MavenCoreActivator.OWNER_PROJECT_FACETS_ATTR,
IJBossMavenConstants.M2_FACET_ID);
- MavenCoreActivator.addClasspathAttribute(javaProject, attribute,
- monitor);
+ MavenCoreActivator.addClasspathAttribute(javaProject, attribute, monitor);
- List<LibraryProviderOperationConfig> configs = MavenCoreActivator
- .getLibraryProviderOperationConfigs();
+ List<LibraryProviderOperationConfig> configs = MavenCoreActivator.getLibraryProviderOperationConfigs();
if (configs.size() > 0) {
MavenLibraryProviderInstallOperation operation = new MavenLibraryProviderInstallOperation();
for (LibraryProviderOperationConfig libraryProviderOperationConfig : configs) {
@@ -151,6 +146,8 @@
}
configs.clear();
}
+
+ ProjectUtil.removeWTPContainers(config, project);
} finally {
if (fpwc != null) {
fpwc.dispose();
Modified: trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -15,6 +15,7 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.project.MavenProject;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ProjectScope;
@@ -86,7 +87,7 @@
private boolean isHibernateProject(MavenProject mavenProject) {
List<Artifact> artifacts = new ArrayList<Artifact>();
- ArtifactFilter filter = new org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter(
+ ArtifactFilter filter = new ScopeArtifactFilter(
Artifact.SCOPE_TEST);
for (Artifact artifact : mavenProject.getArtifacts()) {
if (filter.include(artifact)) {
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml 2012-02-16 18:19:57 UTC (rev 38840)
@@ -85,6 +85,7 @@
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>${seam.version}</version>
+ <type>ejb</type>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
@@ -311,7 +312,6 @@
<artifactId>jboss-deployers-client-spi</artifactId>
</exclusion>
</exclusions>
-
</dependency>
<dependency>
<groupId>org.jboss.seam.embedded</groupId>
@@ -503,6 +503,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
@@ -511,7 +512,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
- <version>2.5</version>
+ <version>2.7.2</version>
<configuration>
<argLine>-Dsun.lang.ClassLoader.allowArraySyntax=true</argLine>
</configuration>
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -43,12 +43,11 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.MavenModelManager;
import org.eclipse.m2e.core.internal.IMavenConstants;
-import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.internal.project.ResolverConfigurationIO;
-import org.eclipse.m2e.core.internal.project.registry.MavenProjectManager;
import org.eclipse.m2e.core.project.ResolverConfiguration;
import org.eclipse.m2e.model.edit.pom.Configuration;
import org.eclipse.m2e.model.edit.pom.Plugin;
@@ -67,6 +66,7 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.maven.core.IJBossMavenConstants;
import org.jboss.tools.maven.core.MavenCoreActivator;
+import org.jboss.tools.maven.core.ProjectUtil;
import org.jboss.tools.maven.core.xpl.ProjectUpdater;
import org.jboss.tools.seam.core.SeamUtil;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
@@ -144,8 +144,7 @@
}
- public void configureSeamProject(IDataModel seamFacetModel,
- IDataModel m2FacetModel) {
+ public void configureSeamProject(IDataModel seamFacetModel, IDataModel m2FacetModel) {
Assert.isNotNull(seamFacetModel);
Assert.isNotNull(m2FacetModel);
webProjectName = seamFacetModel.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
@@ -162,11 +161,9 @@
configureParentProject(m2FacetModel, seamFacetModel);
configureWarProject(m2FacetModel, seamFacetModel);
configureTestProject(m2FacetModel, seamFacetModel);
- if (!SeamFacetAbstractInstallDelegate
- .isWarConfiguration(seamFacetModel)) {
+ if (!SeamFacetAbstractInstallDelegate.isWarConfiguration(seamFacetModel)) {
configureEjbProject(m2FacetModel, seamFacetModel);
configureEarProject(m2FacetModel, seamFacetModel);
-
}
}
@@ -231,8 +228,7 @@
dependency = new Dependency();
dependency.setGroupId("org.testng"); //$NON-NLS-1$
dependency.setArtifactId("testng"); //$NON-NLS-1$
- // FIXME
- dependency.setVersion("${testng.version}"); //$NON-NLS-1$
+ //dependency.setVersion("${testng.version}"); //$NON-NLS-1$
dependency.setClassifier("jdk15"); //$NON-NLS-1$
dependency.setScope("compile"); //$NON-NLS-1$
dependencies.add(dependency);
@@ -257,7 +253,6 @@
dependency.setGroupId(groupId);
dependency.setArtifactId(artifactId);
dependency.setType("war"); //$NON-NLS-1$
- dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setScope("test"); //$NON-NLS-1$
dependencies.add(dependency);
@@ -267,7 +262,6 @@
dependency.setGroupId(groupId);
dependency.setArtifactId(ejbArtifactId);
dependency.setType("ejb"); //$NON-NLS-1$
- dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setScope("test"); //$NON-NLS-1$
dependencies.add(dependency);
}
@@ -297,9 +291,9 @@
if (sourceDirectory != null) {
build.setTestSourceDirectory(sourceDirectory);
}
- String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
- build.setOutputDirectory(outputDirectory);
- build.setTestOutputDirectory(outputDirectory);
+ //String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
+ //build.setOutputDirectory(outputDirectory);
+ //build.setTestOutputDirectory(outputDirectory);
MavenCoreActivator.addResource(build, project, sourceDirectory);
Resource resource = new Resource();
@@ -361,21 +355,17 @@
Dependency dependency = new Dependency();
dependency.setGroupId(m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID));
dependency.setArtifactId(ejbProjectName);
- dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setType("ejb"); //$NON-NLS-1$
- dependency.setScope("runtime"); //$NON-NLS-1$
dependencies.add(dependency);
dependency = new Dependency();
dependency.setGroupId(m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID));
dependency.setArtifactId(webProjectName);
- dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setType("war"); //$NON-NLS-1$
- dependency.setScope("runtime"); //$NON-NLS-1$
dependencies.add(dependency);
dependency = getSeamDependency();
- dependency.setVersion("${seam.version}"); //$NON-NLS-1$
+ //dependency.setVersion("${seam.version}"); //$NON-NLS-1$
dependency.setType("ejb"); //$NON-NLS-1$
dependency.setScope("compile"); //$NON-NLS-1$
List<Exclusion> exclusions = dependency.getExclusions();
@@ -466,16 +456,9 @@
Build build = new Build();
try {
build.setFinalName(earProjectName);
-
- String sourceDirectory = MavenCoreActivator.getEarRoot(project);
- if (sourceDirectory != null) {
- build.setSourceDirectory(sourceDirectory);
- }
- build.setOutputDirectory("target/classes"); //$NON-NLS-1$
- MavenCoreActivator.addMavenEarPlugin(build, project, m2FacetModel, ejbArtifactId, true);
+ MavenCoreActivator.addMavenEarPlugin(build, project, m2FacetModel, ejbArtifactId, JavaEEProjectUtilities.ENTERPRISE_APPLICATION_50, true);
model.setBuild(build);
MavenCoreActivator.createMavenProject(earProjectName, null, model, true);
- removeWTPContainers(m2FacetModel, project);
} catch (Exception e) {
MavenSeamActivator.log(e);
}
@@ -545,16 +528,17 @@
try {
// FIXME
//build.setFinalName(ejbArtifactId);
- String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
- build.setOutputDirectory(outputDirectory);
+ //String outputDirectory = MavenCoreActivator.getOutputDirectory(javaProject);
+ //build.setOutputDirectory(outputDirectory);
String sourceDirectory = MavenCoreActivator.getSourceDirectory(javaProject);
if (sourceDirectory != null) {
build.setSourceDirectory(sourceDirectory);
}
- MavenCoreActivator.addMavenEjbPlugin(build, project);
+ MavenCoreActivator.addMavenEjbPlugin(build, project, JavaEEProjectUtilities.EJB_30);
model.setBuild(build);
MavenCoreActivator.createMavenProject(ejbProjectName, null, model, true);
- removeWTPContainers(m2FacetModel, project);
+
+ ProjectUtil.removeWTPContainers(m2FacetModel, project);
} catch (Exception e) {
MavenSeamActivator.log(e);
}
@@ -642,7 +626,7 @@
dependency.setGroupId("org.jboss.seam"); //$NON-NLS-1$
dependency.setArtifactId("jboss-seam-debug"); //$NON-NLS-1$
// FIXME
- dependency.setVersion("${seam.version}"); //$NON-NLS-1$
+ //dependency.setVersion("${seam.version}"); //$NON-NLS-1$
addDependency(pomFile,dependency);
@@ -737,14 +721,14 @@
dependency = new Dependency();
dependency.setGroupId(m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID));
dependency.setArtifactId(ejbProjectName);
- dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setType("ejb"); //$NON-NLS-1$
dependency.setScope("provided"); //$NON-NLS-1$
addDependency(pomFile,dependency);
}
updateProject(pomFile, new WarProjectUpdater(webProject));
- removeWTPContainers(m2FacetModel, webProject);
+
+ ProjectUtil.removeWTPContainers(m2FacetModel, webProject);
} catch (Exception e) {
MavenSeamActivator.log(e);
}
@@ -780,33 +764,6 @@
return newPlugin;
}
- private void removeWTPContainers(IDataModel m2FacetModel,
- IProject webProject) throws JavaModelException {
- if (m2FacetModel.getBooleanProperty(IJBossMavenConstants.REMOVE_WTP_CLASSPATH_CONTAINERS)) {
- IJavaProject javaProject = JavaCore.create(webProject);
- IClasspathEntry[] entries = javaProject.getRawClasspath();
- List<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
- for (int i = 0; i < entries.length; i++) {
- IClasspathEntry entry = entries[i];
- boolean add = true;
- if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- // FIXME
- IPath path = entry.getPath();
- if (path != null) {
- String value = path.toString();
- if (value.startsWith("org.eclipse.jst")) { //$NON-NLS-1$
- add = false;
- }
- }
- }
- if (add) {
- newEntries.add(entry);
- }
- }
- javaProject.setRawClasspath(newEntries.toArray(new IClasspathEntry[0]), null);
- }
- }
-
private Dependency getHibernateValidator() {
Dependency dependency = new Dependency();
dependency.setGroupId("org.hibernate"); //$NON-NLS-1$
@@ -851,6 +808,7 @@
dependency = new Dependency();
dependency.setGroupId("org.jboss.seam"); //$NON-NLS-1$
dependency.setArtifactId("jboss-seam"); //$NON-NLS-1$
+ dependency.setType("ejb");
return dependency;
}
@@ -860,7 +818,7 @@
InputStream inputStream = null;
try {
URL resolvedURL = FileLocator.resolve(parentPomEntryURL);
- MavenModelManager modelManager = MavenPlugin.getDefault().getMavenModelManager();
+ MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
inputStream = resolvedURL.openStream();
Model model = modelManager.readMavenModel(inputStream);
model.setArtifactId(parentArtifactId);
@@ -899,6 +857,7 @@
try {
Model rootPomModel = modelManager.readMavenModel(rootPom);
List<Dependency> seamDependencies = rootPomModel.getDependencyManagement().getDependencies();
+
setArtifactVersion("jsf.version", properties, "javax.faces", "jsf-api", seamDependencies); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String richfacesVersion = setArtifactVersion("richfaces.version", properties, "org.richfaces.framework", "richfaces-impl", seamDependencies); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (richfacesVersion == null) {
@@ -950,11 +909,26 @@
}
List<String> modules = model.getModules();
+
modules.add("../" + artifactId); //$NON-NLS-1$
if (!SeamFacetAbstractInstallDelegate
.isWarConfiguration(seamFacetModel)) {
modules.add("../" + ejbArtifactId); //$NON-NLS-1$
modules.add("../" + earArtifactId); //$NON-NLS-1$
+
+ Dependency dependency = new Dependency();
+ dependency.setGroupId(model.getGroupId());
+ dependency.setArtifactId(ejbProjectName);
+ dependency.setType("ejb"); //$NON-NLS-1$
+ dependency.setVersion(projectVersion);
+ model.getDependencyManagement().getDependencies().add(0, dependency);
+
+ dependency = new Dependency();
+ dependency.setGroupId(model.getGroupId());
+ dependency.setArtifactId(webProjectName);
+ dependency.setType("war"); //$NON-NLS-1$
+ dependency.setVersion(projectVersion);
+ model.getDependencyManagement().getDependencies().add(1, dependency);
}
webProjectName = seamFacetModel.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
@@ -963,7 +937,6 @@
location = location.append(parentProjectName);
MavenCoreActivator.createMavenProject(parentProjectName, null, model, false, location);
// disable workspace resolution
- MavenProjectManager projectManager = MavenPluginActivator.getDefault().getMavenProjectManager();
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(parentProjectName);
ResolverConfiguration configuration = ResolverConfigurationIO.readResolverConfiguration(project);
configuration.setResolveWorkspaceProjects(false);
@@ -1117,7 +1090,7 @@
}
configuration.setStringValue(WAR_SOURCE_DIRECTORY, value);
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
boolean first = true;
for (IPath output:outputs) {
if (first) {
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/internal/project/facet/MavenPostInstallListener.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/internal/project/facet/MavenPostInstallListener.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/internal/project/facet/MavenPostInstallListener.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -10,10 +10,8 @@
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetActionEvent;
import org.jboss.tools.maven.core.IJBossMavenConstants;
-import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.seam.MavenSeamActivator;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
public class MavenPostInstallListener implements IFacetedProjectListener {
@@ -31,11 +29,10 @@
boolean isM2Project = false;
for (IProjectFacetVersion projectFacetVersion : projectFacets) {
IProjectFacet projectFacet = projectFacetVersion.getProjectFacet();
- if (ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(projectFacet
- .getId())) {
+ if (ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(projectFacet.getId())) {
isSeamProject = true;
}
- if (IJBossMavenConstants.M2_FACET_ID.equals(projectFacet.getId())) {
+ else if (IJBossMavenConstants.M2_FACET_ID.equals(projectFacet.getId())) {
isM2Project = true;
}
}
@@ -46,9 +43,8 @@
IDataModel dataModel = (IDataModel) object;
if ( SEAM_FACET_MODEL_PROVIDER.equals(dataModel.getID())) {
seamFacetModel = dataModel;
- }
-
- if ( M2_FACET_MODEL_PROVIDER.equals(dataModel.getID()) ) {
+ }
+ else if ( M2_FACET_MODEL_PROVIDER.equals(dataModel.getID()) ) {
m2FacetModel = dataModel;
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java 2012-02-16 18:17:15 UTC (rev 38839)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java 2012-02-16 18:19:57 UTC (rev 38840)
@@ -128,6 +128,7 @@
packaging.setLayoutData(gd);
String[] items = { "war","ear", "ejb", "jar" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
packaging.setItems(items);
+ synchHelper.synchCombo(packaging, IJBossMavenConstants.PACKAGING, null);
IFacetedProjectWorkingCopy fpwc = null;
try {
@@ -135,8 +136,7 @@
if (!mavenProjectExists) {
if (fpwc.hasProjectFacet(WebFacetUtils.WEB_FACET)) {
packaging.select(0);
- } else if (fpwc
- .hasProjectFacet(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET)) {
+ } else if (fpwc.hasProjectFacet(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET)) {
packaging.select(1);
} else if (fpwc.hasProjectFacet(IJ2EEFacetConstants.EJB_FACET)) {
packaging.select(2);
@@ -147,7 +147,6 @@
String mavenPackaging = getDataModel().getStringProperty(IJBossMavenConstants.PACKAGING);
packaging.setText(mavenPackaging);
}
- synchHelper.synchCombo(packaging, IJBossMavenConstants.PACKAGING, null);
name = createField(composite, Messages.MavenFacetInstallPage_Name, IJBossMavenConstants.NAME);
name.setText(projectName);
@@ -162,6 +161,8 @@
seamVersion.setText("2.1.1.GA"); //$NON-NLS-1$
} else if ("2.2".equals(seamFacetVersion.getVersionString())) { //$NON-NLS-1$
seamVersion.setText("2.2.1.Final"); //$NON-NLS-1$
+ } else if ("2.3".equals(seamFacetVersion.getVersionString())) { //$NON-NLS-1$
+ seamVersion.setText("2.3.0.ALPHA"); //$NON-NLS-1$
}
Button removeWTPContainers = new Button(composite,SWT.CHECK);
removeWTPContainers.setText(Messages.MavenFacetInstallPage_Remove_WTP_Classpath_containers);
14 years, 1 month
JBoss Tools SVN: r38839 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 13:17:15 -0500 (Thu, 16 Feb 2012)
New Revision: 38839
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesLocationPage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesMainPage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/ProjectReadyWizard.java
Log:
organize imports
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesJob.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -11,8 +11,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesLocationPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesLocationPage.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesLocationPage.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -7,10 +7,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart;
-import org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.TreePath;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesMainPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesMainPage.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesMainPage.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -31,7 +31,6 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -3,7 +3,6 @@
import java.util.List;
import org.eclipse.core.resources.IMarker;
-import org.eclipse.jdt.internal.ui.typehierarchy.ShowQualifiedTypeNamesAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesRequirementsPage.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -14,9 +14,6 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard2.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -17,7 +17,6 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -38,7 +37,6 @@
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
-import org.jboss.tools.project.examples.dialog.xpl.QuickFixPage;
import org.jboss.tools.project.examples.model.ProjectExample;
public class NewProjectExamplesWizard2 extends Wizard implements INewWizard {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/ProjectReadyWizard.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/ProjectReadyWizard.java 2012-02-16 17:40:48 UTC (rev 38838)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/ProjectReadyWizard.java 2012-02-16 18:17:15 UTC (rev 38839)
@@ -10,10 +10,8 @@
************************************************************************************/
package org.jboss.tools.project.examples.wizard;
-import java.util.ArrayList;
import java.util.List;
-import org.eclipse.jdt.internal.ui.typehierarchy.ShowQualifiedTypeNamesAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages;
14 years, 1 month
JBoss Tools SVN: r38838 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 12:40:48 -0500 (Thu, 16 Feb 2012)
New Revision: 38838
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml
Log:
change icons for quickstarts
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml 2012-02-16 17:39:50 UTC (rev 38837)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml 2012-02-16 17:40:48 UTC (rev 38838)
@@ -39,7 +39,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-helloworld/cheatsheets/helloworld.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -84,7 +84,7 @@
</fixes>
<importType>maven</importType>
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
@@ -128,7 +128,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-login/cheatsheets/login.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -171,7 +171,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-numberguess/cheatsheets/numberguess.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -215,7 +215,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-kitchensink/cheatsheets/kitchensink.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
<category>JBoss AS 7 Quickstarts</category>
@@ -257,7 +257,7 @@
<welcome type="cheatsheets" url="/poh5-helloworld/cheatsheets/poh5-helloworld.xml"/>
-->
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
</projects>
14 years, 1 month
JBoss Tools SVN: r38837 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 12:39:50 -0500 (Thu, 16 Feb 2012)
New Revision: 38837
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
Log:
change icons for quickstarts
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2012-02-16 17:11:50 UTC (rev 38836)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2012-02-16 17:39:50 UTC (rev 38837)
@@ -35,7 +35,7 @@
</properties>
-->
</mavenArchetype>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -79,7 +79,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-helloworld/cheatsheets/helloworld.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -124,7 +124,7 @@
</fixes>
<importType>maven</importType>
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
@@ -169,7 +169,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-login/cheatsheets/login.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -213,7 +213,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-numberguess/cheatsheets/numberguess.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
@@ -257,7 +257,7 @@
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
<welcome type="cheatsheets" url="/jboss-as-kitchensink/cheatsheets/kitchensink.xml"/>
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
<project>
<category>JBoss Quickstarts</category>
@@ -300,7 +300,7 @@
<welcome type="cheatsheets" url="/poh5-helloworld/cheatsheets/poh5-helloworld.xml"/>
-->
<tags>central</tags>
- <icon path="icons/jbossas7.png" />
+ <icon path="icons/jboss.png" />
</project>
</projects>
14 years, 1 month
JBoss Tools SVN: r38836 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-02-16 12:11:50 -0500 (Thu, 16 Feb 2012)
New Revision: 38836
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
[JBIDE-10936]
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java 2012-02-16 16:58:10 UTC (rev 38835)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java 2012-02-16 17:11:50 UTC (rev 38836)
@@ -29,7 +29,7 @@
private String userName;
public OpenShiftPasswordStorageKey(String platform, String userName) {
- this.userName = userName;
+ this.userName = platform;
this.platform = userName;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-16 16:58:10 UTC (rev 38835)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-16 17:11:50 UTC (rev 38836)
@@ -52,7 +52,7 @@
update(storageKey, password);
}
- private void update(IStorageKey key, String password) throws SecurePasswordStoreException {
+ public void update(IStorageKey key, String password) throws SecurePasswordStoreException {
if (!storageKey.equals(key) || isPasswordChanged(password)) {
storeInPreferences(this.password = password, this.storageKey = key);
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 16:58:10 UTC (rev 38835)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 17:11:50 UTC (rev 38836)
@@ -30,13 +30,11 @@
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
@@ -49,9 +47,6 @@
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
/**
* @author Andre Dietisheim
* @author Xavier Coulon
@@ -61,16 +56,14 @@
protected static final String OPENSHIFT_EXPRESS_SIGNUP_URL = "https://openshift.redhat.com/app/user/new/express"; //$NON-NLS-1$
private final CredentialsWizardPageModel pageModel;
-
- private final IUserAwareModel wizardModel;
private Text rhLoginText = null;
private Text passwordText = null;
public CredentialsWizardPage(IWizard wizard, IUserAwareModel wizardModel) {
- super("OpenShift Connection", "Please provide your OpenShift Express credentials.", "Server Connection", wizard);
+ super("Server connection", "Please provide your OpenShift Express credentials.", "Server Connection",
+ wizard);
this.pageModel = new CredentialsWizardPageModel(wizardModel);
- this.wizardModel = wizardModel;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -78,38 +71,45 @@
Link signupLink = new Link(container, SWT.WRAP);
signupLink.setText("If you do not have an account on OpenShift Express, please sign up <a>here</a>.");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(signupLink);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(signupLink);
signupLink.addSelectionListener(onSignupLinkClicked());
Label fillerLabel = new Label(container, SWT.NONE);
- GridDataFactory.fillDefaults().span(2, 1).hint(SWT.DEFAULT, 6).applyTo(fillerLabel);
+ GridDataFactory.fillDefaults()
+ .span(2, 1).hint(SWT.DEFAULT, 6).applyTo(fillerLabel);
Label rhLoginLabel = new Label(container, SWT.NONE);
rhLoginLabel.setText("&Username");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
rhLoginText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(rhLoginText);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(rhLoginText);
UIUtils.selectAllOnFocus(rhLoginText);
- final IObservableValue rhLoginObservable = BeanProperties.value(CredentialsWizardPageModel.PROPERTY_RHLOGIN)
- .observe(pageModel);
+ final IObservableValue rhLoginObservable =
+ BeanProperties.value(CredentialsWizardPageModel.PROPERTY_RHLOGIN).observe(pageModel);
dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(rhLoginText), rhLoginObservable);
Label passwordLabel = new Label(container, SWT.NONE);
passwordLabel.setText("&Password");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(passwordText);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(passwordText);
UIUtils.selectAllOnFocus(passwordText);
- final IObservableValue passwordModelObservable = BeanProperties.value(
- CredentialsWizardPageModel.PROPERTY_PASSWORD).observe(pageModel);
+ final IObservableValue passwordModelObservable =
+ BeanProperties.value(CredentialsWizardPageModel.PROPERTY_PASSWORD).observe(pageModel);
final ISWTObservableValue passwordTextObservable = WidgetProperties.text(SWT.Modify).observe(passwordText);
dbc.bindValue(passwordTextObservable, passwordModelObservable);
- IObservableValue credentialsStatusObservable = BeanProperties.value(
- CredentialsWizardPageModel.PROPERTY_CREDENTIALS_STATUS).observe(pageModel);
- dbc.addValidationStatusProvider(new CredentialsInputValidator(rhLoginObservable, passwordModelObservable));
- final CredentialsStatusValidator credentialsStatusValidator = new CredentialsStatusValidator(
- credentialsStatusObservable, passwordTextObservable);
+ IObservableValue credentialsStatusObservable =
+ BeanProperties.value(CredentialsWizardPageModel.PROPERTY_CREDENTIALS_STATUS).observe(pageModel);
+ dbc.addValidationStatusProvider(
+ new CredentialsInputValidator(rhLoginObservable, passwordModelObservable));
+ final CredentialsStatusValidator credentialsStatusValidator =
+ new CredentialsStatusValidator(credentialsStatusObservable, passwordTextObservable);
dbc.addValidationStatusProvider(credentialsStatusValidator);
ControlDecorationSupport.create(credentialsStatusValidator, SWT.LEFT | SWT.TOP);
@@ -117,11 +117,12 @@
// the text fields
Button rememberPasswordCheckBox = new Button(container, SWT.CHECK);
rememberPasswordCheckBox.setText("Save password (could trigger secure storage login)");
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(rememberPasswordCheckBox);
- final IObservableValue rememberPasswordModelObservable = BeanProperties.value(
- CredentialsWizardPageModel.PROPERTY_REMEMBER_PASSWORD).observe(pageModel);
- final ISWTObservableValue rememberPasswordCheckBoxObservable = WidgetProperties.selection().observe(
- rememberPasswordCheckBox);
+ GridDataFactory.fillDefaults()
+ .align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(rememberPasswordCheckBox);
+ final IObservableValue rememberPasswordModelObservable =
+ BeanProperties.value(CredentialsWizardPageModel.PROPERTY_REMEMBER_PASSWORD).observe(pageModel);
+ final ISWTObservableValue rememberPasswordCheckBoxObservable =
+ WidgetProperties.selection().observe(rememberPasswordCheckBox);
dbc.bindValue(rememberPasswordCheckBoxObservable, rememberPasswordModelObservable);
}
@@ -145,7 +146,8 @@
@Override
protected void onPageActivated(DataBindingContext dbc) {
super.onPageActivated(dbc);
- if (pageModel.getRhLogin() == null || pageModel.getRhLogin().isEmpty() && rhLoginText != null) {
+ if (StringUtils.isEmpty(pageModel.getRhLogin())
+ && rhLoginText != null) {
rhLoginText.setFocus();
} else if (passwordText != null) {
passwordText.setFocus();
@@ -191,7 +193,8 @@
private final IObservableValue passwordObservable;
- public CredentialsInputValidator(IObservableValue rhLoginObservable, IObservableValue passwordObservable) {
+ public CredentialsInputValidator(IObservableValue rhLoginObservable,
+ IObservableValue passwordObservable) {
this.rhLoginObservable = rhLoginObservable;
this.passwordObservable = passwordObservable;
}
@@ -202,7 +205,8 @@
// something..
final String rhLoginValue = (String) rhLoginObservable.getValue();
final String passwordValue = (String) passwordObservable.getValue();
- if (!StringUtils.isEmpty(rhLoginValue) && !StringUtils.isEmpty(passwordValue)) {
+ if (!StringUtils.isEmpty(rhLoginValue)
+ && !StringUtils.isEmpty(passwordValue)) {
return ValidationStatus.ok();
}
return ValidationStatus.cancel("Please provide your OpenShift Express user credentials");
@@ -226,8 +230,7 @@
final IStatus credentialsValidityStatus = (IStatus) credentialsStatusObservable.getValue();
if (credentialsValidityStatus != null) {
- final IStatus credentialsValidity = pageModel.getCredentialsStatus();
- return credentialsValidity;
+ return pageModel.getCredentialsStatus();
}
return ValidationStatus.ok();
}
@@ -238,7 +241,5 @@
targets.add(passwordTextObservable);
return targets;
}
-
}
-
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-16 16:58:10 UTC (rev 38835)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-16 17:11:50 UTC (rev 38836)
@@ -50,13 +50,15 @@
private SecurePasswordStore store;
private IUserAwareModel wizardModel;
+
+ private OpenShiftPasswordStorageKey key;
public CredentialsWizardPageModel(IUserAwareModel wizardModel) {
this.wizardModel = wizardModel;
this.rhLoginPreferenceValue = new StringPreferenceValue(RHLOGIN_PREFS_KEY, OpenShiftUIActivator.PLUGIN_ID);
this.libraServer = initLibraServer();
this.rhLogin = initRhLogin();
- this.store = initSecureStore(libraServer, rhLogin);
+ initSecureStore(libraServer, rhLogin);
this.password = initPassword();
resetCredentialsStatus();
}
@@ -70,33 +72,36 @@
return null;
}
- private SecurePasswordStore initSecureStore(final String platform, final String rhLogin) {
- SecurePasswordStore store = null;
- final OpenShiftPasswordStorageKey key = new OpenShiftPasswordStorageKey(platform, rhLogin);
- if (key != null) {
- store = new SecurePasswordStore(key);
- }
- return store;
+ private void initSecureStore(final String platform, final String rhLogin) {
+ this.key = new OpenShiftPasswordStorageKey(platform, rhLogin);
+ this.store = new SecurePasswordStore(key);
}
protected String initRhLogin() {
String rhLogin = null;
+
IUser user = wizardModel.getUser();
+ if (user == null) {
+ user = UserModel.getDefault().getRecentUser();
+ }
if (user != null) {
rhLogin = user.getRhlogin();
} else {
rhLogin = rhLoginPreferenceValue.get();
- if (rhLogin == null || rhLogin.length() == 0) {
+ if (rhLogin == null
+ || rhLogin.length() == 0) {
rhLogin = getConfiguredUserName();
}
}
+
return rhLogin;
}
-
+
protected String initPassword() {
String password = null;
if (!StringUtils.isEmpty(libraServer)
- && !StringUtils.isEmpty(rhLogin) && store != null) {
+ && !StringUtils.isEmpty(rhLogin)
+ && store != null) {
try {
password = store.getPassword();
setRememberPassword(!StringUtils.isEmpty(password));
@@ -107,10 +112,11 @@
return password;
}
- private void storePassword(String password) {
+ private void storePassword(IUser user) {
try {
if (store != null) {
- store.setPassword(password);
+ OpenShiftPasswordStorageKey key = new OpenShiftPasswordStorageKey(libraServer, user.getRhlogin());
+ store.update(key, password);
}
} catch (SecurePasswordStoreException e) {
Logger.error(e.getMessage(), e);
@@ -226,7 +232,7 @@
private void storeUser(IUser user) {
wizardModel.setUser(user);
if (rememberPassword) {
- storePassword(password);
+ storePassword(user);
} else {
erasePasswordStore();
}
14 years, 1 month
JBoss Tools SVN: r38835 - in trunk/maven/plugins: org.jboss.tools.maven.profiles.ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 11:58:10 -0500 (Thu, 16 Feb 2012)
New Revision: 38835
Modified:
trunk/maven/plugins/org.jboss.tools.maven.profiles.core/
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/
Log:
Add target to .svnignore
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.profiles.core
___________________________________________________________________
Added: svn:ignore
+ target
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui
___________________________________________________________________
Added: svn:ignore
+ target
14 years, 1 month
JBoss Tools SVN: r38834 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/ui/action and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-16 11:52:55 -0500 (Thu, 16 Feb 2012)
New Revision: 38834
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/OpenConnectionDialogActionDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/RefreshViewerActionDelegate.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenConnectionDialogActionDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserActionDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogAction.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/Logger.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
Fixed - JBIDE-10832 - OpenShift UseCase: Creation of app fails when user has no domain
https://issues.jboss.org/browse/JBIDE-10832
Open - JBIDE-10812 - OpenShift console: can select multiple apps but then only 1 gets deleted. List is not refreshed.
https://issues.jboss.org/browse/JBIDE-10812
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/plugin.xml 2012-02-16 16:52:55 UTC (rev 38834)
@@ -485,7 +485,7 @@
id="org.jboss.tools.openshift.express.ui.viewer.expressConsoleViewContribution"
targetID="org.jboss.tools.openshift.express.ui.viewer.expressConsoleView">
<action
- class="org.jboss.tools.openshift.express.internal.ui.action.RefreshUserActionDelegate"
+ class="org.jboss.tools.openshift.express.internal.ui.viewer.actionDelegate.RefreshViewerActionDelegate"
icon="icons/refresh.gif"
id="org.jboss.tools.openshift.express.ui.viewActions.refreshAction"
label="Refresh"
@@ -493,7 +493,7 @@
toolbarPath="openshift">
</action>
<action
- class="org.jboss.tools.openshift.express.internal.ui.action.OpenConnectionDialogActionDelegate"
+ class="org.jboss.tools.openshift.express.internal.ui.viewer.actionDelegate.OpenConnectionDialogActionDelegate"
icon="icons/resource_obj.gif"
id="org.jboss.tools.openshift.express.ui.viewActions.openConnectionWizard"
label="Connect"
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/AbstractAction.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -11,6 +11,8 @@
/** The current selection in the view. */
protected ISelection selection = null;
+
+ protected CommonViewer viewer;
public AbstractAction(String text) {
super(text);
@@ -24,6 +26,7 @@
public void selectionChanged(SelectionChangedEvent event) {
Object source = event.getSource();
if (source instanceof CommonViewer) {
+ this.viewer = (CommonViewer) source;
this.selection = ((CommonViewer) source).getSelection();
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/DeleteApplicationAction.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,11 +1,14 @@
package org.jboss.tools.openshift.express.internal.ui.action;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.ISharedImages;
@@ -33,16 +36,30 @@
*/
@Override
public void run() {
- if (isApplication(selection)) {
- final IApplication application = (IApplication) ((ITreeSelection)selection).getFirstElement();
- final String appName = application.getName();
- final boolean confirm = MessageDialog
- .openConfirm(
- Display.getCurrent().getActiveShell(),
- "Application deletion",
- "You are about to destroy the '" + appName + "' application.\n" +
- "This is NOT reversible, all remote data for this application will be removed.");
- if (confirm) {
+ final List<IApplication> appsToDelete = new ArrayList<IApplication>();
+ for (@SuppressWarnings("unchecked")
+ Iterator<Object> iterator = ((ITreeSelection) selection).iterator(); iterator.hasNext();) {
+ final Object element = iterator.next();
+ if (isApplication(element)) {
+ appsToDelete.add((IApplication) element);
+ }
+ }
+ if (appsToDelete.size() == 0) {
+ return;
+ }
+ boolean confirm = false;
+ if (appsToDelete.size() == 1) {
+ confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Application deletion",
+ "You are about to destroy the '" + appsToDelete.get(0) + "' application.\n"
+ + "This is NOT reversible, all remote data for this application will be removed.");
+ } else if (appsToDelete.size() > 1) {
+ confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Application deletion",
+ "You are about to destroy " + appsToDelete.size() + " applications.\n"
+ + "This is NOT reversible, all remote data for those applications will be removed.");
+ }
+ if (confirm) {
+ for (final IApplication application : appsToDelete) {
+ final String appName = application.getName();
Job job = new Job("Deleting application '" + appName + "'...") {
protected IStatus run(IProgressMonitor monitor) {
try {
@@ -51,6 +68,9 @@
Logger.error("Failed to delete application '" + appName + "'", e);
} finally {
monitor.done();
+ if (viewer != null) {
+ viewer.refresh();
+ }
}
return Status.OK_STATUS;
}
@@ -59,12 +79,13 @@
job.schedule(); // start as soon as possible
}
}
+ if (viewer != null) {
+ viewer.refresh();
+ }
}
- private boolean isApplication(ISelection selection) {
- return selection != null
- && selection instanceof ITreeSelection
- && ((ITreeSelection)selection).getFirstElement() instanceof IApplication;
+ private boolean isApplication(Object selection) {
+ return selection instanceof IApplication;
}
}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenConnectionDialogActionDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenConnectionDialogActionDelegate.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenConnectionDialogActionDelegate.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,48 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.action;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-import org.jboss.tools.openshift.express.internal.ui.viewer.ConnectToOpenShiftWizard;
-
-public class OpenConnectionDialogActionDelegate implements IViewActionDelegate {
-
- private CommonNavigator view;
-
- @Override
- public void run(IAction action) {
- final Display display = Display.getCurrent();
- final Shell shell = new Shell(display);
- final IWizard connectToOpenShiftWizard = new ConnectToOpenShiftWizard();
- int returnCode = WizardUtils.openWizardDialog(connectToOpenShiftWizard, shell);
- if (returnCode == Window.OK) {
- Logger.debug("OpenShift Auth succeeded.");
- if (view != null) {
- view.getCommonViewer().setInput(UserModel.getDefault());
- }
- }
-
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
-
- }
-
- @Override
- public void init(IViewPart view) {
- if (view instanceof CommonNavigator) {
- this.view = (CommonNavigator) view;
- }
- }
-
-}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserAction.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserAction.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,28 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.action;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-
-public class RefreshUserAction implements IViewActionDelegate {
-
- @Override
- public void run(IAction action) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void init(IViewPart view) {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserActionDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserActionDelegate.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserActionDelegate.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,50 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.action;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.navigator.CommonNavigator;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-import org.jboss.tools.openshift.express.internal.ui.viewer.ConnectToOpenShiftWizard;
-
-public class RefreshUserActionDelegate implements IViewActionDelegate {
-
- private CommonNavigator view;
-
- private ISelection selection;
-
- @Override
- public void run(IAction action) {
- final Display display = Display.getCurrent();
- final Shell shell = new Shell(display);
- final IWizard connectToOpenShiftWizard = new ConnectToOpenShiftWizard();
- int returnCode = WizardUtils.openWizardDialog(connectToOpenShiftWizard, shell);
- if (returnCode == Window.OK) {
- Logger.debug("OpenShift Auth succeeded.");
- if (view != null) {
- view.getCommonViewer().setInput(UserModel.getDefault());
- }
- }
-
- }
-
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- this.selection = selection;
- }
-
- @Override
- public void init(IViewPart view) {
- if (view instanceof CommonNavigator) {
- this.view = (CommonNavigator) view;
- }
- }
-
-}
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogAction.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogAction.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogAction.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,236 +0,0 @@
-package org.jboss.tools.openshift.express.internal.ui.action;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jgit.transport.CredentialsProvider;
-import org.eclipse.jgit.transport.RemoteSession;
-import org.eclipse.jgit.transport.SshSessionFactory;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.jgit.util.FS;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleListener;
-import org.eclipse.ui.console.MessageConsole;
-import org.eclipse.ui.views.IViewDescriptor;
-import org.eclipse.ui.views.IViewRegistry;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.IServerModule;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.ui.console.ConsoleUtils;
-import org.jboss.tools.openshift.express.internal.ui.console.JschToEclipseLogger;
-import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
-import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
-
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.OpenShiftException;
-import com.openshift.express.client.utils.Base64Encoder;
-
-/**
- * The action associated with the "Show In>Remote Console" menu item.
- *
- * @author Xavier Coulon
- *
- */
-public class TailServerLogAction extends AbstractAction implements IConsoleListener {
-
- /**
- * The message consoles associated with the 'tail' workers that write the output.
- */
- private Map<String, TailServerLogWorker> consoleWorkers = new HashMap<String, TailServerLogWorker>();
-
- /**
- * Constructor
- */
- public TailServerLogAction() {
- super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION);
- IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
- IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
- setImageDescriptor(desc.getImageDescriptor());
- ConsoleUtils.registerConsoleListener(this);
- }
-
- /**
- * Operation called when the user clicks on 'Show In>Remote Console'. If no Console/Worker existed, a new one is
- * created, otherwise, it is displayed. {@inheritDoc}
- */
- @Override
- public void run() {
- try {
- if (selection instanceof IStructuredSelection) {
- final Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
- if (selectedItem instanceof IServer) {
- final IServer server = ((IServer) selectedItem);
- run(server);
- } else if (selectedItem instanceof IServerModule) {
- final IServer server = ((IServerModule) selectedItem).getServer();
- run(server);
- } else if (selectedItem instanceof IApplication) {
- final IApplication application = (IApplication) selectedItem;
- run(application);
- }
- }
- } catch (Exception e) {
- Logger.error("Failed to open Remote Console", e);
- }
- }
-
- private void run(final IApplication application) throws OpenShiftException, MalformedURLException {
- final String host = new URL(application.getApplicationUrl()).getHost();
- final String appId = application.getUUID();
- final String appName = application.getName();
- final MessageConsole console = ConsoleUtils.findMessageConsole(createConsoleId(appName, host));
- ConsoleUtils.displayConsoleView(console);
- console.newMessageStream().println("Loading....");
- if (!this.consoleWorkers.containsKey(console.getName())) {
- launchTailServerJob(host, appId, appName, console);
- }
- }
-
- private static String createConsoleId(String appName, String host) {
- return host;
- }
-
- private void run(final IServer server) {
- if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) {
- final String host = server.getHost();
- final String appId = ExpressServerUtils.getExpressApplicationId(server);
- final String appName = ExpressServerUtils.getExpressApplicationName(server);
- final MessageConsole console = ConsoleUtils.findMessageConsole(createConsoleId(appName, host));
- ConsoleUtils.displayConsoleView(console);
- console.newMessageStream().println("Loading....");
- if (!this.consoleWorkers.containsKey(console.getName())) {
- launchTailServerJob(host, appId, appName, console);
- }
- }
- }
-
- private void launchTailServerJob(final String host, final String appId, final String appName,
- final MessageConsole console) {
- new Job("Launching Tail Server Operation") {
- protected IStatus run(IProgressMonitor monitor) {
- try {
- final TailServerLogWorker tailServerLogWorker = startTailProcess(host, appId, appName, console);
- consoleWorkers.put(console.getName(), tailServerLogWorker);
- Thread thread = new Thread(tailServerLogWorker);
- thread.start();
- } catch (Exception e) {
- Logger.error("Failed to retrieve remote server logs", e);
- console.newMessageStream().println("Failed to retrieve remote server logs: " + e.getMessage());
- console.newMessageStream().println("Please make sure your ssh key is added to your ssh preferences");
- }
- return Status.OK_STATUS;
- }
-
- }.schedule();
- }
-
- /**
- * Starting the tail process on the remote OpenShift Platform. This method relies on the JGit SSH support (including
- * JSch) to open a connection AND execute a command in a single invocation. The connection establishement requires
- * an SSH key, and the passphrase is prompted to the user if necessary.
- *
- * @param server
- * the server adapter on which the action is performed
- * @param console
- * the console into which the tail should be writtent
- * @return the Worker that encapsulate the established RemoteSession, the tail Process and the output console
- * @throws JSchException
- * in case of underlying exception
- * @throws IOException
- * in case of underlying exception
- */
- private TailServerLogWorker startTailProcess(final String host, final String appId, final String appName,
- final MessageConsole console) throws JSchException, IOException {
- final String logFilePath = appName + "/logs/*.log";
- final String options = "-f -n 100";
-
- JSch.setLogger(new JschToEclipseLogger());
- final SshSessionFactory sshSessionFactory = SshSessionFactory.getInstance();
- final URIish uri = new URIish().setHost(host).setUser(appId);
- RemoteSession remoteSession = sshSessionFactory.getSession(uri, CredentialsProvider.getDefault(), FS.DETECTED,
- 0);
-
- // the rhc-tail-files command template
- // ssh_cmd =
- // "ssh -t #{app_uuid}(a)#{app}-#{namespace}.#{rhc_domain} 'tail#{opt['opts'] ? ' --opts ' + Base64::encode64(opt['opts']).chomp : ''} #{file_glob}'"
- final String command = buildCommand(logFilePath, options);
- Process process = remoteSession.exec(command, 0);
- return new TailServerLogWorker(console, process, remoteSession);
-
- }
-
- /**
- * Builds the 'ssh tail' command that should be executed on the remote OpenShift platform.
- *
- * @param filePath
- * @param options
- * @return
- * @throws UnsupportedEncodingException
- */
- private String buildCommand(final String filePath, final String options) throws UnsupportedEncodingException {
- StringBuilder commandBuilder = new StringBuilder("tail ");
- if (options != null && !options.isEmpty()) {
- final String opts = new String(Base64Encoder.encode(options.getBytes("UTF-8")), "UTF-8");
- commandBuilder.append("--opts ").append(opts).append(" ");
- }
- commandBuilder.append(filePath);
- final String command = commandBuilder.toString();
- Logger.debug("ssh command to execute: " + command);
- return command;
- }
-
- public Object getSelection() {
- if (selection instanceof IStructuredSelection) {
- final Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
- if (selectedItem instanceof IServer) {
- return ((IServer) selectedItem);
- }
- if (selectedItem instanceof IServerModule) {
- return ((IServerModule) selectedItem).getServer();
- }
- if (selectedItem instanceof IApplication) {
-
- }
- }
- return null;
- }
-
- @Override
- public void consolesAdded(IConsole[] consoles) {
- // don't do anything special
- }
-
- /**
- * Operation to perform when the console is removed (through the CloseConsoleAction that was brung by the
- * <code>TailConsolePageParticipant</code>). In the current case, the associated worker is stopped and the
- * console/worker are removed from the map, so that further 'Show In>Remote Console' invocation will trigger a new
- * worker process.
- */
- @Override
- public void consolesRemoved(IConsole[] consoles) {
- // if the console is associated with a 'tail' process, stop that process
- for (IConsole console : consoles) {
- final String consoleName = console.getName();
- if (consoleWorkers.containsKey(consoleName)) {
- final TailServerLogWorker worker = consoleWorkers.get(consoleName);
- worker.stop();
- consoleWorkers.remove(consoleName);
- }
- }
-
- }
-
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/ExpressConsoleView.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -23,7 +23,7 @@
super.dispose();
}
- private void refreshViewer() {
+ public void refreshViewer() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
getCommonViewer().refresh();
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java (from rev 38805, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/TailServerLogAction.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -0,0 +1,237 @@
+package org.jboss.tools.openshift.express.internal.ui.console;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jgit.transport.CredentialsProvider;
+import org.eclipse.jgit.transport.RemoteSession;
+import org.eclipse.jgit.transport.SshSessionFactory;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.jgit.util.FS;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleListener;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.views.IViewDescriptor;
+import org.eclipse.ui.views.IViewRegistry;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.IServerModule;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.action.AbstractAction;
+import org.jboss.tools.openshift.express.internal.ui.action.TailServerLogWorker;
+import org.jboss.tools.openshift.express.internal.ui.messages.OpenShiftExpressUIMessages;
+import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.OpenShiftException;
+import com.openshift.express.client.utils.Base64Encoder;
+
+/**
+ * The action associated with the "Show In>Remote Console" menu item.
+ *
+ * @author Xavier Coulon
+ *
+ */
+public class TailServerLogAction extends AbstractAction implements IConsoleListener {
+
+ /**
+ * The message consoles associated with the 'tail' workers that write the output.
+ */
+ private Map<String, TailServerLogWorker> consoleWorkers = new HashMap<String, TailServerLogWorker>();
+
+ /**
+ * Constructor
+ */
+ public TailServerLogAction() {
+ super(OpenShiftExpressUIMessages.TAIL_SERVER_LOG_ACTION);
+ IViewRegistry reg = PlatformUI.getWorkbench().getViewRegistry();
+ IViewDescriptor desc = reg.find(IConsoleConstants.ID_CONSOLE_VIEW);
+ setImageDescriptor(desc.getImageDescriptor());
+ ConsoleUtils.registerConsoleListener(this);
+ }
+
+ /**
+ * Operation called when the user clicks on 'Show In>Remote Console'. If no Console/Worker existed, a new one is
+ * created, otherwise, it is displayed. {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ try {
+
+ if (selection instanceof IStructuredSelection) {
+ final Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedItem instanceof IServer) {
+ final IServer server = ((IServer) selectedItem);
+ run(server);
+ } else if (selectedItem instanceof IServerModule) {
+ final IServer server = ((IServerModule) selectedItem).getServer();
+ run(server);
+ } else if (selectedItem instanceof IApplication) {
+ final IApplication application = (IApplication) selectedItem;
+ run(application);
+ }
+ }
+ } catch (Exception e) {
+ Logger.error("Failed to open Remote Console", e);
+ }
+ }
+
+ private void run(final IApplication application) throws OpenShiftException, MalformedURLException {
+ final String host = new URL(application.getApplicationUrl()).getHost();
+ final String appId = application.getUUID();
+ final String appName = application.getName();
+ final MessageConsole console = ConsoleUtils.findMessageConsole(createConsoleId(appName, host));
+ ConsoleUtils.displayConsoleView(console);
+ console.newMessageStream().println("Loading....");
+ if (!this.consoleWorkers.containsKey(console.getName())) {
+ launchTailServerJob(host, appId, appName, console);
+ }
+ }
+
+ private static String createConsoleId(String appName, String host) {
+ return host;
+ }
+
+ private void run(final IServer server) {
+ if (ExpressServerUtils.isOpenShiftRuntime(server) || ExpressServerUtils.isInOpenshiftBehaviourMode(server)) {
+ final String host = server.getHost();
+ final String appId = ExpressServerUtils.getExpressApplicationId(server);
+ final String appName = ExpressServerUtils.getExpressApplicationName(server);
+ final MessageConsole console = ConsoleUtils.findMessageConsole(createConsoleId(appName, host));
+ ConsoleUtils.displayConsoleView(console);
+ console.newMessageStream().println("Loading....");
+ if (!this.consoleWorkers.containsKey(console.getName())) {
+ launchTailServerJob(host, appId, appName, console);
+ }
+ }
+ }
+
+ private void launchTailServerJob(final String host, final String appId, final String appName,
+ final MessageConsole console) {
+ new Job("Launching Tail Server Operation") {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final TailServerLogWorker tailServerLogWorker = startTailProcess(host, appId, appName, console);
+ consoleWorkers.put(console.getName(), tailServerLogWorker);
+ Thread thread = new Thread(tailServerLogWorker);
+ thread.start();
+ } catch (Exception e) {
+ Logger.error("Failed to retrieve remote server logs", e);
+ console.newMessageStream().println("Failed to retrieve remote server logs: " + e.getMessage());
+ console.newMessageStream().println("Please make sure your ssh key is added to your ssh preferences");
+ }
+ return Status.OK_STATUS;
+ }
+
+ }.schedule();
+ }
+
+ /**
+ * Starting the tail process on the remote OpenShift Platform. This method relies on the JGit SSH support (including
+ * JSch) to open a connection AND execute a command in a single invocation. The connection establishement requires
+ * an SSH key, and the passphrase is prompted to the user if necessary.
+ *
+ * @param server
+ * the server adapter on which the action is performed
+ * @param console
+ * the console into which the tail should be writtent
+ * @return the Worker that encapsulate the established RemoteSession, the tail Process and the output console
+ * @throws JSchException
+ * in case of underlying exception
+ * @throws IOException
+ * in case of underlying exception
+ */
+ private TailServerLogWorker startTailProcess(final String host, final String appId, final String appName,
+ final MessageConsole console) throws JSchException, IOException {
+ final String logFilePath = appName + "/logs/*.log";
+ final String options = "-f -n 100";
+
+ JSch.setLogger(new JschToEclipseLogger());
+ final SshSessionFactory sshSessionFactory = SshSessionFactory.getInstance();
+ final URIish uri = new URIish().setHost(host).setUser(appId);
+ RemoteSession remoteSession = sshSessionFactory.getSession(uri, CredentialsProvider.getDefault(), FS.DETECTED,
+ 0);
+
+ // the rhc-tail-files command template
+ // ssh_cmd =
+ // "ssh -t #{app_uuid}(a)#{app}-#{namespace}.#{rhc_domain} 'tail#{opt['opts'] ? ' --opts ' + Base64::encode64(opt['opts']).chomp : ''} #{file_glob}'"
+ final String command = buildCommand(logFilePath, options);
+ Process process = remoteSession.exec(command, 0);
+ return new TailServerLogWorker(console, process, remoteSession);
+
+ }
+
+ /**
+ * Builds the 'ssh tail' command that should be executed on the remote OpenShift platform.
+ *
+ * @param filePath
+ * @param options
+ * @return
+ * @throws UnsupportedEncodingException
+ */
+ private String buildCommand(final String filePath, final String options) throws UnsupportedEncodingException {
+ StringBuilder commandBuilder = new StringBuilder("tail ");
+ if (options != null && !options.isEmpty()) {
+ final String opts = new String(Base64Encoder.encode(options.getBytes("UTF-8")), "UTF-8");
+ commandBuilder.append("--opts ").append(opts).append(" ");
+ }
+ commandBuilder.append(filePath);
+ final String command = commandBuilder.toString();
+ Logger.debug("ssh command to execute: " + command);
+ return command;
+ }
+
+ public Object getSelection() {
+ if (selection instanceof IStructuredSelection) {
+ final Object selectedItem = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedItem instanceof IServer) {
+ return ((IServer) selectedItem);
+ }
+ if (selectedItem instanceof IServerModule) {
+ return ((IServerModule) selectedItem).getServer();
+ }
+ if (selectedItem instanceof IApplication) {
+
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void consolesAdded(IConsole[] consoles) {
+ // don't do anything special
+ }
+
+ /**
+ * Operation to perform when the console is removed (through the CloseConsoleAction that was brung by the
+ * <code>TailConsolePageParticipant</code>). In the current case, the associated worker is stopped and the
+ * console/worker are removed from the map, so that further 'Show In>Remote Console' invocation will trigger a new
+ * worker process.
+ */
+ @Override
+ public void consolesRemoved(IConsole[] consoles) {
+ // if the console is associated with a 'tail' process, stop that process
+ for (IConsole console : consoles) {
+ final String consoleName = console.getName();
+ if (consoleWorkers.containsKey(consoleName)) {
+ final TailServerLogWorker worker = consoleWorkers.get(consoleName);
+ worker.stop();
+ consoleWorkers.remove(consoleName);
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/console/TailServerLogActionProvider.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -1,6 +1,5 @@
package org.jboss.tools.openshift.express.internal.ui.console;
-import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.navigator.CommonActionProvider;
@@ -10,11 +9,7 @@
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.core.console.UserModel;
-import org.jboss.tools.openshift.express.internal.ui.action.TailServerLogAction;
-import com.openshift.express.client.IUser;
-
public class TailServerLogActionProvider extends CommonActionProvider {
private TailServerLogAction action;
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -38,5 +38,6 @@
public static String SHOW_PROPERTIES_VIEW_ACTION;
+ public static String REFRESH_VIEWER_ACTION;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/messages/OpenShiftExpressUIMessages.properties 2012-02-16 16:52:55 UTC (rev 38834)
@@ -14,3 +14,5 @@
MAKE_SNAPSHOT_ACTION=Pull down Application Snapshot
SHOW_PROPERTIES_VIEW_ACTION=Properties
+REFRESH_VIEWER_ACTION=Refresh
+
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/Logger.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/Logger.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/Logger.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -120,6 +120,9 @@
*/
public static void debug(final String message) {
String debugOption = Platform.getDebugOption(DEBUG);
+ if( OpenShiftUIActivator.getDefault() == null )
+ return;
+
if (OpenShiftUIActivator.getDefault().isDebugging() && "true".equalsIgnoreCase(debugOption)) {
System.out.println("[" + Thread.currentThread().getName() + "] " + message);
}
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/OpenConnectionDialogActionDelegate.java (from rev 38738, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/OpenConnectionDialogActionDelegate.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/OpenConnectionDialogActionDelegate.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/OpenConnectionDialogActionDelegate.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -0,0 +1,48 @@
+package org.jboss.tools.openshift.express.internal.ui.viewer.actionDelegate;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.navigator.CommonNavigator;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
+import org.jboss.tools.openshift.express.internal.ui.viewer.ConnectToOpenShiftWizard;
+
+public class OpenConnectionDialogActionDelegate implements IViewActionDelegate {
+
+ private CommonNavigator view;
+
+ @Override
+ public void run(IAction action) {
+ final Display display = Display.getCurrent();
+ final Shell shell = new Shell(display);
+ final IWizard connectToOpenShiftWizard = new ConnectToOpenShiftWizard();
+ int returnCode = WizardUtils.openWizardDialog(connectToOpenShiftWizard, shell);
+ if (returnCode == Window.OK) {
+ Logger.debug("OpenShift Auth succeeded.");
+ if (view != null) {
+ view.getCommonViewer().setInput(UserModel.getDefault());
+ }
+ }
+
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+
+ }
+
+ @Override
+ public void init(IViewPart view) {
+ if (view instanceof CommonNavigator) {
+ this.view = (CommonNavigator) view;
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/OpenConnectionDialogActionDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/RefreshViewerActionDelegate.java (from rev 38738, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/action/RefreshUserActionDelegate.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/RefreshViewerActionDelegate.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/RefreshViewerActionDelegate.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -0,0 +1,32 @@
+package org.jboss.tools.openshift.express.internal.ui.viewer.actionDelegate;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.jboss.tools.openshift.express.internal.ui.console.ExpressConsoleView;
+
+public class RefreshViewerActionDelegate implements IViewActionDelegate {
+
+ private ExpressConsoleView view;
+
+ protected ISelection selection;
+
+ @Override
+ public void run(IAction action) {
+ view.refreshViewer();
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ this.selection = selection;
+ }
+
+ @Override
+ public void init(IViewPart view) {
+ if (view instanceof ExpressConsoleView) {
+ this.view = (ExpressConsoleView) view;
+ }
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionDelegate/RefreshViewerActionDelegate.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/actionProvider/TailServerLogActionProvider.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.viewer.actionProvider;
-import org.jboss.tools.openshift.express.internal.ui.action.TailServerLogAction;
+import org.jboss.tools.openshift.express.internal.ui.console.TailServerLogAction;
/**
* @author Xavier Coulon
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/viewer/property/UserPropertySource.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -46,7 +46,7 @@
if (id.equals("Username")) {
return user.getRhlogin();
}
- if (id.equals("Domain")) {
+ if (id.equals("Domain") && user.hasDomain()) {
return user.getDomain().getNamespace() + "." + user.getDomain().getRhcDomain();
}
} catch (OpenShiftException e) {
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPage.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -40,6 +40,7 @@
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.PageChangingEvent;
import org.eclipse.jface.fieldassist.AutoCompleteField;
import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
@@ -59,6 +60,8 @@
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardContainer;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -77,6 +80,7 @@
import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.common.ui.databinding.ValueBindingBuilder;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils.IWidgetVisitor;
@@ -86,6 +90,7 @@
import com.openshift.express.client.IApplication;
import com.openshift.express.client.ICartridge;
import com.openshift.express.client.IEmbeddableCartridge;
+import com.openshift.express.client.IUser;
import com.openshift.express.client.NotFoundOpenShiftException;
import com.openshift.express.client.OpenShiftException;
@@ -141,36 +146,28 @@
useExistingAppBtn.setText("Use existing application:");
useExistingAppBtn.setToolTipText("Select an existing application or uncheck to create a new one.");
useExistingAppBtn.setFocus();
- GridDataFactory.fillDefaults()
- .span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(useExistingAppBtn);
- IObservableValue useExistingAppObservable =
- BeanProperties.value(ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION)
- .observe(pageModel);
- final IObservableValue useExistingAppBtnSelection =
- WidgetProperties.selection().observe(useExistingAppBtn);
+ GridDataFactory.fillDefaults().span(1, 1).align(SWT.FILL, SWT.CENTER).grab(false, false)
+ .applyTo(useExistingAppBtn);
+ IObservableValue useExistingAppObservable = BeanProperties.value(
+ ApplicationConfigurationWizardPageModel.PROPERTY_USE_EXISTING_APPLICATION).observe(pageModel);
+ final IObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
dbc.bindValue(useExistingAppBtnSelection, useExistingAppObservable);
// existing app name
this.existingAppNameText = new Text(existingAppSelectionGroup, SWT.BORDER);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(existingAppNameText);
- IObservableValue existingAppNameTextObservable =
- WidgetProperties.text(SWT.Modify).observe(existingAppNameText);
- IObservableValue existingAppNameModelObservable =
- BeanProperties.value(
- ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
- ValueBindingBuilder
- .bind(existingAppNameTextObservable)
- .to(existingAppNameModelObservable)
- .in(dbc);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
+ .applyTo(existingAppNameText);
+ IObservableValue existingAppNameTextObservable = WidgetProperties.text(SWT.Modify).observe(existingAppNameText);
+ IObservableValue existingAppNameModelObservable = BeanProperties.value(
+ ApplicationConfigurationWizardPageModel.PROPERTY_EXISTING_APPLICATION_NAME).observe(pageModel);
+ ValueBindingBuilder.bind(existingAppNameTextObservable).to(existingAppNameModelObservable).in(dbc);
UIUtils.focusOnSelection(useExistingAppBtn, existingAppNameText);
createContentAssist(existingAppNameText);
this.browseAppsButton = new Button(existingAppSelectionGroup, SWT.NONE);
browseAppsButton.setText("Browse...");
browseAppsButton.addSelectionListener(onBrowseApps());
- GridDataFactory.fillDefaults()
- .align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).span(1, 1).grab(false, false)
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).span(1, 1).grab(false, false)
.applyTo(browseAppsButton);
// observe the list of application, get notified once they have been
IObservableValue existingApplicationsLoaded =
@@ -180,21 +177,21 @@
new ApplicationToSelectNameValidator(
useExistingAppBtnSelection, existingAppNameTextObservable, existingApplicationsLoaded);
dbc.addValidationStatusProvider(existingAppValidator);
- ControlDecorationSupport.create(
- existingAppValidator, SWT.LEFT | SWT.TOP, null, new CustomControlDecorationUpdater(false));
+ ControlDecorationSupport.create(existingAppValidator, SWT.LEFT | SWT.TOP, null,
+ new CustomControlDecorationUpdater(false));
return existingAppSelectionGroup;
}
private void createContentAssist(final Text existingAppNameText) {
ControlDecoration dec = new ControlDecoration(existingAppNameText, SWT.TOP | SWT.LEFT);
- FieldDecoration contentProposalFieldIndicator =
- FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+ FieldDecoration contentProposalFieldIndicator = FieldDecorationRegistry.getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
dec.setImage(contentProposalFieldIndicator.getImage());
dec.setDescriptionText("Auto-completion is enabled when you start typing an application name.");
dec.setShowOnlyOnFocus(true);
- AutoCompleteField adapter =
- new AutoCompleteField(existingAppNameText, new TextContentAdapter(), new String[] {});
+ AutoCompleteField adapter = new AutoCompleteField(existingAppNameText, new TextContentAdapter(),
+ new String[] {});
adapter.setProposals(pageModel.getApplicationNames());
}
@@ -226,11 +223,9 @@
this.newAppConfigurationGroup = new Group(parent, SWT.NONE);
newAppConfigurationGroup.setText("New application");
GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(newAppConfigurationGroup);
- GridDataFactory.fillDefaults()
- .grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(newAppConfigurationGroup);
+ GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(newAppConfigurationGroup);
- IObservableValue useExistingApplication =
- WidgetProperties.selection().observe(useExistingAppBtn);
+ IObservableValue useExistingApplication = WidgetProperties.selection().observe(useExistingAppBtn);
useExistingApplication.addValueChangeListener(
onUseExistingApplication(
@@ -240,46 +235,36 @@
newAppNameLabel.setText("Name:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(newAppNameLabel);
this.newAppNameText = new Text(newAppConfigurationGroup, SWT.BORDER);
- GridDataFactory.fillDefaults()
- .grab(true, false).align(SWT.FILL, SWT.FILL).applyTo(newAppNameText);
+ GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.FILL).applyTo(newAppNameText);
UIUtils.selectAllOnFocus(newAppNameText);
- final IObservableValue applicationNameTextObservable =
- WidgetProperties.text(SWT.Modify).observe(newAppNameText);
- final IObservableValue applicationNameModelObservable =
- BeanProperties
- .value(ApplicationConfigurationWizardPageModel.PROPERTY_APPLICATION_NAME)
- .observe(pageModel);
- ValueBindingBuilder
- .bind(applicationNameTextObservable)
- .to(applicationNameModelObservable)
- .in(dbc);
+ final IObservableValue applicationNameTextObservable = WidgetProperties.text(SWT.Modify)
+ .observe(newAppNameText);
+ final IObservableValue applicationNameModelObservable = BeanProperties.value(
+ ApplicationConfigurationWizardPageModel.PROPERTY_APPLICATION_NAME).observe(pageModel);
+ ValueBindingBuilder.bind(applicationNameTextObservable).to(applicationNameModelObservable).in(dbc);
this.newAppTypeLabel = new Label(newAppConfigurationGroup, SWT.NONE);
newAppTypeLabel.setText("Type:");
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).applyTo(newAppTypeLabel);
this.newAppCartridgeCombo = new Combo(newAppConfigurationGroup, SWT.BORDER | SWT.READ_ONLY);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false).applyTo(newAppCartridgeCombo);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(1, 1).grab(true, false)
+ .applyTo(newAppCartridgeCombo);
fillCartridgesCombo(dbc, newAppCartridgeCombo);
- final ISWTObservableValue selectedCartridgeComboObservable =
- WidgetProperties.selection().observe(newAppCartridgeCombo);
- final IObservableValue selectedCartridgeModelObservable =
- BeanProperties.value(NewApplicationWizardPageModel.PROPERTY_SELECTED_CARTRIDGE).observe(pageModel);
- ValueBindingBuilder
- .bind(selectedCartridgeComboObservable).converting(new StringToCartridgeConverter())
- .to(selectedCartridgeModelObservable).converting(new CartridgeToStringConverter())
- .in(dbc);
+ final ISWTObservableValue selectedCartridgeComboObservable = WidgetProperties.selection().observe(
+ newAppCartridgeCombo);
+ final IObservableValue selectedCartridgeModelObservable = BeanProperties.value(
+ NewApplicationWizardPageModel.PROPERTY_SELECTED_CARTRIDGE).observe(pageModel);
+ ValueBindingBuilder.bind(selectedCartridgeComboObservable).converting(new StringToCartridgeConverter())
+ .to(selectedCartridgeModelObservable).converting(new CartridgeToStringConverter()).in(dbc);
final ISWTObservableValue useExistingAppBtnSelection = WidgetProperties.selection().observe(useExistingAppBtn);
- final NewApplicationNameValidator newApplicationNameValidator =
- new NewApplicationNameValidator(
- useExistingAppBtnSelection, applicationNameTextObservable);
+ final NewApplicationNameValidator newApplicationNameValidator = new NewApplicationNameValidator(
+ useExistingAppBtnSelection, applicationNameTextObservable);
dbc.addValidationStatusProvider(newApplicationNameValidator);
ControlDecorationSupport.create(newApplicationNameValidator, SWT.LEFT | SWT.TOP, null,
new CustomControlDecorationUpdater());
- final NewApplicationTypeValidator newApplicationTypeValidator =
- new NewApplicationTypeValidator(
- useExistingAppBtnSelection, selectedCartridgeComboObservable);
+ final NewApplicationTypeValidator newApplicationTypeValidator = new NewApplicationTypeValidator(
+ useExistingAppBtnSelection, selectedCartridgeComboObservable);
dbc.addValidationStatusProvider(newApplicationTypeValidator);
ControlDecorationSupport.create(newApplicationTypeValidator, SWT.LEFT | SWT.TOP, null,
new CustomControlDecorationUpdater());
@@ -292,30 +277,28 @@
GridLayoutFactory.fillDefaults().numColumns(2).margins(6, 6).applyTo(newAppEmbeddableCartridgesGroup);
Composite tableContainer = new Composite(newAppEmbeddableCartridgesGroup, SWT.NONE);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250).applyTo(tableContainer);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).span(1, 2).hint(400, 250)
+ .applyTo(tableContainer);
this.viewer = createTable(tableContainer);
- dbc.bindSet(
- ViewerProperties.checkedElements(IEmbeddableCartridge.class).observe(viewer),
+ dbc.bindSet(ViewerProperties.checkedElements(IEmbeddableCartridge.class).observe(viewer),
BeanProperties.set(ApplicationConfigurationWizardPageModel.PROPERTY_SELECTED_EMBEDDABLE_CARTRIDGES)
.observe(pageModel));
this.checkAllButton = new Button(newAppEmbeddableCartridgesGroup, SWT.PUSH);
checkAllButton.setText("&Select All");
- GridDataFactory.fillDefaults().
- hint(110, SWT.DEFAULT).grab(false, false).align(SWT.FILL, SWT.TOP).applyTo(checkAllButton);
+ GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, false).align(SWT.FILL, SWT.TOP)
+ .applyTo(checkAllButton);
checkAllButton.addSelectionListener(onCheckAll());
this.uncheckAllButton = new Button(newAppEmbeddableCartridgesGroup, SWT.PUSH);
uncheckAllButton.setText("&Deselect All");
- GridDataFactory.fillDefaults()
- .hint(110, SWT.DEFAULT).grab(false, true).align(SWT.FILL, SWT.TOP).applyTo(uncheckAllButton);
+ GridDataFactory.fillDefaults().hint(110, SWT.DEFAULT).grab(false, true).align(SWT.FILL, SWT.TOP)
+ .applyTo(uncheckAllButton);
uncheckAllButton.addSelectionListener(onUncheckAll());
// bottom filler
Composite spacer = new Composite(newAppConfigurationGroup, SWT.NONE);
- GridDataFactory.fillDefaults()
- .span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(spacer);
}
/**
@@ -327,8 +310,7 @@
* @param applicationBrowseButton
* @return
*/
- private IValueChangeListener onUseExistingApplication(final Group
- applicationConfigurationGroup,
+ private IValueChangeListener onUseExistingApplication(final Group applicationConfigurationGroup,
final Text applicationNameText, final Button applicationBrowseButton) {
return new IValueChangeListener() {
@@ -347,8 +329,7 @@
}
/**
- * Enables/disables the given widgets based on the flag to use an existing
- * app or create a new application.
+ * Enables/disables the given widgets based on the flag to use an existing app or create a new application.
*
* @param useExisting
* @param applicationConfigurationGroup
@@ -621,12 +602,11 @@
}
/**
- * Viewer element comparer based on #equals(). The default implementation in
- * CheckboxTableViewer compares elements based on instance identity.
+ * Viewer element comparer based on #equals(). The default implementation in CheckboxTableViewer compares elements
+ * based on instance identity.
* <p>
- * We need this since the available cartridges (item listed in the viewer)
- * are not the same instance as the ones in the embedded application (items
- * to check in the viewer).
+ * We need this since the available cartridges (item listed in the viewer) are not the same instance as the ones in
+ * the embedded application (items to check in the viewer).
*/
private static class EqualityComparer implements IElementComparer {
@@ -670,6 +650,32 @@
}.start();
}
+ @Override
+ protected void onPageWillGetActivated(Direction direction, PageChangingEvent event, DataBindingContext dbc) {
+ if (direction == Direction.BACKWARDS) {
+ return;
+ }
+ try {
+ final IUser user = this.pageModel.getUser();
+ if (user != null && !user.hasDomain()) {
+ IWizard domainDialog = new NewDomainDialog(user);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), domainDialog);
+ dialog.create();
+ dialog.setBlockOnOpen(true);
+ int result = dialog.open();
+ if(result != Dialog.OK) {
+ final IWizardContainer container = getWizard().getContainer();
+ if(container instanceof WizardDialog) {
+ dbc.dispose();
+ ((WizardDialog)container).close();
+ }
+ }
+ }
+ } catch (OpenShiftException e) {
+ Logger.error("Failed to refresh OpenShift account info", e);
+ }
+ }
+
protected void loadOpenshiftResources(final DataBindingContext dbc) {
try {
WizardUtils.runInWizard(new Job("Loading existing applications...") {
@@ -836,8 +842,8 @@
return ValidationStatus.ok();
}
if (StringUtils.isEmpty(cartridge)) {
- return OpenShiftUIActivator.createCancelStatus(
- "Select an alphanumerical name and a type for the application to create.");
+ return OpenShiftUIActivator
+ .createCancelStatus("Select an alphanumerical name and a type for the application to create.");
}
return ValidationStatus.ok();
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationConfigurationWizardPageModel.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -73,7 +73,7 @@
public List<IApplication> getApplications() throws OpenShiftException {
IUser user = getUser();
- if (user == null) {
+ if (user == null || !user.hasDomain()) {
return Collections.emptyList();
}
return user.getApplications();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -30,11 +30,13 @@
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
@@ -47,6 +49,9 @@
import org.jboss.tools.openshift.express.internal.ui.utils.StringUtils;
import org.jboss.tools.openshift.express.internal.ui.utils.UIUtils;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
/**
* @author Andre Dietisheim
* @author Xavier Coulon
@@ -56,14 +61,16 @@
protected static final String OPENSHIFT_EXPRESS_SIGNUP_URL = "https://openshift.redhat.com/app/user/new/express"; //$NON-NLS-1$
private final CredentialsWizardPageModel pageModel;
+
+ private final IUserAwareModel wizardModel;
private Text rhLoginText = null;
private Text passwordText = null;
public CredentialsWizardPage(IWizard wizard, IUserAwareModel wizardModel) {
- super("OpenShift Connection", "Please provide your OpenShift Express credentials.", "Server Connection",
- wizard);
+ super("OpenShift Connection", "Please provide your OpenShift Express credentials.", "Server Connection", wizard);
this.pageModel = new CredentialsWizardPageModel(wizardModel);
+ this.wizardModel = wizardModel;
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -71,45 +78,38 @@
Link signupLink = new Link(container, SWT.WRAP);
signupLink.setText("If you do not have an account on OpenShift Express, please sign up <a>here</a>.");
- GridDataFactory.fillDefaults()
- .align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(signupLink);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).applyTo(signupLink);
signupLink.addSelectionListener(onSignupLinkClicked());
Label fillerLabel = new Label(container, SWT.NONE);
- GridDataFactory.fillDefaults()
- .span(2, 1).hint(SWT.DEFAULT, 6).applyTo(fillerLabel);
+ GridDataFactory.fillDefaults().span(2, 1).hint(SWT.DEFAULT, 6).applyTo(fillerLabel);
Label rhLoginLabel = new Label(container, SWT.NONE);
rhLoginLabel.setText("&Username");
- GridDataFactory.fillDefaults()
- .align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
rhLoginText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(rhLoginText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(rhLoginText);
UIUtils.selectAllOnFocus(rhLoginText);
- final IObservableValue rhLoginObservable =
- BeanProperties.value(CredentialsWizardPageModel.PROPERTY_RHLOGIN).observe(pageModel);
+ final IObservableValue rhLoginObservable = BeanProperties.value(CredentialsWizardPageModel.PROPERTY_RHLOGIN)
+ .observe(pageModel);
dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(rhLoginText), rhLoginObservable);
Label passwordLabel = new Label(container, SWT.NONE);
passwordLabel.setText("&Password");
- GridDataFactory.fillDefaults()
- .align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD);
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(passwordText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1).applyTo(passwordText);
UIUtils.selectAllOnFocus(passwordText);
- final IObservableValue passwordModelObservable =
- BeanProperties.value(CredentialsWizardPageModel.PROPERTY_PASSWORD).observe(pageModel);
+ final IObservableValue passwordModelObservable = BeanProperties.value(
+ CredentialsWizardPageModel.PROPERTY_PASSWORD).observe(pageModel);
final ISWTObservableValue passwordTextObservable = WidgetProperties.text(SWT.Modify).observe(passwordText);
dbc.bindValue(passwordTextObservable, passwordModelObservable);
- IObservableValue credentialsStatusObservable =
- BeanProperties.value(CredentialsWizardPageModel.PROPERTY_CREDENTIALS_STATUS).observe(pageModel);
- dbc.addValidationStatusProvider(
- new CredentialsInputValidator(rhLoginObservable, passwordModelObservable));
- final CredentialsStatusValidator credentialsStatusValidator =
- new CredentialsStatusValidator(credentialsStatusObservable, passwordTextObservable);
+ IObservableValue credentialsStatusObservable = BeanProperties.value(
+ CredentialsWizardPageModel.PROPERTY_CREDENTIALS_STATUS).observe(pageModel);
+ dbc.addValidationStatusProvider(new CredentialsInputValidator(rhLoginObservable, passwordModelObservable));
+ final CredentialsStatusValidator credentialsStatusValidator = new CredentialsStatusValidator(
+ credentialsStatusObservable, passwordTextObservable);
dbc.addValidationStatusProvider(credentialsStatusValidator);
ControlDecorationSupport.create(credentialsStatusValidator, SWT.LEFT | SWT.TOP);
@@ -117,12 +117,11 @@
// the text fields
Button rememberPasswordCheckBox = new Button(container, SWT.CHECK);
rememberPasswordCheckBox.setText("Save password (could trigger secure storage login)");
- GridDataFactory.fillDefaults()
- .align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(rememberPasswordCheckBox);
- final IObservableValue rememberPasswordModelObservable =
- BeanProperties.value(CredentialsWizardPageModel.PROPERTY_REMEMBER_PASSWORD).observe(pageModel);
- final ISWTObservableValue rememberPasswordCheckBoxObservable =
- WidgetProperties.selection().observe(rememberPasswordCheckBox);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(rememberPasswordCheckBox);
+ final IObservableValue rememberPasswordModelObservable = BeanProperties.value(
+ CredentialsWizardPageModel.PROPERTY_REMEMBER_PASSWORD).observe(pageModel);
+ final ISWTObservableValue rememberPasswordCheckBoxObservable = WidgetProperties.selection().observe(
+ rememberPasswordCheckBox);
dbc.bindValue(rememberPasswordCheckBoxObservable, rememberPasswordModelObservable);
}
@@ -192,8 +191,7 @@
private final IObservableValue passwordObservable;
- public CredentialsInputValidator(IObservableValue rhLoginObservable,
- IObservableValue passwordObservable) {
+ public CredentialsInputValidator(IObservableValue rhLoginObservable, IObservableValue passwordObservable) {
this.rhLoginObservable = rhLoginObservable;
this.passwordObservable = passwordObservable;
}
@@ -204,8 +202,7 @@
// something..
final String rhLoginValue = (String) rhLoginObservable.getValue();
final String passwordValue = (String) passwordObservable.getValue();
- if (!StringUtils.isEmpty(rhLoginValue)
- && !StringUtils.isEmpty(passwordValue)) {
+ if (!StringUtils.isEmpty(rhLoginValue) && !StringUtils.isEmpty(passwordValue)) {
return ValidationStatus.ok();
}
return ValidationStatus.cancel("Please provide your OpenShift Express user credentials");
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -26,7 +26,6 @@
*/
public class NewDomainDialog extends Wizard {
- private String namespace;
private NewDomainWizardPageModel model;
public NewDomainDialog(IUser user) {
@@ -56,6 +55,6 @@
@Override
public void addPages() {
- addPage(new NewDomainWizardPage(namespace, model, this));
+ addPage(new NewDomainWizardPage(model, this));
}
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -63,7 +63,7 @@
private NewDomainWizardPageModel model;
- public NewDomainWizardPage(String namespace, NewDomainWizardPageModel model, IWizard wizard) {
+ public NewDomainWizardPage(NewDomainWizardPageModel model, IWizard wizard) {
super("Domain Creation", "Create a new domain", "New Domain", wizard);
this.model = model;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-16 16:46:55 UTC (rev 38833)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-02-16 16:52:55 UTC (rev 38834)
@@ -41,6 +41,7 @@
import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
+import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import com.openshift.express.client.IApplication;
import com.openshift.express.client.IEmbeddableCartridge;
@@ -73,7 +74,7 @@
void setWizardModel(OpenShiftExpressApplicationWizardModel wizardModel) {
this.wizardModel = wizardModel;
}
-
+
OpenShiftExpressApplicationWizardModel getWizardModel() {
return wizardModel;
}
@@ -92,7 +93,7 @@
protected void openError(final String title, final String message) {
getShell().getDisplay().syncExec(new Runnable() {
-
+
@Override
public void run() {
MessageDialog.openError(getShell(), title, message);
@@ -103,18 +104,16 @@
protected boolean askForConfirmation(final String message, final String applicationName) {
final boolean[] confirmed = new boolean[1];
getShell().getDisplay().syncExec(new Runnable() {
-
+
@Override
public void run() {
- confirmed[0] = MessageDialog.openConfirm(
- getShell(),
- NLS.bind("Import OpenShift Application ", applicationName),
- message);
+ confirmed[0] = MessageDialog.openConfirm(getShell(),
+ NLS.bind("Import OpenShift Application ", applicationName), message);
}
});
return confirmed[0];
}
-
+
public void setSelectedApplication(IApplication application) {
getWizardModel().setApplication(application);
}
@@ -148,7 +147,7 @@
IWizardPage[] pages = getPages();
return initialUser == null ? pages[0] : pages[1];
}
-
+
public void setInitialUser(IUser user) {
this.initialUser = user;
}
@@ -173,13 +172,12 @@
private boolean importProject() {
try {
final DelegatingProgressMonitor delegatingMonitor = new DelegatingProgressMonitor();
- IStatus jobResult = WizardUtils.runInWizard(
- new ImportJob(delegatingMonitor), delegatingMonitor, getContainer());
+ IStatus jobResult = WizardUtils.runInWizard(new ImportJob(delegatingMonitor), delegatingMonitor,
+ getContainer());
return JobUtils.isOk(jobResult);
} catch (Exception e) {
- ErrorDialog.openError(getShell(), "Error", "Could not create local git repository.",
- OpenShiftUIActivator.createErrorStatus(
- "An exception occurred while creating local git repository.", e));
+ ErrorDialog.openError(getShell(), "Error", "Could not create local git repository.", OpenShiftUIActivator
+ .createErrorStatus("An exception occurred while creating local git repository.", e));
return false;
}
}
@@ -196,8 +194,8 @@
return Status.OK_STATUS;
} catch (Exception e) {
// TODO: refresh user
- return OpenShiftUIActivator.createErrorStatus(
- "Could not create application \"{0}\"", e, applicationName);
+ return OpenShiftUIActivator.createErrorStatus("Could not create application \"{0}\"",
+ e, applicationName);
}
}
@@ -218,16 +216,15 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- if (selectedCartridges != null
- && !selectedCartridges.isEmpty()) {
+ if (selectedCartridges != null && !selectedCartridges.isEmpty()) {
List<IEmbeddableCartridge> embeddableCartridges = new ArrayList<IEmbeddableCartridge>();
embeddableCartridges.addAll(selectedCartridges);
application.addEmbbedCartridges(embeddableCartridges);
}
} catch (OpenShiftException e) {
- return OpenShiftUIActivator.createErrorStatus(
- NLS.bind("Could not embed cartridges to application {0}"
- , getWizardModel().getApplication().getName()), e);
+ return OpenShiftUIActivator.createErrorStatus(NLS.bind(
+ "Could not embed cartridges to application {0}", getWizardModel()
+ .getApplication().getName()), e);
}
return Status.OK_STATUS;
}
@@ -239,8 +236,7 @@
}
/**
- * A workspace job that will create a new project or enable the selected
- * project to be used with OpenShift.
+ * A workspace job that will create a new project or enable the selected project to be used with OpenShift.
*/
class ImportJob extends WorkspaceJob {
14 years, 1 month
JBoss Tools SVN: r38832 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-16 11:43:42 -0500 (Thu, 16 Feb 2012)
New Revision: 38832
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
Log:
JBIDE-10798 : make m2e-wtp 0.16.0 compatible
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-02-16 16:27:23 UTC (rev 38831)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-02-16 16:43:42 UTC (rev 38832)
@@ -26,7 +26,7 @@
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">[0.13.1,0.16.0)</property>
+ <property name="versions">[0.13.1,0.17)</property>
<property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
@@ -80,7 +80,7 @@
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">[0.13.1,0.16.0)</property>
+ <property name="versions">[0.13.1,0.17)</property>
<property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
@@ -184,7 +184,7 @@
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">[0.13.1,0.16.0)</property>
+ <property name="versions">[0.13.1,0.17)</property>
<property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
@@ -242,7 +242,7 @@
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">[0.13.1,0.16.0)</property>
+ <property name="versions">[0.13.1,0.17)</property>
<property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
@@ -291,7 +291,7 @@
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">[0.15.1,0.16.0)</property>
+ <property name="versions">[0.15.1,0.17)</property>
<property name="description">This project example requires m2eclipse-wtp >= 0.15.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
14 years, 1 month
JBoss Tools SVN: r38831 - trunk/seam/features/org.jboss.tools.seam.test.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-02-16 11:27:23 -0500 (Thu, 16 Feb 2012)
New Revision: 38831
Modified:
trunk/seam/features/org.jboss.tools.seam.test.feature/feature.xml
Log:
added seam.base.test plugin to let seam test to be installed from nightly/trunk composite repo
Modified: trunk/seam/features/org.jboss.tools.seam.test.feature/feature.xml
===================================================================
--- trunk/seam/features/org.jboss.tools.seam.test.feature/feature.xml 2012-02-16 16:20:21 UTC (rev 38830)
+++ trunk/seam/features/org.jboss.tools.seam.test.feature/feature.xml 2012-02-16 16:27:23 UTC (rev 38831)
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<feature id="org.jboss.tools.seam.test.feature"
- label="%featureName"
- version="3.3.0.qualifier"
- provider-name="%providerName">
+<feature
+ id="org.jboss.tools.seam.test.feature"
+ label="%featureName"
+ version="3.3.0.qualifier"
+ provider-name="%providerName">
<description url="http://www.jboss.org/tools">
%description
@@ -16,37 +17,196 @@
%license
</license>
- <plugin id="org.jboss.tools.seam.core.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin id="org.jboss.tools.seam.pages.xml.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin id="org.jboss.tools.seam.ui.bot.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin id="org.jboss.tools.seam.ui.test" download-size="0" install-size="0" version="0.0.0" />
- <plugin id="org.jboss.tools.seam.xml.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
- <plugin id="org.jboss.tools.seam121EAP.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam121EAP.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam.pages.xml.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
- <plugin id="org.jboss.tools.seam201GA.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam201GA.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam202SP1.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam202SP1.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam203CR1.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam203CR1.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam.ui.bot.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
- <plugin id="org.jboss.tools.seam211GA.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam211GA.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam212GA.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam212GA.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
- <plugin id="org.jboss.tools.seam220CR1.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam220CR1.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam220GA.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam220GA.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam.xml.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
- <plugin id="org.jboss.tools.seam221CR1.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam221CR1.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam221CR2.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seam221CR2.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam121EAP.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
- <plugin id="org.jboss.tools.seamfp.core.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
- <plugin id="org.jboss.tools.seamfp.ui.test" download-size="0" install-size="0" version="0.0.0" unpack="false" />
+ <plugin
+ id="org.jboss.tools.seam121EAP.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam201GA.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam201GA.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam202SP1.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam202SP1.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam203CR1.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam203CR1.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam211GA.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam211GA.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam212GA.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam212GA.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam220CR1.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam220CR1.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam220GA.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam220GA.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam221CR1.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam221CR1.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam221CR2.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam221CR2.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seamfp.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seamfp.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam.base.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
14 years, 1 month