JBoss Tools SVN: r29254 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-21 08:32:13 -0500 (Mon, 21 Feb 2011)
New Revision: 29254
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, code refactoring
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2011-02-20 22:06:46 UTC (rev 29253)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/ExternalizeStringsWizard.java 2011-02-21 13:32:13 UTC (rev 29254)
@@ -80,10 +80,10 @@
"EXTERNALIZE_STRINGS_DIALOG_NEW_FILE_PAGE"; //$NON-NLS-1$
private ITextEditor editor = null;
- BundleMap bm = null;
- ExternalizeStringsWizardPage page1 = null;
- WizardNewFileCreationPage page2 = null;
- ExternalizeStringsWizardRegisterBundlePage page3 = null;
+ private BundleMap bm = null;
+ private ExternalizeStringsWizardPage page1 = null;
+ private WizardNewFileCreationPage page2 = null;
+ private ExternalizeStringsWizardRegisterBundlePage page3 = null;
public ExternalizeStringsWizard(ITextEditor editor, BundleMap bm) {
super();
@@ -301,47 +301,8 @@
Object selectedElement = structuredSelection.getFirstElement();
if (selectedElement instanceof Node) {
Node node = (Node) selectedElement;
- List<TaglibData> taglibs = null;
+ registerMessageTaglib();
String jsfCoreTaglibPrefix = "f"; //$NON-NLS-1$
- boolean isJsfCoreTaglibRegistered = false;
- if (editor instanceof JSPMultiPageEditor) {
- StructuredTextEditor ed = ((JSPMultiPageEditor) editor).getSourceEditor();
- if (ed instanceof JSPTextEditor) {
- IVisualContext context = ((JSPTextEditor) ed).getPageContext();
- if (context instanceof SourceEditorPageContext) {
- SourceEditorPageContext sourcePageContext = (SourceEditorPageContext) context;
- taglibs = sourcePageContext.getTagLibs();
- if (null == taglibs) {
- JspEditorPlugin.getDefault().logError(
- JstUIMessages.CANNOT_LOAD_TAGLIBS_FROM_PAGE_CONTEXT);
- } else {
- for (TaglibData tl : taglibs) {
- if (DropURI.JSF_CORE_URI.equalsIgnoreCase(tl.getUri())) {
- isJsfCoreTaglibRegistered = true;
- jsfCoreTaglibPrefix = tl.getPrefix();
- break;
- }
- }
- if (!isJsfCoreTaglibRegistered) {
- /*
- * Register the required taglib
- */
- PaletteTaglibInserter PaletteTaglibInserter = new PaletteTaglibInserter();
- Properties p = new Properties();
- p.put("selectionProvider", getSelectionProvider()); //$NON-NLS-1$
- p.setProperty(URIConstants.LIBRARY_URI, DropURI.JSF_CORE_URI);
- p.setProperty(URIConstants.LIBRARY_VERSION, ""); //$NON-NLS-1$
- p.setProperty(URIConstants.DEFAULT_PREFIX, jsfCoreTaglibPrefix);
- p.setProperty(JSPPaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, "true"); //$NON-NLS-1$
- p.setProperty(JSPPaletteInsertHelper.PROPOPERTY_REFORMAT_BODY, "yes"); //$NON-NLS-1$
- p.setProperty(PaletteInsertHelper.PROPOPERTY_START_TEXT,
- "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\" %>\\n"); //$NON-NLS-1$
- PaletteTaglibInserter.inserTaglib(ed.getTextViewer().getDocument(), p);
- }
- }
- }
- }
- }
Element loadBundle = node.getOwnerDocument().createElement(
jsfCoreTaglibPrefix + Constants.COLON + "loadBundle"); //$NON-NLS-1$
loadBundle.setAttribute("var", var); //$NON-NLS-1$
@@ -377,6 +338,53 @@
page1.replaceText(replacement);
return true;
}
+ /**
+ * Register Message Taglibs on page
+ */
+ protected void registerMessageTaglib(){
+ List<TaglibData> taglibs = null;
+ String jsfCoreTaglibPrefix = "f"; //$NON-NLS-1$
+ if (editor instanceof JSPMultiPageEditor) {
+ StructuredTextEditor ed = ((JSPMultiPageEditor) editor).getSourceEditor();
+ if (ed instanceof JSPTextEditor) {
+ IVisualContext context = ((JSPTextEditor) ed).getPageContext();
+ if (context instanceof SourceEditorPageContext) {
+ SourceEditorPageContext sourcePageContext = (SourceEditorPageContext) context;
+ taglibs = sourcePageContext.getTagLibs();
+ if (null == taglibs) {
+ JspEditorPlugin.getDefault().logError(
+ JstUIMessages.CANNOT_LOAD_TAGLIBS_FROM_PAGE_CONTEXT);
+ } else {
+ boolean isJsfCoreTaglibRegistered = false;
+ for (TaglibData tl : taglibs) {
+ if (DropURI.JSF_CORE_URI.equalsIgnoreCase(tl.getUri())) {
+ isJsfCoreTaglibRegistered = true;
+ jsfCoreTaglibPrefix = tl.getPrefix();
+ break;
+ }
+ }
+ if (!isJsfCoreTaglibRegistered) {
+ /*
+ * Register the required taglib
+ */
+ PaletteTaglibInserter PaletteTaglibInserter = new PaletteTaglibInserter();
+ Properties p = new Properties();
+ p.put("selectionProvider", getSelectionProvider()); //$NON-NLS-1$
+ p.setProperty(URIConstants.LIBRARY_URI, DropURI.JSF_CORE_URI);
+ p.setProperty(URIConstants.LIBRARY_VERSION, ""); //$NON-NLS-1$
+ p.setProperty(URIConstants.DEFAULT_PREFIX, jsfCoreTaglibPrefix);
+ p.setProperty(JSPPaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, "true"); //$NON-NLS-1$
+ p.setProperty(JSPPaletteInsertHelper.PROPOPERTY_REFORMAT_BODY, "yes"); //$NON-NLS-1$
+ p.setProperty(PaletteInsertHelper.PROPOPERTY_START_TEXT,
+ "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\" %>\\n"); //$NON-NLS-1$
+ PaletteTaglibInserter.inserTaglib(ed.getTextViewer().getDocument(), p);
+ }
+ }
+ }
+ }
+ }
+
+ }
/**
* Creates new bundle map if no one was specified
13 years, 10 months
JBoss Tools SVN: r29253 - trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-02-20 17:06:46 -0500 (Sun, 20 Feb 2011)
New Revision: 29253
Modified:
trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java
Log:
JBIDE-8455 NPE in HibernateProjectConfigurator when importing maven or mavenArchetype project example
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 2011-02-20 21:53:43 UTC (rev 29252)
+++ trunk/maven/plugins/org.jboss.tools.maven.hibernate/src/org/jboss/tools/maven/hibernate/configurators/HibernateProjectConfigurator.java 2011-02-20 22:06:46 UTC (rev 29253)
@@ -12,6 +12,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.preference.IPreferenceStore;
import org.hibernate.eclipse.console.properties.HibernatePropertiesConstants;
import org.hibernate.eclipse.console.utils.ProjectUtils;
@@ -43,7 +44,7 @@
return;
}
- if (isHibernateProject(mavenProject)) {
+ if (project.hasNature(JavaCore.NATURE_ID) && isHibernateProject(mavenProject)) {
IScopeContext scope = new ProjectScope(project);
Preferences node = scope.getNode(HibernatePropertiesConstants.HIBERNATE_CONSOLE_NODE);
if (node != null) {
13 years, 10 months
JBoss Tools SVN: r29252 - trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-02-20 16:53:43 -0500 (Sun, 20 Feb 2011)
New Revision: 29252
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-8454 Invalid sites dialog isn't shown when starting New Project Example wizard
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-02-18 23:59:30 UTC (rev 29251)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2011-02-20 21:53:43 UTC (rev 29252)
@@ -304,7 +304,7 @@
setControl(composite);
configureSizeAndLocation();
- refresh(viewer, false);
+ refresh(viewer, true);
siteCombo.setText(ProjectExamplesActivator.ALL_SITES);
}
13 years, 10 months
JBoss Tools SVN: r29251 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-18 18:59:30 -0500 (Fri, 18 Feb 2011)
New Revision: 29251
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java
Log:
[JBIDE-8333] now persisting last selected realm and profile per cloud.
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java 2011-02-18 22:56:40 UTC (rev 29250)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/ui/preferences/StringsPreferenceValueTest.java 2011-02-18 23:59:30 UTC (rev 29251)
@@ -12,7 +12,7 @@
import static org.junit.Assert.assertEquals;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringsPreferenceValue;
+import org.jboss.tools.deltacloud.ui.preferences.StringsPreferenceValue;
import org.junit.Before;
import org.junit.Test;
13 years, 10 months
JBoss Tools SVN: r29250 - in trunk/download.jboss.org/jbosstools/updates: stable and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-02-18 17:56:40 -0500 (Fri, 18 Feb 2011)
New Revision: 29250
Added:
trunk/download.jboss.org/jbosstools/updates/stable/
trunk/download.jboss.org/jbosstools/updates/stable/README.txt
trunk/download.jboss.org/jbosstools/updates/stable/compositeArtifacts.xml
trunk/download.jboss.org/jbosstools/updates/stable/compositeContent.xml
trunk/download.jboss.org/jbosstools/updates/stable/galileo/
trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeArtif...
trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeConte...
trunk/download.jboss.org/jbosstools/updates/stable/galileo/index.html
trunk/download.jboss.org/jbosstools/updates/stable/ganymede/
trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeArti...
trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeCont...
trunk/download.jboss.org/jbosstools/updates/stable/ganymede/index.html
trunk/download.jboss.org/jbosstools/updates/stable/helios/
trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeArtifa...
trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeConten...
trunk/download.jboss.org/jbosstools/updates/stable/helios/index.html
trunk/download.jboss.org/jbosstools/updates/stable/index.html
Removed:
trunk/download.jboss.org/jbosstools/updates/staging/index.html
Modified:
trunk/download.jboss.org/jbosstools/updates/index.html
Log:
add composite meta files for JBT 3.0 - 3.2 sites; update index.html pages
Modified: trunk/download.jboss.org/jbosstools/updates/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/index.html 2011-02-18 22:07:37 UTC (rev 29249)
+++ trunk/download.jboss.org/jbosstools/updates/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -46,23 +46,27 @@
-->
<br/>
<ul>
+<b>Latest Stable Releases</b><br/>
+<li><a class=link href=stable/helios>JBoss Tools 3.2, Eclipse 3.6 (Helios)</a></li>
+<li><a class=link href=stable/galileo>JBoss Tools 3.1, Eclipse 3.5 (Galileo)</a></li>
+<li><a class=link href=stable/ganymede>JBoss Tools 3.0, Eclipse 3.4 (Ganymede)</a></li>
+<br/>
+<b>Stable Releases</b><br/>
+<li><a class=link href=JBossTools-3.2.0.GA>JBossTools-3.2.0.GA</a></li>
<li><a class=link href=JBossTools-3.1.1.GA>JBossTools-3.1.1.GA</a></li>
-<li><a class=link href=JBossTools-3.1.0.GA>JBossTools-3.1.0.GA</a></li>
<li><a class=link href=JBossTools-3.0.3.GA.zip>JBossTools-3.0.3.GA.zip</a></li>
<li><a class=link href=JBossTools-3.0.3.GA>JBossTools-3.0.3.GA</a></li>
<li><a class=link href=JBossTools-2.1.2.GA>JBossTools-2.1.2.GA</a></li>
<li><a class=link href=JBossTools-2.0.1.GA>JBossTools-2.0.1.GA</a></li>
<li><a class=link href=JBossIDE-2.0.0.Beta2>JBossIDE-2.0.0.Beta2</a></li>
<br/>
-<li><a class=link href=stable/galileo>JBoss Tools 3.1.x, Eclipse 3.5.2 (Galileo)</a></li>
-<li><a class=link href=stable/ganymede>JBoss Tools 3.0.x, Eclipse 3.4.2 (Ganymede)</a></li>
-<br/>
-<li><a class=link href=development>Development Milestones</a> (toward JBoss Tools 3.2, Eclipse 3.6 (Helios))</li>
+<b>Other Updates</b><br/>
+<li><a class=link href=development>Development Milestones</a> (toward JBoss Tools 3.3, Eclipse 3.7 (Indigo)) <i>-- coming soon!</i></li>
<li><a class=link href=nightly>Nightly Builds</a></li>
<br/>
-<li><a class=link href=staging>Staging Update Site Zips</a> (for inclusion in JBDS)
-<li><a class=link href=target-platform>All JBoss Tools dependencies in one update site</a> (for installing or developing JBoss Tools)
-
+<b>Target Platforms</b><br/>
+<li><a class=link href=target-platform>All JBoss Tools 3.2 dependencies in one update site</a> (for installing or developing)
+<li><a class=link href=target-platform_trunk>All JBoss Tools 3.3 dependencies in one update site</a> (for installing or developing)
</ul>
<br/>
</td>
Added: trunk/download.jboss.org/jbosstools/updates/stable/README.txt
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/README.txt (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/README.txt 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,7 @@
+This URL is the latest stable release for JBoss Tools.
+
+For detailed install instructions and requirements, see
+
+http://download.jboss.org/jbosstools/updates/stable/helios/
+ or
+http://www.jboss.org/tools/download/stable/3_2_GA.html
Added: trunk/download.jboss.org/jbosstools/updates/stable/compositeArtifacts.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/compositeArtifacts.xml (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/compositeArtifacts.xml 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='JBoss Tools - Latest Stable Release' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/stable/helios/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/compositeContent.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/compositeContent.xml (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/compositeContent.xml 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='JBoss Tools - Latest Stable Release' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/stable/helios/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeArtif...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeArtif... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeArtif... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.1 - Stable Release' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.1.1.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeConte...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeConte... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/galileo/compositeConte... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.1 - Stable Release' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.1.1.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/galileo/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/galileo/index.html (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/galileo/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1 @@
+<meta http-equiv="refresh" content="0;url=http://download.jboss.org/jbosstools/updates/JBossTools-3.1.1.GA/">
Added: trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeArti...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeArti... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeArti... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.0 - Stable Release' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.0.3.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeCont...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeCont... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/ganymede/compositeCont... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.0 - Stable Release' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.0.3.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/ganymede/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/ganymede/index.html (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/ganymede/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1 @@
+<meta http-equiv="refresh" content="0;url=http://download.jboss.org/jbosstools/updates/JBossTools-3.0.3.GA/">
Added: trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeArtifa...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeArtifa... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeArtifa... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.2 - Stable Release' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.2.0.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeConten...
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeConten... (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/helios/compositeConten... 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='JBoss Tools 3.2 - Stable Release' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+<properties size='2'>
+<property name='p2.compressed' value='true'/>
+<!--
+ get new time w/
+ date +%s000
+-->
+<property name='p2.timestamp' value='1298067380000'/>
+</properties>
+<children size='1'>
+<child location='http://download.jboss.org/jbosstools/updates/JBossTools-3.2.0.GA/'/>
+</children>
+</repository>
Added: trunk/download.jboss.org/jbosstools/updates/stable/helios/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/helios/index.html (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/helios/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1 @@
+<meta http-equiv="refresh" content="0;url=http://download.jboss.org/jbosstools/updates/JBossTools-3.2.0.GA/">
Added: trunk/download.jboss.org/jbosstools/updates/stable/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/stable/index.html (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/stable/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -0,0 +1 @@
+<meta http-equiv="refresh" content="0;url=http://download.jboss.org/jbosstools/updates/">
Deleted: trunk/download.jboss.org/jbosstools/updates/staging/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/staging/index.html 2011-02-18 22:07:37 UTC (rev 29249)
+++ trunk/download.jboss.org/jbosstools/updates/staging/index.html 2011-02-18 22:56:40 UTC (rev 29250)
@@ -1,155 +0,0 @@
-<html>
-<head>
-<title>JBoss Tools Updates - Staging Zips</title>
-<style>
-@import url("../../web/site.css");
-</style>
-</head>
-<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
-<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"
- cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2"><img
- src="https://www.jboss.org/dms/tools/images/tools-banner.png" /></td>
- </tr>
- <tr>
- <td>  </td>
- </tr>
- <tr>
- <td>  </td>
- <td>
- <h2 class="title">JBoss Tools Updates - Staging Zips</h2>
- <table width="100%">
-
- <!-- <tr class="light-row" style="height: 30px">
- <td class="bodyText">
- <p class="bodyText"></p>
- </td>
- </tr> -->
-
- <tr class="dark-row" style="height: 30px">
- <td class="bodyText">
- <!-- <p class="bodyText"></p> -->
-
-<!-- to convert raw fish listing to links do this in vi
-
-:%s#^sftp://tools@filemgmt.jboss.org/downloads_htdocs/tools/updates/staging/\(.\+\)$#<li><a class=link href=\1>\1<\/a></li>#g
-
-Then sftp file into
-
-jbossqa(a)filemgmt.jboss.org/htdocs/jbosstools/updates/
-
-which becomes
-
-http://download.jboss.org/jbosstools/updates/
-
--->
- <br/>
- <ul>
-<li><a class=link href=3.2_trunk/esb-Update.zip>3.2_trunk/esb-Update.zip</a></li>
-<li><a class=link href=3.2_trunk/jbosstools-3.2_trunk.aggregate-Update.zip>3.2_trunk/jbosstools-3.2_trunk.aggregate-Update.zip</a></li>
-<li><a class=link href=3.2_trunk/jbosstools-drools-5.2-Update.zip>3.2_trunk/jbosstools-drools-5.2-Update.zip</a></li>
-<li><a class=link href=3.2_trunk/jbpm-Update.zip>3.2_trunk/jbpm-Update.zip</a></li>
-<li><a class=link href=3.2_trunk/modeshape-Update.zip>3.2_trunk/modeshape-Update.zip</a></li>
-<li><a class=link href=3.2_trunk/usage-Update.zip>3.2_trunk/usage-Update.zip</a></li>
-<br/>
-<li><a class=link href=3.2_stable_branch/esb-Update.zip>3.2_stable_branch/esb-Update.zip</a></li>
-<li><a class=link href=3.2_stable_branch/jbosstools-3.2_stable_branch.aggregate-Update.zip>3.2_stable_branch/jbosstools-3.2_stable_branch.aggregate-Update.zip</a></li>
-<li><a class=link href=3.2_stable_branch/jbosstools-drools-5.2-Update.zip>3.2_stable_branch/jbosstools-drools-5.2-Update.zip</a></li>
-<li><a class=link href=3.2_stable_branch/jbpm-Update.zip>3.2_stable_branch/jbpm-Update.zip</a></li>
-<li><a class=link href=3.2_stable_branch/modeshape-Update.zip>3.2_stable_branch/modeshape-Update.zip</a></li>
-<li><a class=link href=3.2_stable_branch/usage-Update.zip>3.2_stable_branch/usage-Update.zip</a></li>
-<br/>
-<li><a class=link href=jbosstools-teiid-designer-7.1_trunk-Update.zip>jbosstools-teiid-designer-7.1_trunk-Update.zip</a></li>
-<br/>
-<li><a class=link href=jbosstools-teiid-designer-7.1_stable_branch-Update.zip>jbosstools-teiid-designer-7.1_stable_branch-Update.zip</a></li>
-
- </ul>
- <br/>
- </td>
- </tr>
-
- <tr class="light-row" style="height: 30px">
- <td class="bodyText">
- <p class="bodyText">You can also download JBoss Tools as
- individual zips for offline installation. See <a class="link"
- href="http://www.jboss.org/tools/download">JBoss Tools
- Downloads</a>.</p>
- </td>
- </tr>
-
- <tr class="dark-row" style="height: 30px">
- <td class="bodyText">
- <p class="bodyText">For more information, see <a
- href="http://www.jboss.org/tools/download/installation">Installation
- methods</a>.</p>
- </td>
- </tr>
- <tr>
- <td class="spacer"><br />
- </td>
- <td class="spacer"><br />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td></td>
- <td>
- <table width="100%">
- <tr class="header">
- <td class="sub-header" width="100%"><span> Installation
- Types</span></td>
- </tr>
- <tr class="light-row" style="height: 30px">
- <td class="bodyText">
- <p class="bodyText">Depending on how close to the bleeding edge
- you like to be, there are several types of releases available.</p>
- <br />
-
- </td>
- </tr>
-
- <tr class="dark-row" style="height: 30px">
- <td class="bodyText">
- <h4>Stable Releases</h4>
-
- <p><a href="https://www.jboss.org/tools/download/stable.html">Stable
- releases</a> are - as indicated by their name - stable.</p><br/>
-
- </td>
- </tr>
-
- <tr class="light-row" style="height: 30px">
- <td class="bodyText">
- <h4>Development Milestones</h4>
-
- <p><a href="https://www.jboss.org/tools/download/dev.html">Development
- builds</a>, released once per milestone and only a few times a year, are
- fairly stable, but there may be some things which do not yet work.
- If you would like to try one of these milestones, we'd greatly
- appreciate the assistance in testing and <a
- href="https://jira.jboss.org/jira/browse/JBIDE">reporting of
- issues in our issue tracker</a>.</p><br/>
-
- </td>
- </tr>
-
- <tr class="dark-row" style="height: 30px">
- <td class="bodyText">
- <h4>Nightly Builds</h4>
-
- <p>The <a
- href="https://www.jboss.org/tools/download/nightly.html">bleeding
- edge</a> contains the latest and greatest new features, but nothing is
- stable or guaranteed - yet. If you're using a Milestone and need a
- fix, you can update to the latest Nightly, or wait for the next
- Milestone.</p><br/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-</html>
13 years, 10 months
JBoss Tools SVN: r29249 - in workspace/bbrodt: org.eclipse.bpel.model/src/org/eclipse/bpel/model/util and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2011-02-18 17:07:37 -0500 (Fri, 18 Feb 2011)
New Revision: 29249
Modified:
workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF
workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ElementPlacer.java
workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/XSDComparer.java
workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java
Log:
make sure everything actually compiles with J2SE-1.5, like it sez in the plugin manifest
Modified: workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF 2011-02-18 21:20:45 UTC (rev 29248)
+++ workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/META-INF/MANIFEST.MF 2011-02-18 22:07:37 UTC (rev 29249)
@@ -28,5 +28,5 @@
Bundle-Activator: org.eclipse.bpel.apache.ode.runtime.OdePlugin
Export-Package: org.eclipse.bpel.apache.ode.runtime
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.eclipse.bpel.runtimes
Modified: workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ElementPlacer.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ElementPlacer.java 2011-02-18 21:20:45 UTC (rev 29248)
+++ workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/ElementPlacer.java 2011-02-18 22:07:37 UTC (rev 29249)
@@ -227,7 +227,7 @@
boolean textNodeIsWhitespaceOnly = false;
if (nextInnerChild instanceof Text) {
String content = ((Text)nextInnerChild).getData();
- textNodeIsWhitespaceOnly = (content==null || content.trim().isEmpty());
+ textNodeIsWhitespaceOnly = (content==null || "".equals(content.trim()));
}
if (textNodeIsWhitespaceOnly) {
// remove an old indentation
Modified: workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/XSDComparer.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/XSDComparer.java 2011-02-18 21:20:45 UTC (rev 29248)
+++ workspace/bbrodt/org.eclipse.bpel.model/src/org/eclipse/bpel/model/util/XSDComparer.java 2011-02-18 22:07:37 UTC (rev 29249)
@@ -351,7 +351,7 @@
type = type.getBaseType();
}
while (!names.isEmpty()) {
- if (s.isEmpty())
+ if ("".equals(s))
s = names.pop();
else
s = s + ":" + names.pop();
@@ -369,8 +369,8 @@
return false;
}
if (name1.equals(name2)) {
- if (elem1.getTargetNamespace() == null || elem1.getTargetNamespace().isEmpty()
- && elem2.getTargetNamespace() == null || elem2.getTargetNamespace().isEmpty())
+ if (elem1.getTargetNamespace() == null || "".equals(elem1.getTargetNamespace())
+ && elem2.getTargetNamespace() == null || "".equals(elem2.getTargetNamespace()))
return true;
if (elem1.getTargetNamespace().equals(elem2.getTargetNamespace()))
@@ -447,7 +447,7 @@
public int getMinOccurs(XSDTerm term) {
String smin = term.getElement().getAttribute("minOccurs");
int min = 1;
- if (smin!=null && !smin.isEmpty()) {
+ if (smin!=null && !"".equals(smin)) {
try {
min = Integer.parseInt(smin);
} catch (NumberFormatException e) {
@@ -465,7 +465,7 @@
public int getMaxOccurs(XSDTerm term) {
String smax = term.getElement().getAttribute("maxOccurs");
int max = 1;
- if (smax!=null && !smax.isEmpty()) {
+ if (smax!=null && !"".equals(smax)) {
try {
max = Integer.parseInt(smax);
} catch (NumberFormatException e) {
Modified: workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF 2011-02-18 21:20:45 UTC (rev 29248)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/META-INF/MANIFEST.MF 2011-02-18 22:07:37 UTC (rev 29249)
@@ -30,4 +30,4 @@
org.eclipse.bpel.runtimes.publishers,
org.eclipse.bpel.runtimes.ui.wizards
Bundle-Vendor: %providerName
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java 2011-02-18 21:20:45 UTC (rev 29248)
+++ workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariableInitializationSection.java 2011-02-18 22:07:37 UTC (rev 29249)
@@ -293,7 +293,7 @@
From from = fVariable.getFrom();
if (from!=null) {
String literal = from.getLiteral();
- if (literal==null || literal.isEmpty()) {
+ if (literal==null || "".equals(literal.trim())) {
literal = createDefaultInitializer(getBPELEditor(), fVariable, null);
from.setLiteral(literal);
}
@@ -350,7 +350,7 @@
String literal = EMPTY_STRING;
if ( from!=null && to!=null) {
literal = from.getLiteral();
- if (literal==null || literal.isEmpty()) {
+ if (literal==null || "".equals(literal.trim())) {
literal = createDefaultInitializer(bpelEditor, to.getVariable(), to.getPart());
from.setLiteral(literal);
}
13 years, 10 months
JBoss Tools SVN: r29248 - in workspace/bbrodt: org.eclipse.bpel.jboss.riftsaw.runtime and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2011-02-18 16:20:45 -0500 (Fri, 18 Feb 2011)
New Revision: 29248
Modified:
workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java
workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties
workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml
workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java
workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java
workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java
workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java
Log:
Modified: workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -10,17 +10,18 @@
public String getServerAddress()
{
- return "localhost";
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
+ return (String)m.get("serverAddress");
}
public String getPort()
{
- Map m = getAttribute("generic_server_attributes", new HashMap());
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
return (String)m.get("port");
}
public String getDeployDir()
{
- return "";
+ return "/ode/processes";
}
}
Modified: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/plugin.xml 2011-02-18 21:20:45 UTC (rev 29248)
@@ -19,6 +19,9 @@
<moduleType
types="bpel.module"
versions="1.1, 2.0"/>
+ <moduleType
+ types="jbt.bpel.module"
+ versions="1.1, 2.0"/>
</runtimeType>
</extension>
@@ -78,7 +81,18 @@
id="bpel.facet.core"
version="2.0"/>
</supported>
+
+ <supported>
+ <runtime-component
+ id="org.eclipse.bpel.jboss.riftsaw.runtime.rt"
+ version="2.0"/>
+ <facet
+ id="jbt.bpel.facet.core"
+ version="1.1,2.0"/>
+ </supported>
+
</extension>
+
<extension point="org.eclipse.wst.common.project.facet.ui.images">
<image
runtime-component-type="org.eclipse.bpel.jboss.riftsaw.runtime.rt"
@@ -102,6 +116,11 @@
runtime-component="org.eclipse.bpel.jboss.riftsaw.runtime.rt"
version="2.0"/>
</extension>
+
+ <runtimeFacetMapping
+ runtimeTypeId="org.jboss.ide.eclipse.as.runtime.51"
+ runtime-component="org.jboss.ide.eclipse.as.runtime.component"
+ version="5.1"/>
<extension point="org.eclipse.jst.server.generic.core.serverdefinition">
<serverdefinition
Modified: workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/src/org/eclipse/bpel/jboss/riftsaw/runtime/RiftsawServerRuntime.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -10,12 +10,13 @@
public String getServerAddress()
{
- return "localhost";
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
+ return (String)m.get("serverAddress");
}
public String getPort()
{
- Map m = getAttribute("generic_server_attributes", new HashMap());
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
return (String)m.get("port");
}
Modified: workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.properties 2011-02-18 21:20:45 UTC (rev 29248)
@@ -19,3 +19,7 @@
NEW_BPEL_CATEGORY=BPEL 2.0
NEW_BPEL_PROJECT=BPEL Project
NEW_BPEL_PROJECT_DESCRIPTION=Create a new BPEL project.
+
+JBT_BPEL_FACET_TEMPLATE_LABEL=JBoss Legacy BPEL 2.0 Project
+JBT_BPEL_CORE_FACET_LABEL=JBoss AS 5.1 BPEL Facet
+JBT_BPEL_CORE_FACET_DESCRIPTION=For migration of JBoss BPEL projects from AS 5.1
Modified: workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/plugin.xml 2011-02-18 21:20:45 UTC (rev 29248)
@@ -92,6 +92,31 @@
<label>%BPEL_FACET_TEMPLATE_LABEL</label>
<fixed facet="bpel.facet.core"/>
</template>
+
+ <project-facet id="jbt.bpel.facet.core">
+ <label>%JBT_BPEL_CORE_FACET_LABEL</label>
+ <description>%JBT_BPEL_CORE_FACET_DESCRIPTION</description>
+ </project-facet>
+
+ <project-facet-version facet="jbt.bpel.facet.core" version="2.0">
+ <group-member id="modules"></group-member>
+ <constraint>
+ <conflicts group="modules">
+ </conflicts>
+ </constraint>
+ </project-facet-version>
+
+
+ <action facet="jbt.bpel.facet.core" version="2.0" type="INSTALL" id="jbt.bpel.facet.core.install">
+ <delegate class="org.eclipse.bpel.runtimes.facets.BPELCoreFacetInstallDelegate"/>
+ <config-factory class="org.eclipse.bpel.runtimes.facets.BPELFacetInstallDataModelProvider"/>
+ </action>
+
+ <template id="template.jbt.bpel.core">
+ <label>%JBT_BPEL_FACET_TEMPLATE_LABEL</label>
+ <fixed facet="jbt.bpel.facet.core"/>
+ </template>
+
</extension>
Modified: workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.runtimes/src/org/eclipse/bpel/runtimes/IBPELRuntimeDelegate.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -2,6 +2,10 @@
public interface IBPELRuntimeDelegate {
+ /*
+ * These are currently only used by the BPEL New File Wizard to
+ * figure out how to build the service address for its WSDL.
+ */
public String getServerAddress();
public String getPort();
public String getDeployDir();
Modified: workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizard.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -152,10 +152,10 @@
Messages.NewFileWizard_WSDLCustomPage_Name);
addPage(fMainPage);
+ addPage(fContainerPage);
addPage(wsdlPage);
- addPage(fContainerPage);
- wsdlPage.setPreviousPage(fMainPage);
- fContainerPage.setPreviousPage(wsdlPage);
+ wsdlPage.setPreviousPage(fContainerPage);
+ fContainerPage.setPreviousPage(fMainPage);
}
/**
@@ -213,6 +213,16 @@
return container.getProject();
return null;
}
+
+ public IResource getResourceContainer()
+ {
+ IContainer container = fContainerPage.getResourceContainer();
+ if (container == null) {
+ container = mContainer;
+ }
+ return container;
+ }
+
/**
* Return the BPEL files container in which we can generate process from the
* template.
Modified: workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/NewFileWizardPage2.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -72,7 +72,8 @@
Messages.NewFileWizardPage2_1,
Messages.NewFileWizardPage2_2 );
-
+
+ fResourceComposite.setSelectedResource(((NewFileWizard)getWizard()).getResourceContainer());
setControl( composite );
}
Modified: workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java
===================================================================
--- workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java 2011-02-18 21:05:08 UTC (rev 29247)
+++ workspace/bbrodt/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java 2011-02-18 21:20:45 UTC (rev 29248)
@@ -76,38 +76,6 @@
setDescription(Messages.NewFileWizard_WSDLCustomPage_Description);
setImageDescriptor(BPELUIPlugin.INSTANCE
.getImageDescriptor(IBPELUIConstants.ICON_WIZARD_BANNER));
-
-
- // TODO: test code - implement this when we switch over to generic runtime support
- // for deployment to jboss/riftsaw and others...
- try {
- IProject project = ((NewFileWizard)getWizard()).getProject();
- IFacetedProject facetedProject = null;
- facetedProject = ProjectFacetsManager.create(project);
- if (facetedProject != null
- && ProjectFacetsManager.isProjectFacetDefined(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET))
- {
- IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
- IRuntime rt = facetedProject.getPrimaryRuntime();
- String id = rt.getProperty("id");
- org.eclipse.wst.server.core.IRuntime rt2 = ServerCore.findRuntime(id);
- IRuntimeType rtt = rt2.getRuntimeType();
- RuntimeDelegate delegate = (RuntimeDelegate) rt2.getAdapter(RuntimeDelegate.class);
- if (delegate instanceof IBPELRuntimeDelegate) {
- // get port, server address and deploy directory
- // to build service name for WSDL
- IBPELRuntimeDelegate bpelDelegate = (IBPELRuntimeDelegate)delegate;
- String address = bpelDelegate.getServerAddress();
- String port = bpelDelegate.getPort();
- String deployDir = bpelDelegate.getDeployDir();
- }
- }
- }
- catch(Exception e)
- {
-
- }
-
}
public void createControl(Composite parent) {
@@ -221,6 +189,40 @@
bindingLabel.setVisible(true);
bindingField.setVisible(true);
}
+
+ if (visible) {
+
+ // TODO: test code - implement this when we switch over to generic runtime support
+ // for deployment to jboss/riftsaw and others...
+ try {
+ IProject project = ((NewFileWizard)getWizard()).getProject();
+ IFacetedProject facetedProject = null;
+ facetedProject = ProjectFacetsManager.create(project);
+ if (facetedProject != null
+ && ProjectFacetsManager.isProjectFacetDefined(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET))
+ {
+ IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.BPEL20_PROJECT_FACET);
+ IRuntime rt = facetedProject.getPrimaryRuntime();
+ String id = rt.getProperty("id");
+ org.eclipse.wst.server.core.IRuntime rt2 = ServerCore.findRuntime(id);
+ IRuntimeType rtt = rt2.getRuntimeType();
+ RuntimeDelegate delegate = (RuntimeDelegate) rt2.getAdapter(RuntimeDelegate.class);
+ if (delegate instanceof IBPELRuntimeDelegate) {
+ // get port, server address and deploy directory
+ // to build service name for WSDL
+ IBPELRuntimeDelegate bpelDelegate = (IBPELRuntimeDelegate)delegate;
+ String address = bpelDelegate.getServerAddress();
+ String port = bpelDelegate.getPort();
+ String deployDir = bpelDelegate.getDeployDir();
+ addressField.setText("http://" + address + ":" + port + deployDir + "/" + serviceNameField.getText().trim());
+ }
+ }
+ }
+ catch(Exception e)
+ {
+
+ }
+ }
}
protected boolean validatePage() {
13 years, 10 months
JBoss Tools SVN: r29247 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-18 16:05:08 -0500 (Fri, 18 Feb 2011)
New Revision: 29247
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java
Log:
JBIDE-8423 patch 2
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java 2011-02-18 16:45:00 UTC (rev 29246)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/job/InstanceStateJob.java 2011-02-18 21:05:08 UTC (rev 29247)
@@ -32,6 +32,8 @@
protected IStatus doRun(IProgressMonitor monitor) throws Exception {
String id = getInstance().getId();
getCloud().waitForState(id, expectedState, monitor);
+ if( monitor.isCanceled())
+ return Status.CANCEL_STATUS;
return Status.OK_STATUS;
}
13 years, 10 months
JBoss Tools SVN: r29246 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-18 11:45:00 -0500 (Fri, 18 Feb 2011)
New Revision: 29246
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/AbstractPreferenceValue.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringPreferenceValue.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringsPreferenceValue.java
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/AbstractPreferenceValue.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringPreferenceValue.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringsPreferenceValue.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/SshPrivateKeysPreferences.java
Log:
[JBIDE-8333] now persisting last selected realm and profile per cloud.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-02-18 16:45:00 UTC (rev 29246)
@@ -1,3 +1,12 @@
+2011-02-18 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
+ (getProfileIndex):
+ (setSelectedProfileIndex):
+ (getRealmIndex):
+ (setSelectedRealm):
+ [JBIDE-8333] now persisting last selected realm and profile per cloud.
+
2011-02-04 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/ui/commands/StopInstanceHandler.java
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-02-18 16:45:00 UTC (rev 29246)
@@ -26,6 +26,7 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.deltacloud.ui,
+ org.jboss.tools.deltacloud.ui.preferences,
org.jboss.tools.deltacloud.ui.wizard,
org.jboss.tools.internal.deltacloud.ui.preferences;x-friends:="org.jboss.tools.deltacloud.test",
org.jboss.tools.internal.deltacloud.ui.utils
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/IDeltaCloudPreferenceConstants.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -12,12 +12,19 @@
public interface IDeltaCloudPreferenceConstants {
- public final static String DONT_CONFIRM_CREATE_INSTANCE = "dont_confirm_create_instance"; //$NON-NLS-1$
- public final static String DONT_CONFIRM_STOP_INSTANCE = "dont_confirm_stop_instance"; //$NON-NLS-1$
- public final static String AUTO_CONNECT_INSTANCE = "auto_connect_instance"; //$NON-NLS-1$
- public final static String LAST_EC2_KEYNAME = "last_ec2_keyname"; //$NON-NLS-1$
- public final static String DEFAULT_KEY_DIR = "default_key_directory"; //$NON-NLS-1$
- public final static String LAST_CLOUD_INSTANCE_VIEW = "last_cloud_instance_view"; //$NON-NLS-1$
- public final static String LAST_CLOUD_IMAGE_VIEW = "last_cloud_image_view"; //$NON-NLS-1$
+ public static final String DONT_CONFIRM_CREATE_INSTANCE = "dont_confirm_create_instance"; //$NON-NLS-1$
+ public static final String DONT_CONFIRM_STOP_INSTANCE = "dont_confirm_stop_instance"; //$NON-NLS-1$
+ public static final String AUTO_CONNECT_INSTANCE = "auto_connect_instance"; //$NON-NLS-1$
+ public static final String LAST_EC2_KEYNAME = "last_ec2_keyname"; //$NON-NLS-1$
+ public static final String DEFAULT_KEY_DIR = "default_key_directory"; //$NON-NLS-1$
+ public static final String CLOUD_NAME_PROPOSAL_KEY = "cloud_name";//$NON-NLS-1$
+ public static final String CLOUD_USERNAME_PROPOSAL_KEY = "cloud_username";//$NON-NLS-1$
+ public static final String CLOUD_URL_PROPOSAL_KEY = "cloud_url";//$NON-NLS-1$
+ public static final String CLOUD_LAST_INSTANCE_KEY = "last_cloud_instance_view"; //$NON-NLS-1$
+ public static final String CLOUD_LAST_IMAGE_KEY = "last_cloud_image_view"; //$NON-NLS-1$
+
+ public static final String INSTANCE_NAME_PROPOSAL_KEY = "instance_name";//$NON-NLS-1$
+ public static final String INSTANCE_IMAGE_PROPOSAL_KEY = "instance_image";//$NON-NLS-1$
+ public static final String INSTANCE_KEY_PROPOSAL_KEY = "instance_key";//$NON-NLS-1$
}
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/AbstractPreferenceValue.java (from rev 29034, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/AbstractPreferenceValue.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/AbstractPreferenceValue.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/AbstractPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
+
+/**
+ * @author Andre Dietisheim
+ */
+public abstract class AbstractPreferenceValue<TYPE> {
+
+ private String pluginId;
+ private String prefsKey;
+
+ public AbstractPreferenceValue(String prefsKey, String pluginId) {
+ this.pluginId = pluginId;
+ this.prefsKey = prefsKey;
+ }
+
+ public abstract TYPE get();
+
+ protected String doGet() {
+ return doGet(null);
+ }
+
+ public abstract TYPE get(TYPE currentValue);
+
+ protected String doGet(String currentValue) {
+ if( currentValue == null || currentValue.equals("")) {
+ // pre-set with previously used
+ Preferences prefs = getPreferences(this.pluginId);
+ return prefs.get(prefsKey, "");
+ } else {
+ return currentValue;
+ }
+ }
+
+ public void remove() {
+ String prefsValue = doGet();
+ if (prefsValue == null
+ || prefsValue == null) {
+ return;
+ }
+ store(null);
+ }
+
+ public abstract void store(TYPE value);
+
+ protected void doStore(String value) {
+ Preferences prefs = getPreferences(this.pluginId);
+ String prefsValue = prefs.get(prefsKey, "");
+ if (prefsValue == null
+ || prefsValue.equals("")
+ || !prefsValue.equals(value)) {
+ prefs.put(prefsKey, value);
+ try {
+ prefs.flush();
+ } catch (BackingStoreException bse) {
+ // intentionally ignore, non-critical
+ }
+ }
+ }
+
+ protected Preferences getPreferences(String pluginId) {
+ return new InstanceScope().getNode(pluginId);
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/AbstractPreferenceValue.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringPreferenceValue.java (from rev 29034, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringPreferenceValue.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringPreferenceValue.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.preferences;
+
+
+
+/**
+ * @author Andre Dietisheim
+ */
+public class StringPreferenceValue extends AbstractPreferenceValue<String> {
+
+ public StringPreferenceValue(String prefsKey, String pluginId) {
+ super(prefsKey, pluginId);
+ }
+
+ public String get() {
+ return get(null);
+ }
+
+ public String get(String currentValue) {
+ return doGet(currentValue);
+ }
+
+ public void store(String value) {
+ doStore(value);
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringPreferenceValue.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringsPreferenceValue.java (from rev 29067, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringsPreferenceValue.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringsPreferenceValue.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringsPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.ui.preferences;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+
+/**
+ * A class that offers access to a collection of values that is stored in the
+ * preferences under a single key.
+ *
+ * @author Andre Dietisheim
+ */
+public class StringsPreferenceValue extends AbstractPreferenceValue<String[]> {
+
+ private String delimiter;
+ private String escapedDelimiter;
+
+ public StringsPreferenceValue(char delimiter, String prefsKey, String pluginId) {
+ super(prefsKey, pluginId);
+ this.delimiter = String.valueOf(delimiter);
+ try {
+ this.escapedDelimiter = URLEncoder.encode(String.valueOf(delimiter), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // cannot happen since we use a fixed, known encoding
+ }
+ }
+
+ public String[] get() {
+ return get(null);
+ }
+
+ public String[] get(String[] currentValues) {
+
+ String string = doGet(null);
+ String[] prefValues = split(string);
+ return overrideValues(currentValues, prefValues);
+ }
+
+ private String[] split(String string) {
+ ArrayList<String> values = new ArrayList<String>();
+ StringTokenizer tokenizer = new StringTokenizer(string, delimiter);
+ while (tokenizer.hasMoreTokens()) {
+ String value = tokenizer.nextToken();
+ String unescapedValue = unescapeDelimiterCharacter(value);
+ values.add(unescapedValue);
+ }
+ return values.toArray(new String[values.size()]);
+ }
+
+ private String[] overrideValues(String[] newValues, String[] prefValues) {
+ if (prefValues == null) {
+ return newValues;
+ }
+
+ for (int i = 0; i < prefValues.length; i++) {
+ if (newValues == null
+ || newValues.length < i) {
+ break;
+ }
+ prefValues[i] = newValues[i];
+ }
+ return prefValues;
+ }
+
+ /**
+ * Adds the given string value to this preference value(s). Duplicate values
+ * are not added.
+ *
+ * @param value
+ * the value to add
+ */
+ public void add(String value) {
+ String currentValues = doGet();
+ StringBuilder builder = new StringBuilder(currentValues);
+ value = escapeDelimiterCharacter(value);
+ if (!contains(value, currentValues)) {
+ if (hasValues(currentValues)) {
+ builder.append(delimiter);
+ }
+ builder.append(value);
+ doStore(builder.toString());
+ }
+ }
+
+ private String escapeDelimiterCharacter(String value) {
+ if (value == null || value.length() == 0) {
+ return value;
+ }
+
+ int index = value.indexOf(delimiter);
+ if (index < 0) {
+ return value;
+ }
+ StringBuilder builder = new StringBuilder(value.substring(0, index));
+ builder.append(escapedDelimiter);
+ builder.append(value.substring(index + 1));
+ return builder.toString();
+ }
+
+ private String unescapeDelimiterCharacter(String value) {
+ if (value == null || value.length() == 0) {
+ return value;
+ }
+
+ int index = value.indexOf(escapedDelimiter);
+ if (index < 0) {
+ return value;
+ }
+ StringBuilder builder = new StringBuilder(value.substring(0, index));
+ builder.append(delimiter);
+ builder.append(value.substring(index + 1));
+ return builder.toString();
+ }
+
+ private boolean contains(String value, String currentValues) {
+ return currentValues != null
+ && currentValues.length() > 0
+ && currentValues.indexOf(value) >= 0;
+ }
+
+ private boolean hasValues(String currentValues) {
+ return currentValues != null && currentValues.length() > 0;
+ }
+
+ /**
+ * Removes the given values from the strings stored in the preferences and
+ * stores the preferences.
+ *
+ * @param values
+ * the values
+ */
+ public void remove(String... valuesToRemove) {
+ boolean removed = false;
+ String[] currentValues = get();
+ if (valuesToRemove != null) {
+ for (int i = 0; i < currentValues.length; i++) {
+ for (String valueToRemove : valuesToRemove) {
+ if (valueToRemove.equals(currentValues[i])) {
+ currentValues[i] = null;
+ removed = true;
+ }
+ }
+ }
+ }
+ if (removed) {
+ store(currentValues);
+ }
+ }
+
+ /**
+ * Overrides the current values in the preferences with the values in the
+ * given array (value in the preferences at index x is overridden with the
+ * value in the given array at index x) and stores the preferences.
+ */
+ public void store(String[] newValues) {
+ String[] currentValues = get();
+ overrideValues(newValues, currentValues);
+ doStore(concatenate(currentValues));
+ }
+
+ public void store() {
+ store(null);
+ }
+
+ protected String concatenate(String[] values) {
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < values.length; i++) {
+ if (values[i] != null) {
+ if (builder.length() > 0) {
+ builder.append(delimiter);
+ }
+ builder.append(values[i]);
+ }
+ }
+ return builder.toString();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/preferences/StringsPreferenceValue.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/AbstractCloudElementTableView.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -52,10 +52,10 @@
import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
+import org.jboss.tools.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.jboss.tools.deltacloud.ui.views.Columns;
import org.jboss.tools.deltacloud.ui.views.Columns.Column;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.utils.WorkbenchUtils;
/**
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/ImageView.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -29,7 +29,7 @@
@Override
protected String getSelectedCloudPrefsKey() {
- return IDeltaCloudPreferenceConstants.LAST_CLOUD_IMAGE_VIEW;
+ return IDeltaCloudPreferenceConstants.CLOUD_LAST_IMAGE_KEY;
}
@Override
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloudelements/InstanceView.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -30,7 +30,7 @@
public class InstanceView extends AbstractCloudElementTableView<DeltaCloudInstance> {
protected String getSelectedCloudPrefsKey() {
- return IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW;
+ return IDeltaCloudPreferenceConstants.CLOUD_LAST_INSTANCE_KEY;
}
@Override
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/AbstractPreferenceValue.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/AbstractPreferenceValue.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/AbstractPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.preferences;
-
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-
-/**
- * @author Andre Dietisheim
- */
-public abstract class AbstractPreferenceValue<TYPE> {
-
- private String pluginId;
- private String prefsKey;
-
- public AbstractPreferenceValue(String prefsKey, String pluginId) {
- this.pluginId = pluginId;
- this.prefsKey = prefsKey;
- }
-
- public abstract TYPE get();
-
- protected String doGet() {
- return doGet(null);
- }
-
- public abstract TYPE get(TYPE currentValue);
-
- protected String doGet(String currentValue) {
- if( currentValue == null || currentValue.equals("")) {
- // pre-set with previously used
- Preferences prefs = getPreferences(this.pluginId);
- return prefs.get(prefsKey, "");
- } else {
- return currentValue;
- }
- }
-
- public void remove() {
- String prefsValue = doGet();
- if (prefsValue == null
- || prefsValue == null) {
- return;
- }
- store(null);
- }
-
- public abstract void store(TYPE value);
-
- protected void doStore(String value) {
- Preferences prefs = getPreferences(this.pluginId);
- String prefsValue = prefs.get(prefsKey, "");
- if (prefsValue == null
- || prefsValue.equals("")
- || !prefsValue.equals(value)) {
- prefs.put(prefsKey, value);
- try {
- prefs.flush();
- } catch (BackingStoreException bse) {
- // intentionally ignore, non-critical
- }
- }
- }
-
- protected Preferences getPreferences(String pluginId) {
- return new InstanceScope().getNode(pluginId);
- }
-}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringPreferenceValue.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringPreferenceValue.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.preferences;
-
-
-/**
- * @author Andre Dietisheim
- */
-public class StringPreferenceValue extends AbstractPreferenceValue<String> {
-
- public StringPreferenceValue(String prefsKey, String pluginId) {
- super(prefsKey, pluginId);
- }
-
- public String get() {
- return get(null);
- }
-
- public String get(String currentValue) {
- return doGet(currentValue);
- }
-
- public void store(String value) {
- doStore(value);
- }
-}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringsPreferenceValue.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringsPreferenceValue.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/preferences/StringsPreferenceValue.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.preferences;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
-
-/**
- * A class that offers access to a collection of values that is stored in the
- * preferences under a single key.
- *
- * @author Andre Dietisheim
- */
-public class StringsPreferenceValue extends AbstractPreferenceValue<String[]> {
-
- private String delimiter;
- private String escapedDelimiter;
-
- public StringsPreferenceValue(char delimiter, String prefsKey, String pluginId) {
- super(prefsKey, pluginId);
- this.delimiter = String.valueOf(delimiter);
- try {
- this.escapedDelimiter = URLEncoder.encode(String.valueOf(delimiter), "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // cannot happen since we use a fixed, known encoding
- }
- }
-
- public String[] get() {
- return get(null);
- }
-
- public String[] get(String[] currentValues) {
-
- String string = doGet(null);
- String[] prefValues = split(string);
- return overrideValues(currentValues, prefValues);
- }
-
- private String[] split(String string) {
- ArrayList<String> values = new ArrayList<String>();
- StringTokenizer tokenizer = new StringTokenizer(string, delimiter);
- while (tokenizer.hasMoreTokens()) {
- String value = tokenizer.nextToken();
- String unescapedValue = unescapeDelimiterCharacter(value);
- values.add(unescapedValue);
- }
- return values.toArray(new String[values.size()]);
- }
-
- private String[] overrideValues(String[] newValues, String[] prefValues) {
- if (prefValues == null) {
- return newValues;
- }
-
- for (int i = 0; i < prefValues.length; i++) {
- if (newValues == null
- || newValues.length < i) {
- break;
- }
- prefValues[i] = newValues[i];
- }
- return prefValues;
- }
-
- /**
- * Adds the given string value to this preference value(s). Duplicate values
- * are not added.
- *
- * @param value
- * the value to add
- */
- public void add(String value) {
- String currentValues = doGet();
- StringBuilder builder = new StringBuilder(currentValues);
- value = escapeDelimiterCharacter(value);
- if (!contains(value, currentValues)) {
- if (hasValues(currentValues)) {
- builder.append(delimiter);
- }
- builder.append(value);
- doStore(builder.toString());
- }
- }
-
- private String escapeDelimiterCharacter(String value) {
- if (value == null || value.length() == 0) {
- return value;
- }
-
- int index = value.indexOf(delimiter);
- if (index < 0) {
- return value;
- }
- StringBuilder builder = new StringBuilder(value.substring(0, index));
- builder.append(escapedDelimiter);
- builder.append(value.substring(index + 1));
- return builder.toString();
- }
-
- private String unescapeDelimiterCharacter(String value) {
- if (value == null || value.length() == 0) {
- return value;
- }
-
- int index = value.indexOf(escapedDelimiter);
- if (index < 0) {
- return value;
- }
- StringBuilder builder = new StringBuilder(value.substring(0, index));
- builder.append(delimiter);
- builder.append(value.substring(index + 1));
- return builder.toString();
- }
-
- private boolean contains(String value, String currentValues) {
- return currentValues != null
- && currentValues.length() > 0
- && currentValues.indexOf(value) >= 0;
- }
-
- private boolean hasValues(String currentValues) {
- return currentValues != null && currentValues.length() > 0;
- }
-
- /**
- * Removes the given values from the strings stored in the preferences and
- * stores the preferences.
- *
- * @param values
- * the values
- */
- public void remove(String... valuesToRemove) {
- boolean removed = false;
- String[] currentValues = get();
- if (valuesToRemove != null) {
- for (int i = 0; i < currentValues.length; i++) {
- for (String valueToRemove : valuesToRemove) {
- if (valueToRemove.equals(currentValues[i])) {
- currentValues[i] = null;
- removed = true;
- }
- }
- }
- }
- if (removed) {
- store(currentValues);
- }
- }
-
- /**
- * Overrides the current values in the preferences with the values in the
- * given array (value in the preferences at index x is overridden with the
- * value in the given array at index x) and stores the preferences.
- */
- public void store(String[] newValues) {
- String[] currentValues = get();
- overrideValues(newValues, currentValues);
- doStore(concatenate(currentValues));
- }
-
- public void store() {
- store(null);
- }
-
- protected String concatenate(String[] values) {
- StringBuilder builder = new StringBuilder();
- for (int i = 0; i < values.length; i++) {
- if (values[i] != null) {
- if (builder.length() > 0) {
- builder.append(delimiter);
- }
- builder.append(values[i]);
- }
- }
- return builder.toString();
- }
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/UIUtils.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -28,7 +28,7 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringsPreferenceValue;
+import org.jboss.tools.deltacloud.ui.preferences.StringsPreferenceValue;
import org.osgi.service.prefs.Preferences;
/**
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -60,12 +60,13 @@
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import org.jboss.tools.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.CompositeValidator;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
import org.jboss.tools.internal.deltacloud.ui.common.swt.JFaceUtils;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -74,10 +75,6 @@
*/
public class CloudConnectionPage extends WizardPage {
- private static final String NAME_PROPOSAL_KEY = "cloud_name";
- private static final String USERNAME_PROPOSAL_KEY = "cloud_username";
- private static final String URL_PROPOSAL_KEY = "cloud_url";
-
private static final int CLOUDTYPE_CHECK_DELAY = 1000;
private static final String DESCRIPTION = "CloudConnection.desc"; //$NON-NLS-1$
@@ -335,7 +332,7 @@
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(nameText, IDeltaCloudPreferenceConstants.CLOUD_NAME_PROPOSAL_KEY);
bindName(dbc, nameText);
// url
@@ -343,7 +340,7 @@
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(urlText, URL_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(urlText, IDeltaCloudPreferenceConstants.CLOUD_URL_PROPOSAL_KEY);
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(urlText),
BeanProperties.value(
@@ -368,7 +365,7 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(usernameText, USERNAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(usernameText, IDeltaCloudPreferenceConstants.CLOUD_USERNAME_PROPOSAL_KEY);
IObservableValue usernameObservable = WidgetProperties.text(SWT.Modify).observe(usernameText);
dbc.bindValue(
usernameObservable,
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionWizard.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -27,8 +27,8 @@
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
+import org.jboss.tools.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.preferences.IPreferenceKeys;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.internal.deltacloud.ui.utils.WizardUtils;
/**
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -68,6 +68,7 @@
import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob;
import org.jboss.tools.deltacloud.core.job.AbstractCloudElementJob.CLOUDELEMENT;
import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
import org.jboss.tools.internal.deltacloud.ui.common.databinding.validator.SelectedComboItemValidator;
@@ -80,10 +81,6 @@
*/
public class NewInstancePage extends WizardPage {
- private static final String NAME_PROPOSAL_KEY = "instance_name";
- private static final String IMAGE_PROPOSAL_KEY = "instance_image";
- private static final String KEY_PROPOSAL_KEY = "instance_key";
-
private static final int IMAGE_CHECK_DELAY = 500;
private static final int KEY_CHECK_DELAY = 500;
@@ -155,7 +152,7 @@
super(WizardMessages.getString(NAME));
this.cloud = cloud;
String defaultKeyname = cloud.getLastKeyname();
- model = new NewInstancePageModel(defaultKeyname, image); //$NON-NLS-1$
+ model = new NewInstancePageModel(defaultKeyname, image, cloud); //$NON-NLS-1$
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
@@ -180,14 +177,14 @@
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
this.nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(nameText, NAME_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(nameText, IDeltaCloudPreferenceConstants.INSTANCE_NAME_PROPOSAL_KEY);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).applyTo(nameText);
Label imageLabel = new Label(container, SWT.NULL);
imageLabel.setText(WizardMessages.getString(IMAGE_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(imageLabel);
this.imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(imageText, IMAGE_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(imageText, IDeltaCloudPreferenceConstants.INSTANCE_IMAGE_PROPOSAL_KEY);
GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).applyTo(imageText);
Button findImageButton = new Button(container, SWT.NULL);
findImageButton.setText(WizardMessages.getString(FIND_BUTTON_LABEL));
@@ -212,7 +209,7 @@
keyLabel.setText(WizardMessages.getString(KEY_LABEL));
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(keyLabel);
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
- UIUtils.createPreferencesProposalAdapter(keyText, KEY_PROPOSAL_KEY);
+ UIUtils.createPreferencesProposalAdapter(keyText, IDeltaCloudPreferenceConstants.INSTANCE_KEY_PROPOSAL_KEY);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(keyText);
Button keyManageButton = new Button(container, SWT.NULL);
keyManageButton.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -14,6 +14,7 @@
import java.util.Collection;
import java.util.List;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudRealm;
@@ -49,8 +50,10 @@
private String cpu;
private String storage;
private String memory;
+ private DeltaCloud cloud;
- protected NewInstancePageModel(String keyId, DeltaCloudImage image) {
+ protected NewInstancePageModel(String keyId, DeltaCloudImage image, DeltaCloud cloud) {
+ this.cloud = cloud;
this.keyId = keyId;
this.image = image;
}
@@ -74,6 +77,10 @@
setArch(image.getArchitecture());
}
+ public int getSelectedRealmIndex() {
+ return realms.indexOf(selectedRealm);
+ }
+
public void setSelectedRealmIndex(int index) {
if (realms.size() > index) {
int oldIndex = -1;
@@ -82,17 +89,34 @@
oldIndex = realms.indexOf(selectedRealm);
}
DeltaCloudRealm deltaCloudRealm = realms.get(index);
- setSelectedRealm(deltaCloudRealm);
+ selectedRealm = deltaCloudRealm;
+ cloud.setLastRealmName(selectedRealm.getName());
firePropertyChange(PROPERTY_SELECTED_REALM_INDEX, oldIndex, index);
}
}
- public int getSelectedRealmIndex() {
- return realms.indexOf(selectedRealm);
+ private void setSelectedRealm(String name) {
+ if (realms.size() > 0) {
+ int index = getRealmIndex(name);
+ if (index >= 0) {
+ setSelectedRealmIndex(index);
+ }
+ }
}
- public void setSelectedRealm(DeltaCloudRealm realm) {
- selectedRealm = realm;
+ private int getRealmIndex(String name) {
+ int index = 0;
+ if (name != null
+ && realms != null
+ && realms.size() > 0) {
+ for (int i = 0; i < realms.size(); i++) {
+ if (name.equals(realms.get(i).getName())) {
+ index = i;
+ break;
+ }
+ }
+ }
+ return index;
}
public String getRealmId() {
@@ -104,14 +128,14 @@
protected void setRealms(List<DeltaCloudRealm> realms) {
firePropertyChange(PROPERTY_REALMS, this.realms, this.realms = realms);
- setSelectedRealmIndex(0);
+ setSelectedRealm(cloud.getLastRealmName());
}
public List<DeltaCloudRealm> getRealms() {
return realms;
}
- protected void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
+ public void setAllProfiles(List<DeltaCloudHardwareProfile> profiles) {
firePropertyChange(PROP_ALL_PROFILES, this.allProfiles, this.allProfiles = profiles);
setFilteredProfiles(filterProfiles(image, profiles));
}
@@ -122,7 +146,7 @@
private void setFilteredProfiles(List<DeltaCloudHardwareProfile> profiles) {
firePropertyChange(PROP_FILTERED_PROFILES, this.filteredProfiles, this.filteredProfiles = profiles);
- setSelectedProfileIndex(0);
+ setSelectedProfileIndex();
}
public List<DeltaCloudHardwareProfile> getFilteredProfiles() {
@@ -143,6 +167,24 @@
return filteredProfiles;
}
+ private void setSelectedProfileIndex() {
+ setSelectedProfileIndex(getProfileIndex(cloud.getLastProfileId()));
+ }
+
+ private int getProfileIndex(String selectedProfileId) {
+ int index = 0;
+ if (selectedProfileId != null
+ && filteredProfiles != null && filteredProfiles.size() > 0) {
+ for (int i = 0; i < filteredProfiles.size(); i++) {
+ if (selectedProfileId.equals(filteredProfiles.get(i).getId())) {
+ index = i;
+ break;
+ }
+ }
+ }
+ return index;
+ }
+
public void setSelectedProfileIndex(int index) {
if (filteredProfiles.size() > index) {
int oldIndex = -1;
@@ -151,8 +193,9 @@
oldIndex = filteredProfiles.indexOf(selectedProfile);
}
DeltaCloudHardwareProfile hardwareProfile = filteredProfiles.get(index);
- setSelectedProfile(hardwareProfile);
+ selectedProfile = hardwareProfile;
firePropertyChange(PROP_SELECTED_PROFILE_INDEX, oldIndex, index);
+ cloud.setLastProfileId(hardwareProfile.getId());
}
}
@@ -164,10 +207,6 @@
return filteredProfiles.indexOf(selectedProfile);
}
- public void setSelectedProfile(DeltaCloudHardwareProfile profile) {
- selectedProfile = profile;
- }
-
public String getProfileId() {
if (selectedProfile == null) {
return null;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/SshPrivateKeysPreferences.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/SshPrivateKeysPreferences.java 2011-02-18 16:42:58 UTC (rev 29245)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/SshPrivateKeysPreferences.java 2011-02-18 16:45:00 UTC (rev 29246)
@@ -16,8 +16,8 @@
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.client.utils.StringUtils;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringPreferenceValue;
-import org.jboss.tools.internal.deltacloud.ui.preferences.StringsPreferenceValue;
+import org.jboss.tools.deltacloud.ui.preferences.StringPreferenceValue;
+import org.jboss.tools.deltacloud.ui.preferences.StringsPreferenceValue;
/**
* @author André Dietisheim
13 years, 10 months
JBoss Tools SVN: r29245 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration: src/org/jboss/tools/deltacloud/integration/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-18 11:42:58 -0500 (Fri, 18 Feb 2011)
New Revision: 29245
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
Log:
[JBIDE-8333] now persisting last selected realm and profile per cloud.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-18 16:42:20 UTC (rev 29244)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-18 16:42:58 UTC (rev 29245)
@@ -1,3 +1,12 @@
+2011-02-18 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
+ (storeSelection):
+ (verifyPageComplete):
+ (getSelectionIndex):
+ (fillRuntimeTypeCombo):
+ [JBIDE-8333] now persisting last selected realm and profile per cloud.
+
2011-02-15 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java (runRSEJob):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-18 16:42:20 UTC (rev 29244)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-18 16:42:58 UTC (rev 29245)
@@ -11,6 +11,7 @@
package org.jboss.tools.deltacloud.integration.wizard;
import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
@@ -38,6 +39,7 @@
import org.jboss.tools.common.jobs.ChainedJob;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.integration.DeltaCloudIntegrationPlugin;
+import org.jboss.tools.deltacloud.ui.preferences.StringPreferenceValue;
import org.jboss.tools.deltacloud.ui.wizard.INewInstanceWizardPage;
import org.jboss.tools.internal.deltacloud.ui.utils.LayoutUtils;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
@@ -45,6 +47,7 @@
/**
* @author Rob Stryker
+ * @author André Dietisheim
*/
public class RSEandASWizardPage extends WizardPage implements INewInstanceWizardPage {
private static final String SERVER_DETAILS_PROPOSAL_KEY = "server_details";
@@ -52,6 +55,9 @@
private static final String SERVER_CONFIG_PROPOSAL_KEY = "server_config";
private static final String SERVER_DEPLOY_PROPOSAL_KEY = "server_deploy";
+ private static final String SELECTED_AUTO_LOCAL_RUNTIME_KEY = "autoruntime_selected";
+ private static final String SELECTED_MANUAL_LOCAL_RUNTIME_KEY = "manualruntime_selected";
+
private static final String SELECT_RUNTIME_ERROR = "Please select a local runtime. The created server will be of the same version as the local runtime.";
private static final String DEPLOY_FOLDER_NOT_EMPTY = "The deploy folder must not be empty";
private final static String REMOTE_DETAILS_LOC_ERROR = "You must fill in a path to fetch the server configuration from";
@@ -73,7 +79,9 @@
private Text remoteDetailsLoc, serverHomeText, serverConfigText, deployFolderText;
private Label serverHome, serverConfig, localRuntimeLabel, autoLocalRuntimeLabel, deployFolder;
private Combo autoLocalRuntimeCombo, localRuntimeCombo;
-
+ private StringPreferenceValue selectedAutoRuntimePref = new StringPreferenceValue(SELECTED_AUTO_LOCAL_RUNTIME_KEY, DeltaCloudIntegrationPlugin.PLUGIN_ID);
+ private StringPreferenceValue selectedManualRuntimePref = new StringPreferenceValue(SELECTED_MANUAL_LOCAL_RUNTIME_KEY, DeltaCloudIntegrationPlugin.PLUGIN_ID);
+
private IHost initialHost;
private ArrayList<IRuntime> localRuntimes = new ArrayList<IRuntime>();
@@ -119,19 +127,16 @@
autoLocalRuntimeLabel = new Label(g, SWT.NONE);
autoLocalRuntimeLabel.setText("Local Runtime: ");
- autoLocalRuntimeLabel.setLayoutData(LayoutUtils.createFormData(remoteDetailsLoc, 7, null, 0, 0, INDENTATION, null,
- 0));
+ autoLocalRuntimeLabel.setLayoutData(
+ LayoutUtils.createFormData(remoteDetailsLoc, 7, null, 0, 0, INDENTATION, null,0));
autoAddLocalRuntimeButton = new Button(g, SWT.DEFAULT);
autoAddLocalRuntimeButton.setText("Configure Runtimes...");
autoAddLocalRuntimeButton.setLayoutData(LayoutUtils.createFormData(remoteDetailsLoc, 7, null, 0, null, 0, 100, -5));
- autoAddLocalRuntimeButton.addSelectionListener(new SelectionListener() {
+ autoAddLocalRuntimeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
configureRuntimesPressed();
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
});
autoLocalRuntimeCombo = new Combo(g, SWT.READ_ONLY);
autoLocalRuntimeCombo.setLayoutData(LayoutUtils.createFormData(remoteDetailsLoc, 5, null, 0, autoLocalRuntimeLabel,
@@ -239,7 +244,7 @@
private void fillRuntimeTypeCombo() {
localRuntimes.clear();
IRuntime[] rts = ServerCore.getRuntimes();
- ArrayList<String> names = new ArrayList<String>();
+ List<String> names = new ArrayList<String>();
for (int i = 0; i < rts.length; i++) {
if (rts[i].getRuntimeType() == null)
continue;
@@ -250,9 +255,20 @@
}
}
localRuntimeCombo.setItems((String[]) names.toArray(new String[names.size()]));
+ localRuntimeCombo.select(getSelectionIndex(selectedManualRuntimePref.get(), names));
autoLocalRuntimeCombo.setItems((String[]) names.toArray(new String[names.size()]));
+ autoLocalRuntimeCombo.select(getSelectionIndex(selectedAutoRuntimePref.get(), names));
}
-
+
+ private int getSelectionIndex(String item, List<String> items) {
+ int selectionIndex = 0;
+ int listIndex = items.indexOf(item);
+ if (listIndex >= 0) {
+ selectionIndex = listIndex;
+ }
+ return selectionIndex;
+ }
+
protected void configureRuntimesPressed() {
ServerUIUtil.showNewRuntimeWizard(addLocalRuntimeButton.getShell(), null, null);
fillRuntimeTypeCombo();
@@ -313,10 +329,22 @@
}
}
}
+ storeSelection(autoLocalRuntimeCombo.getSelectionIndex(), autoLocalRuntimeCombo.getItems(), selectedAutoRuntimePref);
+ storeSelection(localRuntimeCombo.getSelectionIndex(), localRuntimeCombo.getItems(), selectedManualRuntimePref);
+
setErrorMessage(error);
setPageComplete(error == null);
}
+ private void storeSelection(int selectionIndex, String[] items, StringPreferenceValue preferenceValue) {
+ if (selectionIndex < 0 || items == null || items.length == 0) {
+ return;
+ }
+
+ String value = items[selectionIndex];
+ preferenceValue.store(value);
+ }
+
private void refreshServerWidgets() {
if (initialHost != null) {
createRSE.setEnabled(false);
13 years, 10 months