JBoss Tools SVN: r39468 - in trunk/hibernatetools: plugins/org.hibernate.eclipse/src/org/hibernate/console/ext and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-03-13 07:28:27 -0400 (Tue, 13 Mar 2012)
New Revision: 39468
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ext/HibernateExtension.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/console/ConsoleExtension3_5.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_6/src/org/jboss/tools/hibernate3_6/HibernateExtension3_6.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/BaseTestSetCase.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-11118
Build mappings in HibernateExtension when do so in ConsoleConfiguration.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -258,6 +258,16 @@
public boolean hasConfiguration() {
return configuration != null;
}
+
+ public void buildMappings(){
+ execute(new Command() {
+ public Object execute() {
+ getConfiguration().buildMappings();
+ return null;
+ }
+ });
+ getHibernateExtension().buildMappings();
+ }
public void buildSessionFactory() {
execute(new Command() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ext/HibernateExtension.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ext/HibernateExtension.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ext/HibernateExtension.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -10,9 +10,7 @@
******************************************************************************/
package org.hibernate.console.ext;
-import org.hibernate.SessionFactory;
import org.hibernate.console.QueryInputModel;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
@@ -26,6 +24,8 @@
public void build();
+ public void buildMappings();
+
public void buildSessionFactory();
public boolean closeSessionFactory();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -27,7 +27,6 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -36,17 +35,9 @@
public Object[] getChildren(Object o) {
final ConsoleConfiguration ccfg = getConsoleConfiguration( o );
//String sfError = null;
- if(ccfg.getConfiguration()==null) {
+ if(!ccfg.hasConfiguration()) {
ccfg.build();
- ccfg.execute( new ExecutionContext.Command() {
-
- public Object execute() {
- if(ccfg.hasConfiguration()) {
- ccfg.getConfiguration().buildMappings();
- }
- return ccfg;
- }
- } );
+ ccfg.buildMappings();
}
/*if(ccfg.getSessionFactory()==null) { // initialize later?
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -63,7 +63,6 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryPage;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.eclipse.console.AbstractQueryEditor;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -176,17 +175,10 @@
final ConsoleConfiguration consoleConfiguration = getConsoleConfiguration();
- if(consoleConfiguration.getConfiguration()==null) {
+ if(!consoleConfiguration.hasConfiguration()) {
try {
consoleConfiguration.build();
- consoleConfiguration.execute( new ExecutionContext.Command() {
- public Object execute() {
- if(consoleConfiguration.hasConfiguration()) {
- consoleConfiguration.getConfiguration().buildMappings();
- }
- return consoleConfiguration;
- }
- });
+ consoleConfiguration.buildMappings();
} catch (HibernateException e) {
String mess = NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc, consoleConfiguration.getName());
HibernateConsolePlugin.getDefault().logErrorMessage(mess, e);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -491,16 +491,8 @@
return cfg;
} else {
cc.build();
- final Configuration configuration = cc.getConfiguration();
-
- cc.execute(new Command() {
- public Object execute() {
-
- configuration.buildMappings();
- return configuration;
- }
- });
- return configuration;
+ cc.buildMappings();
+ return cc.getConfiguration();
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/OrmDiagram.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -800,10 +800,10 @@
}
final ConsoleConfiguration consoleConfig = getConsoleConfig();
if (consoleConfig != null) {
- Configuration config = consoleConfig.getConfiguration();
- if (config == null) {
+ if (!consoleConfig.hasConfiguration()) {
try {
consoleConfig.build();
+ consoleConfig.buildMappings();
} catch (HibernateException he) {
// here just ignore this
if (error != null) {
@@ -815,17 +815,8 @@
}
}
}
- consoleConfig.execute(new ExecutionContext.Command() {
- public Object execute() {
- if (consoleConfig.hasConfiguration()) {
- consoleConfig.getConfiguration().buildMappings();
- }
- return consoleConfig;
- }
- } );
- config = consoleConfig.getConfiguration();
}
- return config;
+ return consoleConfig.getConfiguration();
}
if (error != null && consoleConfigName != null && consoleConfigName.length() > 0) {
error.append(consoleConfigName);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OpenDiagramActionDelegate.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -85,14 +85,9 @@
DiagramViewerMessages.OpenDiagramActionDelegate_could_not_load_configuration +
' ' + consoleConfig.getName(), he);
}
- consoleConfig.execute( new ExecutionContext.Command() {
- public Object execute() {
- if (consoleConfig.hasConfiguration()) {
- consoleConfig.getConfiguration().buildMappings();
- }
- return consoleConfig;
- }
- } );
+ if (consoleConfig.hasConfiguration()) {
+ consoleConfig.buildMappings();
+ }
config = consoleConfig.getConfiguration();
}
if (config != null) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/OrmLabelProvider.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -68,24 +68,15 @@
protected Configuration getConfig() {
final ConsoleConfiguration consoleConfig = getConsoleConfig();
if (consoleConfig != null) {
- Configuration config = consoleConfig.getConfiguration();
- if (config == null) {
+ if (!consoleConfig.hasConfiguration()) {
try {
consoleConfig.build();
+ consoleConfig.buildMappings();
} catch (HibernateException he) {
// here just ignore this
}
- consoleConfig.execute(new ExecutionContext.Command() {
- public Object execute() {
- if (consoleConfig.hasConfiguration()) {
- consoleConfig.getConfiguration().buildMappings();
- }
- return consoleConfig;
- }
- } );
- config = consoleConfig.getConfiguration();
}
- return config;
+ return consoleConfig.getConfiguration();
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/HibernateExtension3_5.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -324,4 +324,14 @@
public String generateSQL(final String query) {
return QueryHelper.generateSQL(executionContext, sessionFactory, query);
}
+
+ @Override
+ public void buildMappings() {
+ execute(new Command() {
+ public Object execute() {
+ getConfiguration().buildMappings();
+ return null;
+ }
+ });
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/console/ConsoleExtension3_5.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/console/ConsoleExtension3_5.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_5/src/org/jboss/tools/hibernate3_5/console/ConsoleExtension3_5.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -77,14 +77,7 @@
if (!hibernateExtension.hasConfiguration()){
try {
hibernateExtension.build();
- hibernateExtension.execute( new ExecutionContext.Command() {
- public Object execute() {
- if(hibernateExtension.hasConfiguration()) {
- hibernateExtension.getConfiguration().buildMappings();
- }
- return null;
- }
- });
+ hibernateExtension.buildMappings();
} catch (HibernateException e){
//FIXME
//String mess = NLS.bind(HibernateConsoleMessages.CompletionHelper_error_could_not_build_cc, consoleConfiguration.getName());
@@ -269,16 +262,8 @@
return cfg;
} else {
cc.build();
- final Configuration configuration = cc.getConfiguration();
-
- cc.execute(new Command() {
- public Object execute() {
-
- configuration.buildMappings();
- return configuration;
- }
- });
- return configuration;
+ cc.buildMappings();
+ return cc.getConfiguration();
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_6/src/org/jboss/tools/hibernate3_6/HibernateExtension3_6.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_6/src/org/jboss/tools/hibernate3_6/HibernateExtension3_6.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate3_6/src/org/jboss/tools/hibernate3_6/HibernateExtension3_6.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -331,4 +331,14 @@
public String generateSQL(final String query) {
return QueryHelper.generateSQL(executionContext, sessionFactory, query);
}
+
+ @Override
+ public void buildMappings() {
+ execute(new Command() {
+ public Object execute() {
+ getConfiguration().buildMappings();
+ return null;
+ }
+ });
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate4_0/src/org/jboss/tools/hibernate4_0/HibernateExtension4_0.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -15,7 +15,6 @@
import java.security.PrivilegedAction;
import java.sql.DriverManager;
import java.sql.SQLException;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -37,16 +36,9 @@
import org.hibernate.console.ext.QueryResultImpl;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.console.preferences.PreferencesClassPathUtils;
-import org.hibernate.eclipse.console.HibernateConsoleMessages;
-import org.hibernate.eclipse.console.utils.QLFormatHelper;
-import org.hibernate.engine.query.spi.HQLQueryPlan;
-import org.hibernate.hql.spi.QueryTranslator;
-import org.hibernate.internal.SessionFactoryImpl;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.service.internal.StandardServiceRegistryImpl;
-import org.hibernate.type.Type;
-import org.hibernate.util.xpl.StringHelper;
/**
*
@@ -349,4 +341,14 @@
public String generateSQL(final String query) {
return QueryHelper.generateSQL(executionContext, sessionFactory, query);
}
+
+ @Override
+ public void buildMappings() {
+ execute(new Command() {
+ public Object execute() {
+ getConfiguration().buildMappings();
+ return null;
+ }
+ });
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/BaseTestSetCase.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/BaseTestSetCase.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/BaseTestSetCase.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.hibernate.eclipse.console.test.mappingproject;
+import junit.framework.TestCase;
+
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
@@ -20,15 +22,12 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.PropertyWorkbenchAdapter;
-import junit.framework.TestCase;
-
/**
* @author vy (vyemialyanchyk(a)gmail.com)
*/
@@ -72,14 +71,7 @@
}
assertTrue(consCFG.hasConfiguration());
if (resetCC) {
- consCFG.execute(new ExecutionContext.Command() {
- public Object execute() {
- if (consCFG.hasConfiguration()) {
- consCFG.getConfiguration().buildMappings();
- }
- return consCFG;
- }
- });
+ consCFG.buildMappings();
}
Object[] configs = null;
Object[] persClasses = null;
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2012-03-13 10:46:13 UTC (rev 39467)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/HbmExportExceptionTest.java 2012-03-13 11:28:27 UTC (rev 39468)
@@ -24,7 +24,6 @@
import org.eclipse.osgi.util.NLS;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.test.ConsoleTestMessages;
import org.hibernate.eclipse.console.test.project.ConfigurableTestProject;
import org.hibernate.eclipse.console.test.utils.ConsoleConfigUtils;
@@ -95,14 +94,7 @@
consCFG.reset();
consCFG.build();
assertTrue(consCFG.hasConfiguration());
- consCFG.execute(new ExecutionContext.Command() {
- public Object execute() {
- if(consCFG.hasConfiguration()) {
- consCFG.getConfiguration().buildMappings();
- }
- return consCFG;
- }
- });
+ consCFG.getConfiguration().buildMappings();
config = consCFG.getConfiguration();
} catch (CoreException e) {
String out = NLS.bind(ConsoleTestMessages.UpdateConfigurationTest_error_customising_file_for_package,
14 years
JBoss Tools SVN: r39467 - in trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-03-13 06:46:13 -0400 (Tue, 13 Mar 2012)
New Revision: 39467
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java
Log:
JBIDE-11285 welcome content of project examples broken
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2012-03-13 10:43:07 UTC (rev 39466)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2012-03-13 10:46:13 UTC (rev 39467)
@@ -135,6 +135,7 @@
private static final String PERIOD_CHEATSHEET_XML = "/.cheatsheet.xml"; //$NON-NLS-1$
private static final String README_MD = "/readme.md"; //$NON-NLS-1$
private static final String README_TXT = "/readme.txt"; //$NON-NLS-1$
+ private static final String README_MDU = "/README.md"; //$NON-NLS-1$
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.project.examples"; //$NON-NLS-1$
@@ -336,7 +337,7 @@
return projects.toArray(new IProject[0]);
}
- protected static String replace(String name, ProjectExample project) {
+ public static String replace(String name, ProjectExample project) {
List<String> includedProjects = project.getIncludedProjects();
if (includedProjects != null) {
int i = 0;
@@ -564,6 +565,10 @@
ProjectExampleUtil.EDITOR)) {
return;
}
+ if (checkCheatsheet(project, eclipseProject, README_MDU,
+ ProjectExampleUtil.EDITOR)) {
+ return;
+ }
if (checkCheatsheet(project, eclipseProject, README_TXT,
ProjectExampleUtil.EDITOR)) {
return;
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-03-13 10:43:07 UTC (rev 39466)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesReadyPage.java 2012-03-13 10:46:13 UTC (rev 39467)
@@ -67,7 +67,9 @@
if (projectExample.isWelcome()) {
showReadme.setEnabled(true);
showReadme.setSelection(true);
- showReadme.setText("Show '" + projectExample.getWelcomeURL() + "' for further instructions");
+ String urlString = projectExample.getWelcomeURL();
+ String welcomeURL = ProjectExamplesActivator.replace(urlString, projectExample);
+ showReadme.setText("Show '" + welcomeURL + "' for further instructions");
} else {
showReadme.setEnabled(false);
showReadme.setSelection(false);
14 years
JBoss Tools SVN: r39466 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-13 06:43:07 -0400 (Tue, 13 Mar 2012)
New Revision: 39466
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java
Log:
add a constructor for a default, to ensure undo's work properly.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java 2012-03-13 10:42:37 UTC (rev 39465)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerWorkingCopyPropertyCommand.java 2012-03-13 10:43:07 UTC (rev 39466)
@@ -27,6 +27,10 @@
public ServerWorkingCopyPropertyCommand(IServerWorkingCopy wc, String commandName,
Text text, String newVal, String attributeKey, ModifyListener listener) {
+ this(wc, commandName, text, newVal, attributeKey, listener, "");
+ }
+ public ServerWorkingCopyPropertyCommand(IServerWorkingCopy wc, String commandName,
+ Text text, String newVal, String attributeKey, ModifyListener listener, String defaultVal) {
super(wc, commandName);
this.wc = wc;
this.text = text;
@@ -34,7 +38,7 @@
this.newVal = newVal;
this.listener = listener;
if( key != null )
- this.oldVal = wc.getAttribute(attributeKey, ""); //$NON-NLS-1$
+ this.oldVal = wc.getAttribute(attributeKey, defaultVal);
}
public void execute() {
14 years
JBoss Tools SVN: r39465 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-13 06:42:37 -0400 (Tue, 13 Mar 2012)
New Revision: 39465
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
Log:
Small bug, missing line
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-03-13 10:42:04 UTC (rev 39464)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServerUtils.java 2012-03-13 10:42:37 UTC (rev 39465)
@@ -225,6 +225,7 @@
wc.setAttribute(ATTRIBUTE_APPLICATION_NAME, appName);
wc.setAttribute(ATTRIBUTE_APPLICATION_ID, appId);
wc.setAttribute(ATTRIBUTE_DEPLOY_PROJECT, deployProject);
+ wc.setAttribute(ATTRIBUTE_DEPLOY_FOLDER_NAME, projectRelativeFolder);
wc.setAttribute(ATTRIBUTE_EXPRESS_MODE, mode);
wc.setAttribute(ATTRIBUTE_REMOTE_NAME, remoteName);
((ServerWorkingCopy)wc).setAutoPublishSetting(Server.AUTO_PUBLISH_DISABLE);
14 years
JBoss Tools SVN: r39464 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-13 06:42:04 -0400 (Tue, 13 Mar 2012)
New Revision: 39464
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressBinaryUI.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
Log:
decouple wizard from section for openshift server details
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressBinaryUI.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressBinaryUI.java 2012-03-13 10:31:21 UTC (rev 39463)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressBinaryUI.java 2012-03-13 10:42:04 UTC (rev 39464)
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat Inc..
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat Incorporated - initial API and implementation
- *******************************************************************************/
-package org.jboss.tools.openshift.express.internal.ui.behaviour;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil;
-import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI;
-import org.jboss.tools.common.ui.WizardUtils;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-
-public class ExpressBinaryUI implements IDeploymentTypeUI {
- private ExpressDetailsComposite composite;
- private IServerModeUICallback wrapped;
- public ExpressBinaryUI() {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public void fillComposite(Composite parent, IServerModeUICallback callback) {
- parent.setLayout(new FillLayout());
- wrapped = wrapCallback(callback);
-
- composite = ExpressDetailsComposite.createComposite(parent,wrapped,
- ExpressServerUtils.EXPRESS_BINARY_MODE, true);
- }
-
- private IServerModeUICallback wrapCallback(final IServerModeUICallback inner) {
- return new IServerModeUICallback() {
- public IServerWorkingCopy getServer() {
- return inner.getServer();
- }
- public IRuntime getRuntime() {
- return inner.getRuntime();
- }
- public void execute(IUndoableOperation operation) {
- inner.execute(operation);
- }
- public void executeLongRunning(Job j) {
- if( inner instanceof DeploymentTypeUIUtil.NewServerWizardBehaviourCallback) {
- IWizardHandle handle = ((DeploymentTypeUIUtil.NewServerWizardBehaviourCallback)inner).getHandle();
- // depends on COMMON, DAMN
- IWizardContainer container = ((WizardPage)handle).getWizard().getContainer();
- try {
- WizardUtils.runInWizard(j, null, container);
- } catch(Exception e) {
- // TODO clean
- }
- } else {
- inner.executeLongRunning(j);
- }
- }
- public void setErrorMessage(String msg) {
- inner.setErrorMessage(msg);
- }
- public Object getAttribute(String key) {
- return null;
- }
- };
- }
-
- @Override
- public void performFinish(IProgressMonitor monitor) throws CoreException {
- }
-
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-03-13 10:31:21 UTC (rev 39463)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsComposite.java 2012-03-13 10:42:04 UTC (rev 39464)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -53,15 +54,13 @@
import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
-import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.UIUtil;
import org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil;
import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI.IServerModeUICallback;
-import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyComboCommand;
-import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
import org.jboss.tools.openshift.express.internal.core.console.UserDelegate;
import org.jboss.tools.openshift.express.internal.core.console.UserModel;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
import org.jboss.tools.openshift.express.internal.ui.wizard.ConnectToOpenShiftWizardModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.CredentialsWizardPageModel;
import org.jboss.tools.openshift.express.internal.ui.wizard.ImportOpenShiftExpressApplicationWizard;
@@ -74,13 +73,6 @@
* @author Rob Stryker
*/
public class ExpressDetailsComposite {
- public static ExpressDetailsComposite createComposite(Composite parent,
- IServerModeUICallback callback, String mode, boolean showVerify) {
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new GridLayout(2, false));
- return new ExpressDetailsComposite(composite, callback, mode, showVerify);
- }
-
// How to display errors, set attributes, etc
protected IServerModeUICallback callback;
@@ -103,7 +95,6 @@
private UserDelegate fuser;
private List<IApplication> appList;
private String[] appListNames;
- private String error;
private IServerWorkingCopy server;
private String mode;
private HashMap<IApplication, IProject[]> projectsPerApp = new HashMap<IApplication, IProject[]>();
@@ -121,7 +112,7 @@
createWidgets(fill);
fillWidgets();
addListeners();
- postLongRunningValidate();
+ quickValidate();
}
public Composite getComposite() {
@@ -154,7 +145,7 @@
try {
this.app = app.getName();
updateModelForNewUser(tmpUser);
- postLongRunningValidate();
+ quickValidate();
showVerify = false;
IProject[] p = projectsPerApp.get(app);
showImportLink = p == null || p.length == 0;
@@ -293,23 +284,22 @@
String storedPass = UserModel.getDefault().getPasswordFromSecureStorage(user);
if (storedPass != null && !storedPass.equals(""))
passText.setText(storedPass);
- callback.execute(new SetUserCommand(server));
}
};
userText.addModifyListener(nameModifyListener);
passModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
- // pass = passText.getText();
- callback.execute(new SetPassCommand(server));
+ pass = passText.getText();
}
};
- if( showVerify ) passText.addModifyListener(passModifyListener);
+
+ if( showVerify )
+ passText.addModifyListener(passModifyListener);
remoteModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
remote = remoteText.getText();
- callback.execute(new SetRemoteCommand(server));
}
};
remoteText.addModifyListener(remoteModifyListener);
@@ -322,10 +312,9 @@
if( ind != -1 ) {
fapplication = appList.get(ind);
}
- callback.execute(new SetApplicationCommand(server));
resetDeployProjectCombo();
enableImportLink();
- postLongRunningValidate();
+ quickValidate();
}
};
appNameCombo.addModifyListener(appModifyListener);
@@ -335,7 +324,6 @@
deployProjectModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
deployProject = deployProjectCombo.getText();
- callback.execute(new SetDeployProjectCommand(server));
}
};
deployProjectCombo.addModifyListener(deployProjectModifyListener);
@@ -343,7 +331,6 @@
deployDestinationModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
deployFolder = deployFolderText.getText();
- callback.execute(new SetDeployFolderCommand(server));
}
};
deployFolderText.addModifyListener(deployDestinationModifyListener);
@@ -436,7 +423,7 @@
};
callback.executeLongRunning(j);
postVerifyUpdateWidgets();
- postLongRunningValidate();
+ quickValidate();
}
private void postVerifyUpdateWidgets() {
@@ -468,11 +455,14 @@
importLink.setEnabled(p == null || p.length == 0);
}
- private void postLongRunningValidate() {
+ private void quickValidate() {
if( !showVerify )
return;
-
- error = null;
+ callback.setErrorMessage(getErrorString());
+ }
+
+ private String getErrorString() {
+ String error = null;
if( credentialsFailed ) {
error = "Credentials Failed";
} else {
@@ -488,63 +478,9 @@
}
}
}
- callback.setErrorMessage(error);
+ return error;
}
- public class SetUserCommand extends ServerWorkingCopyPropertyCommand {
- public SetUserCommand(IServerWorkingCopy server) {
- super(server, Messages.EditorChangeUsernameCommandName, userText, userText.getText(),
- ExpressServerUtils.ATTRIBUTE_USERNAME, nameModifyListener);
- }
- }
-
- public class SetRemoteCommand extends ServerWorkingCopyPropertyCommand {
- public SetRemoteCommand(IServerWorkingCopy server) {
- super(server, "Change Remote Name", remoteText, remoteText.getText(),
- ExpressServerUtils.ATTRIBUTE_REMOTE_NAME, remoteModifyListener);
- }
- }
-
- public class SetApplicationCommand extends ServerWorkingCopyPropertyComboCommand {
- public SetApplicationCommand(IServerWorkingCopy server) {
- super(server, "Change Application Name", appNameCombo, appNameCombo.getText(),
- ExpressServerUtils.ATTRIBUTE_APPLICATION_NAME, appModifyListener);
- }
- }
-
- public class SetDeployProjectCommand extends ServerWorkingCopyPropertyComboCommand {
- public SetDeployProjectCommand(IServerWorkingCopy server) {
- super(server, "Change Deployment Project", appNameCombo, deployProjectCombo.getText(),
- ExpressServerUtils.ATTRIBUTE_DEPLOY_PROJECT, deployProjectModifyListener);
- }
- }
-
- public class SetDeployFolderCommand extends ServerWorkingCopyPropertyCommand {
- public SetDeployFolderCommand(IServerWorkingCopy server) {
- super(server, "Change Deployment Folder", deployFolderText, deployFolderText.getText(),
- ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_NAME, deployDestinationModifyListener);
- }
- }
-
- public class SetPassCommand extends ServerWorkingCopyPropertyCommand {
- public SetPassCommand(IServerWorkingCopy server) {
- super(server, Messages.EditorChangePasswordCommandName, passText, passText.getText(),
- null, passModifyListener);
- oldVal = passText.getText();
- }
-
- public void execute() {
- pass = newVal;
- }
-
- public void undo() {
- pass = oldVal;
- text.removeModifyListener(listener);
- text.setText(oldVal);
- text.addModifyListener(listener);
- }
- }
-
private Runnable getVerifyingCredentialsJob() {
final ConnectToOpenShiftWizardModel inner = new ConnectToOpenShiftWizardModel();
final CredentialsWizardPageModel model = new CredentialsWizardPageModel(inner);
@@ -553,7 +489,6 @@
return new Runnable() {
public void run() {
final IStatus s = model.validateCredentials();
- error = null;
if (!s.isOK()) {
credentialsFailed = true;
} else {
@@ -561,7 +496,7 @@
try {
updateModelForNewUser(inner.getUser());
} catch(OpenShiftException ose) {
- error = ose.getMessage();
+ callback.setErrorMessage(ose.getMessage());
}
}
}
@@ -588,10 +523,23 @@
IProject[] possibleProjects = projectsPerApp.get(fapplication);
this.deployProject = possibleProjects == null || possibleProjects.length == 0 ? null : possibleProjects[0].getName();
+ fillServerWithDetails();
+ }
+
+
+ public void finish(IProgressMonitor monitor) throws CoreException {
+ try {
+ UserModel.getDefault().addUser(fuser);
+ fillServerWithDetails();
+ } catch(OpenShiftException ose) {
+ throw new CoreException(new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID, ose.getMessage(), ose));
+ }
+ }
+ private void fillServerWithDetails() throws OpenShiftException {
// Fill the server working copy
// update the values
IServerWorkingCopy wc = callback.getServer();
- ExpressServerUtils.fillServerWithOpenShiftDetails(wc, application,
+ ExpressServerUtils.fillServerWithOpenShiftDetails(wc, fapplication,
fuser, mode, deployProject, deployFolder, remote);
}
@@ -602,28 +550,4 @@
}
return appNames;
}
-
- public String getUsername() {
- return user;
- }
-
- public String getPassword() {
- return pass;
- }
-
- public String getApplicationName() {
- return app;
- }
-
- public UserDelegate getUser() {
- return fuser;
- }
-
- public IApplication getApplication() {
- return fapplication;
- }
-
- public String getRemote() {
- return remote;
- }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-03-13 10:31:21 UTC (rev 39463)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressDetailsSection.java 2012-03-13 10:42:04 UTC (rev 39464)
@@ -10,22 +10,51 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.behaviour;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceComparator;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
import org.eclipse.wst.server.ui.editor.ServerEditorSection;
-import org.jboss.ide.eclipse.as.ui.editor.DeploymentTypeUIUtil;
-import org.jboss.ide.eclipse.as.ui.editor.IDeploymentTypeUI.IServerModeUICallback;
+import org.eclipse.wst.server.ui.internal.editor.ServerEditorPartInput;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
+import org.jboss.ide.eclipse.as.ui.editor.ServerWorkingCopyPropertyCommand;
import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
public class ExpressDetailsSection extends ServerEditorSection {
- private ExpressDetailsComposite details;
private IEditorInput input;
+ protected Text userText, remoteText;
+ protected Text deployFolderText;
+ protected Text appNameText, deployProjectText;
+ protected Button verifyButton, browseDestButton;
+
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
this.input = input;
@@ -38,29 +67,148 @@
Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED|ExpandableComposite.TITLE_BAR);
section.setText("Openshift Express Server");
section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL| GridData.GRAB_VERTICAL));
+ Composite c = new Composite(section, SWT.NONE);
+ c.setLayout(new GridLayout(2,true));
+ createWidgets(c);
+ toolkit.paintBordersFor(c);
+ toolkit.adapt(c);
+ section.setClient(c);
+
+ initWidgets();
+ addListeners();
+ }
+
+ protected void initWidgets() {
+ // Set the widgets
+ String user = ExpressServerUtils.getExpressUsername(server);
+ String appName = ExpressServerUtils.getExpressApplicationName(server);
+ String depProj = ExpressServerUtils.getExpressDeployProject(server);
+ userText.setText(user == null ? "" : user);
+ appNameText.setText(appName == null ? "" : appName);
+ deployProjectText.setText(depProj == null ? "" : depProj);
+ userText.setEnabled(false);
+ appNameText.setEnabled(false);
+ deployProjectText.setEnabled(false);
+
+ String outDir = ExpressServerUtils.getExpressDeployFolder(server);
+ String remote = ExpressServerUtils.getExpressRemoteName(server);
+ deployFolderText.setText(outDir == null ? "" : outDir);
+ remoteText.setText(remote == null ? "" : remote);
+
+ }
+
+ protected Composite createComposite(Section section) {
+ createWidgets(section);
+ return section;
+ }
+
+ private void createWidgets(Composite composite) {
+ composite.setLayout(new GridLayout(2, false));
+ Label userLabel = new Label(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(userLabel);
+ userText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(userText);
+ Label appNameLabel = new Label(composite, SWT.NONE);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).applyTo(appNameLabel);
+ appNameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(appNameText);
+
+ Label deployLocationLabel = new Label(composite, SWT.NONE);
+ deployProjectText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(deployProjectText);
+
+ Label zipDestLabel = new Label(composite, SWT.NONE);
+
+ Composite zipDestComposite = new Composite(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(zipDestComposite);
+ zipDestComposite.setLayout(new FormLayout());
+ browseDestButton = new Button(zipDestComposite, SWT.PUSH);
+ browseDestButton.setLayoutData(UIUtil.createFormData2(0,5,100,-5,null,0,100,0));
+ deployFolderText = new Text(zipDestComposite, SWT.SINGLE | SWT.BORDER);
+ deployFolderText.setLayoutData(UIUtil.createFormData2(0,5,100,-5,0,0,browseDestButton,-5));
+
+ Label remoteLabel = new Label(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(remoteLabel);
+ remoteText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(remoteText);
- details = ExpressDetailsComposite.createComposite(section, createCallback(), ExpressServerUtils.EXPRESS_SOURCE_MODE, false);
- toolkit.paintBordersFor(details.getComposite());
- toolkit.adapt(details.getComposite());
- section.setClient(details.getComposite());
- details.appNameCombo.setEnabled(false);
+ // Text
+ appNameLabel.setText("Application Name: ");
+ deployLocationLabel.setText("Deploy Project: " );
+ zipDestLabel.setText("Output Directory: ");
+ userLabel.setText("Username: ");
+ remoteLabel.setText("Remote: ");
+ browseDestButton.setText("Browse...");
}
- private IServerModeUICallback createCallback() {
- return DeploymentTypeUIUtil.getCallback(server, input, this);
+ ModifyListener remoteModifyListener, deployDestinationModifyListener;
+ protected void addListeners() {
+ remoteModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(new SetRemoteCommand(server));
+ }
+ };
+ remoteText.addModifyListener(remoteModifyListener);
+ deployDestinationModifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ ((ServerEditorPartInput) input).getServerCommandManager().execute(new SetDeployFolderCommand(server));
+ }
+ };
+ deployFolderText.addModifyListener(deployDestinationModifyListener);
+
+ browseDestButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ browsePressed();
+ }
+ });
+
}
+
+ private void browsePressed() {
+ IFolder f = chooseFolder();
+ if( f != null ) {
+ deployFolderText.setText(f.getFullPath().removeFirstSegments(1).makeRelative().toOSString());
+ }
+ }
+
+ private IFolder chooseFolder() {
+ String depProject = ExpressServerUtils.getExpressDeployProject(server);
+ String depFolder = ExpressServerUtils.getExpressDeployFolder(server);
+
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(depProject);
- /**
- * Allow a section an opportunity to respond to a doSave request on the editor.
- * @param monitor the progress monitor for the save operation.
- */
- public void doSave(IProgressMonitor monitor) {
-// try {
-// ExpressServerUtils.setExpressPassword(server.getOriginal(), details.getPassword());
-// monitor.worked(100);
-// } catch( CoreException ce ) {
-// // TODO
-// }
+ ILabelProvider lp= new WorkbenchLabelProvider();
+ ITreeContentProvider cp= new WorkbenchContentProvider();
+
+ ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(Display.getDefault().getActiveShell(), lp, cp);
+ dialog.setTitle("Deploy Location");
+ dialog.setMessage("Please choose a location to put zipped projects");
+ dialog.setInput(p);
+ dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
+
+ IResource res= p.findMember(new Path(depFolder));
+ if (res != null)
+ dialog.setInitialSelection(res);
+
+ if (dialog.open() == Window.OK)
+ return (IFolder) dialog.getFirstResult();
+ return null;
}
-
+
+ public class SetRemoteCommand extends ServerWorkingCopyPropertyCommand {
+ public SetRemoteCommand(IServerWorkingCopy server) {
+ super(server, "Change Remote Name", remoteText, remoteText.getText(),
+ ExpressServerUtils.ATTRIBUTE_REMOTE_NAME, remoteModifyListener,
+ ExpressServerUtils.ATTRIBUTE_REMOTE_NAME_DEFAULT);
+ }
+ }
+
+ public class SetDeployFolderCommand extends ServerWorkingCopyPropertyCommand {
+ public SetDeployFolderCommand(IServerWorkingCopy server) {
+ super(server, "Change Deployment Folder", deployFolderText, deployFolderText.getText(),
+ ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_NAME, deployDestinationModifyListener,
+ ExpressServerUtils.ATTRIBUTE_DEPLOY_FOLDER_DEFAULT);
+ }
+ }
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-03-13 10:31:21 UTC (rev 39463)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/behaviour/ExpressWizardFragment.java 2012-03-13 10:42:04 UTC (rev 39464)
@@ -16,6 +16,8 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
@@ -43,7 +45,7 @@
}
public boolean isComplete() {
- return getTaskModel().getObject(ExpressServerUtils.TASK_WIZARD_ATTR_SELECTED_APP) != null;
+ return super.isComplete();
}
public Composite createComposite(Composite parent, IWizardHandle handle) {
@@ -60,8 +62,11 @@
}
}
};
- composite = ExpressDetailsComposite.createComposite(parent,callback, ExpressServerUtils.EXPRESS_SOURCE_MODE, true);
- return composite.getComposite();
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(new GridLayout(2, false));
+ this.composite = new ExpressDetailsComposite(
+ composite, callback,ExpressServerUtils.EXPRESS_SOURCE_MODE, true);
+ return this.composite.getComposite();
}
public void enter() {
@@ -70,18 +75,6 @@
public void performFinish(IProgressMonitor monitor) throws CoreException {
super.performFinish(monitor);
- UserDelegate user = composite.getUser();
- UserModel.getDefault().addUser(user);
- IApplication app = composite.getApplication();
-
- // Only clone and import if there's no project already in existence
- IProject p = ExpressServerUtils.findProjectForApplication(app);
- System.out.println(p);
- if( p == null ) {
- System.out.println(p);
- // clone and import
-
- // If we had to clone and import, we also need to add the module ??
- }
+ composite.finish(monitor);
}
}
14 years
JBoss Tools SVN: r39463 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-03-13 06:31:21 -0400 (Tue, 13 Mar 2012)
New Revision: 39463
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml
Log:
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml 2012-03-13 10:22:53 UTC (rev 39462)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-jbds50.xml 2012-03-13 10:31:21 UTC (rev 39463)
@@ -37,7 +37,6 @@
</fixes>
<importType>maven</importType>
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
- <welcome type="cheatsheets" url="/jboss-as-helloworld/.cheatsheet.xml"/>
<tags>central</tags>
<icon path="icons/jboss.png" />
</project>
@@ -169,7 +168,6 @@
</fixes>
<importType>maven</importType>
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
- <welcome type="cheatsheets" url="/jboss-as-numberguess/.cheatsheet.xml"/>
<tags>central</tags>
<icon path="icons/jboss.png" />
</project>
@@ -213,7 +211,6 @@
</fixes>
<importType>maven</importType>
<importTypeDescription>The project example requires the m2eclipse, m2eclipse-wtp and JBoss Maven Project Examples feature.</importTypeDescription>
- <welcome type="cheatsheets" url="/jboss-as-kitchensink/.cheatsheet.xml"/>
<tags>central</tags>
<icon path="icons/jboss.png" />
</project>
@@ -256,7 +253,6 @@
<!-- no cheatsheet yet
<welcome type="cheatsheets" url="/helloworld-html5/cheatsheets/helloworld-html5.xml"/>
-->
- <welcome type="editor" url="/helloworld-html5/README.md"/>
<tags>central</tags>
<icon path="icons/jboss.png" />
</project>
14 years
JBoss Tools SVN: r39462 - trunk/birt/site.
by jbosstools-commits@lists.jboss.org
Author: mickael_istria
Date: 2012-03-13 06:22:53 -0400 (Tue, 13 Mar 2012)
New Revision: 39462
Added:
trunk/birt/site/category.xml
Removed:
trunk/birt/site/site.xml
Modified:
trunk/birt/site/pom.xml
Log:
JBIDE-10596
(Tentative) Move to eclipse-repository instead of eclipse-update-site
Copied: trunk/birt/site/category.xml (from rev 38541, trunk/birt/site/site.xml)
===================================================================
--- trunk/birt/site/category.xml (rev 0)
+++ trunk/birt/site/category.xml 2012-03-13 10:22:53 UTC (rev 39462)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<site>
+ <description>To install these features, point Eclipse at this site.</description>
+ <!-- JBoss Tools birt Nightly Build Update Site -->
+ <category-def label="JBoss Tools birt Nightly Build Update Site" name="JBoss Tools birt Nightly Build Update Site">
+ <description>JBoss Tools birt Nightly Build Update Site: contains all features in this build.</description>
+ </category-def>
+ <feature url="features/org.jboss.tools.birt.feature_0.0.0.jar" id="org.jboss.tools.birt.feature" version="0.0.0">
+ <category name="JBoss Tools birt Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.birt.source.feature_0.0.0.jar" id="org.jboss.tools.birt.source.feature" version="0.0.0">
+ <category name="JBoss Tools birt Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.birt.test.feature_0.0.0.jar" id="org.jboss.tools.birt.test.feature" version="0.0.0">
+ <category name="JBoss Tools birt Nightly Build Update Site"/>
+ </feature>
+ <feature url="features/org.jboss.tools.birt.test.source.feature_0.0.0.jar" id="org.jboss.tools.birt.test.source.feature" version="0.0.0">
+ <category name="JBoss Tools birt Nightly Build Update Site"/>
+ </feature>
+
+</site>
Modified: trunk/birt/site/pom.xml
===================================================================
--- trunk/birt/site/pom.xml 2012-03-13 09:57:26 UTC (rev 39461)
+++ trunk/birt/site/pom.xml 2012-03-13 10:22:53 UTC (rev 39462)
@@ -9,5 +9,5 @@
<groupId>org.jboss.tools.birt</groupId>
<artifactId>birt.site</artifactId>
- <packaging>eclipse-update-site</packaging>
+ <packaging>eclipse-repository</packaging>
</project>
Deleted: trunk/birt/site/site.xml
===================================================================
--- trunk/birt/site/site.xml 2012-03-13 09:57:26 UTC (rev 39461)
+++ trunk/birt/site/site.xml 2012-03-13 10:22:53 UTC (rev 39462)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<site>
- <description>To install these features, point Eclipse at this site.</description>
- <!-- JBoss Tools birt Nightly Build Update Site -->
- <category-def label="JBoss Tools birt Nightly Build Update Site" name="JBoss Tools birt Nightly Build Update Site">
- <description>JBoss Tools birt Nightly Build Update Site: contains all features in this build.</description>
- </category-def>
- <feature url="features/org.jboss.tools.birt.feature_0.0.0.jar" id="org.jboss.tools.birt.feature" version="0.0.0">
- <category name="JBoss Tools birt Nightly Build Update Site"/>
- </feature>
- <feature url="features/org.jboss.tools.birt.source.feature_0.0.0.jar" id="org.jboss.tools.birt.source.feature" version="0.0.0">
- <category name="JBoss Tools birt Nightly Build Update Site"/>
- </feature>
- <feature url="features/org.jboss.tools.birt.test.feature_0.0.0.jar" id="org.jboss.tools.birt.test.feature" version="0.0.0">
- <category name="JBoss Tools birt Nightly Build Update Site"/>
- </feature>
- <feature url="features/org.jboss.tools.birt.test.source.feature_0.0.0.jar" id="org.jboss.tools.birt.test.source.feature" version="0.0.0">
- <category name="JBoss Tools birt Nightly Build Update Site"/>
- </feature>
-
-</site>
14 years
JBoss Tools SVN: r39460 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-03-13 05:30:04 -0400 (Tue, 13 Mar 2012)
New Revision: 39460
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
Log:
JBIDE-10823 JBoss Central Quickstarts Updates
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3....
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-03-13 09:19:46 UTC (rev 39459)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-shared-3.3.... 2012-03-13 09:30:04 UTC (rev 39460)
@@ -61,9 +61,6 @@
</mavenArchetype>
<tags>wizard</tags>
<icon path="icons/newwebprj_wiz.gif" />
- <!-- broken in 3.3.0.Beta1
- <welcome type="editor" url="/${project[0]}/readme.md"/>
- -->
</project>
<!-- Java EE Project -->
<project>
@@ -117,9 +114,6 @@
<!--targetProjectFacet facet="jst.ear" version="6.0"/-->
<tags>wizard</tags>
<icon path="icons/ear-wiz-icon.gif" />
- <!--
- <welcome type="editor" url="/${project[0]}/README.md"/>
- -->
</project>
<!-- HTML5 project -->
<project>
@@ -173,9 +167,6 @@
</mavenArchetype>
<tags>wizard</tags>
<icon path="icons/html5.png" />
- <!--
- <welcome type="editor" url="/${project[0]}/README.md"/>
- -->
</project>
<!-- Richfaces project -->
<project>
@@ -236,9 +227,6 @@
</mavenArchetype>
<tags>wizard</tags>
<icon path="icons/rf_logo.png" />
- <!--
- <welcome type="editor" url="/${project[0]}/readme.txt"/>
- -->
</project>
<!-- Spring MVC -->
<project>
@@ -347,9 +335,6 @@
</mavenArchetype>
<tags>wizard</tags>
<icon path="icons/new-gdt-project.png" />
- <!--
- <welcome type="editor" url="/${project[0]}/README.md"/>
- -->
</project>
</projects>
14 years