JBoss Tools SVN: r27882 - in trunk/hibernatetools/plugins: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2011-01-04 13:13:35 -0500 (Tue, 04 Jan 2011)
New Revision: 27882
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigReadyUseBaseAction.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseConfigAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
https://issues.jboss.org/browse/JBIDE-8027 & https://issues.jboss.org/browse/JBIDE-8030 - fixed
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2011-01-04 18:13:05 UTC (rev 27881)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2011-01-04 18:13:35 UTC (rev 27882)
@@ -67,7 +67,11 @@
}
public Object execute(Command c) {
- return executionContext.execute(c);
+ // to avoid npe, in case when configuration closed from other thread during it's load time
+ if (executionContext != null) {
+ return executionContext.execute(c);
+ }
+ return null;
}
public ConsoleConfigurationPreferences prefs = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseConfigAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseConfigAction.java 2011-01-04 18:13:05 UTC (rev 27881)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseConfigAction.java 2011-01-04 18:13:35 UTC (rev 27882)
@@ -13,7 +13,6 @@
import java.util.Iterator;
import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -23,22 +22,29 @@
/**
* @author Vitali Yemialyanchyk
*/
-public class CloseConfigAction extends SelectionListenerAction {
+public class CloseConfigAction extends ConsoleConfigReadyUseBaseAction {
public static final String CLOSECONFIG_ACTIONID = "actionid.closeconfig"; //$NON-NLS-1$
- private StructuredViewer viewer;
+ /**
+ * @param text
+ */
+ protected CloseConfigAction(String text) {
+ super(text);
+ setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE));
+ setId(CLOSECONFIG_ACTIONID);
+ init(null);
+ }
public CloseConfigAction(StructuredViewer sv) {
super(HibernateConsoleMessages.CloseConfigAction_close_config);
- setEnabled(false);
- this.viewer = sv;
setText(HibernateConsoleMessages.CloseConfigAction_close_config);
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE));
setId(CLOSECONFIG_ACTIONID);
+ init(sv);
}
- public void run() {
+ public void doRun() {
doCloseConfig();
}
@@ -54,21 +60,4 @@
viewer.refresh(node);
}
}
-
- @Override
- public boolean isEnabled() {
- boolean res = false;
- for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
- Object node = i.next();
- if (!(node instanceof ConsoleConfiguration)) {
- continue;
- }
- ConsoleConfiguration config = (ConsoleConfiguration) node;
- if (config.hasConfiguration()) {
- res = true;
- }
- }
- //return res;
- return true;
- }
}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigReadyUseBaseAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigReadyUseBaseAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigReadyUseBaseAction.java 2011-01-04 18:13:35 UTC (rev 27882)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.actions;
+
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.hibernate.SessionFactory;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.ConsoleConfigurationListener;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.console.KnownConfigurationsListener;
+import org.hibernate.console.QueryPage;
+
+/**
+ * @author Vitali Yemialyanchyk
+ */
+public abstract class ConsoleConfigReadyUseBaseAction extends ConsoleConfigurationBasedAction implements ConsoleConfigurationListener, KnownConfigurationsListener {
+
+ protected StructuredViewer viewer;
+
+ private HashSet<ConsoleConfiguration> vecMonitorConsoleConfigs = new HashSet<ConsoleConfiguration>();
+
+ protected ConsoleConfigReadyUseBaseAction(String text) {
+ super(text);
+ }
+
+ public void init(StructuredViewer viewer) {
+ this.viewer = viewer;
+ KnownConfigurations.getInstance().addConsoleConfigurationListener(this);
+ }
+
+ @SuppressWarnings("unchecked")
+ private HashSet<ConsoleConfiguration> cloneMonitorConsoleConfigs() {
+ return (HashSet<ConsoleConfiguration>)vecMonitorConsoleConfigs.clone();
+ }
+
+ @SuppressWarnings("rawtypes")
+ protected void clearCache() {
+ final IStructuredSelection selection = getStructuredSelection();
+ HashSet<ConsoleConfiguration> vecMonitorConsoleConfigsTmp =
+ cloneMonitorConsoleConfigs();
+ for (ConsoleConfiguration consoleConfig : vecMonitorConsoleConfigsTmp) {
+ consoleConfig.removeConsoleConfigurationListener(this);
+ }
+ vecMonitorConsoleConfigsTmp.clear();
+ for (Iterator i = selection.iterator(); i.hasNext(); ) {
+ Object obj = i.next();
+ if (obj instanceof ConsoleConfiguration) {
+ ConsoleConfiguration consoleConfig = (ConsoleConfiguration)obj;
+ vecMonitorConsoleConfigsTmp.add(consoleConfig);
+ consoleConfig.addConsoleConfigurationListener(this);
+ }
+ }
+ vecMonitorConsoleConfigs = vecMonitorConsoleConfigsTmp;
+ super.clearCache();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.hibernate.eclipse.console.actions.SessionFactoryBasedAction#updateState(org.hibernate.console.ConsoleConfiguration)
+ */
+ protected boolean updateState(ConsoleConfiguration ccfg) {
+ return ccfg.hasConfiguration();
+ }
+
+ public void updateEnableState() {
+ selectionChanged(getStructuredSelection());
+ }
+
+ public void queryPageCreated(QueryPage qp) {
+ }
+
+ public void sessionFactoryBuilt(ConsoleConfiguration ccfg, SessionFactory builtSessionFactory) {
+ }
+
+ public void sessionFactoryClosing(ConsoleConfiguration ccfg, SessionFactory aboutToCloseFactory) {
+ }
+
+ public void configurationBuilt(ConsoleConfiguration ccfg) {
+ updateEnableState();
+ }
+
+ public void configurationReset(ConsoleConfiguration ccfg) {
+ updateEnableState();
+ }
+
+ public void configurationAdded(ConsoleConfiguration root) {
+ }
+
+ public void configurationRemoved(ConsoleConfiguration ccfg, boolean forUpdate) {
+ if (vecMonitorConsoleConfigs.remove(ccfg)) {
+ ccfg.removeConsoleConfigurationListener(this);
+ }
+ }
+}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2011-01-04 18:13:05 UTC (rev 27881)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2011-01-04 18:13:35 UTC (rev 27882)
@@ -21,58 +21,46 @@
*/
package org.hibernate.eclipse.console.views;
-import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Shell;
import org.hibernate.HibernateException;
-import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.ConsoleConfigurationListener;
-import org.hibernate.console.KnownConfigurations;
-import org.hibernate.console.KnownConfigurationsListener;
-import org.hibernate.console.QueryPage;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction;
+import org.hibernate.eclipse.console.actions.ConsoleConfigReadyUseBaseAction;
import org.hibernate.tool.hbm2ddl.SchemaExport;
/**
* @author max
*
*/
-public class SchemaExportAction extends ConsoleConfigurationBasedAction implements ConsoleConfigurationListener, KnownConfigurationsListener {
+public class SchemaExportAction extends ConsoleConfigReadyUseBaseAction {
public static final String SCHEMAEXPORT_ACTIONID = "actionid.schemaexport"; //$NON-NLS-1$
- private StructuredViewer viewer;
-
- private HashSet<ConsoleConfiguration> vecMonitorConsoleConfigs = new HashSet<ConsoleConfiguration>();
-
/**
* @param text
*/
protected SchemaExportAction(String text) {
- super( text );
+ super(text);
setId(SCHEMAEXPORT_ACTIONID);
- KnownConfigurations.getInstance().addConsoleConfigurationListener(this);
+ init(null);
}
/**
* @param selectionProvider
*/
public SchemaExportAction(StructuredViewer selectionProvider) {
- super( HibernateConsoleMessages.SchemaExportAction_run_schemaexport );
- this.viewer = selectionProvider;
+ super(HibernateConsoleMessages.SchemaExportAction_run_schemaexport);
setId(SCHEMAEXPORT_ACTIONID);
- KnownConfigurations.getInstance().addConsoleConfigurationListener(this);
+ init(selectionProvider);
}
/**
@@ -141,69 +129,4 @@
}
}
}
-
- @SuppressWarnings("unchecked")
- private HashSet<ConsoleConfiguration> cloneMonitorConsoleConfigs() {
- return (HashSet<ConsoleConfiguration>)vecMonitorConsoleConfigs.clone();
- }
-
- @SuppressWarnings("rawtypes")
- protected void clearCache() {
- final IStructuredSelection selection = getStructuredSelection();
- HashSet<ConsoleConfiguration> vecMonitorConsoleConfigsTmp =
- cloneMonitorConsoleConfigs();
- for (ConsoleConfiguration consoleConfig : vecMonitorConsoleConfigsTmp) {
- consoleConfig.removeConsoleConfigurationListener(this);
- }
- vecMonitorConsoleConfigsTmp.clear();
- for (Iterator i = selection.iterator(); i.hasNext(); ) {
- Object obj = i.next();
- if (obj instanceof ConsoleConfiguration) {
- ConsoleConfiguration consoleConfig = (ConsoleConfiguration)obj;
- vecMonitorConsoleConfigsTmp.add(consoleConfig);
- consoleConfig.addConsoleConfigurationListener(this);
- }
- }
- vecMonitorConsoleConfigs = vecMonitorConsoleConfigsTmp;
- super.clearCache();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.hibernate.eclipse.console.actions.SessionFactoryBasedAction#updateState(org.hibernate.console.ConsoleConfiguration)
- */
- protected boolean updateState(ConsoleConfiguration ccfg) {
- return ccfg.hasConfiguration();
- }
-
- public void updateEnableState() {
- selectionChanged(getStructuredSelection());
- }
-
- public void queryPageCreated(QueryPage qp) {
- }
-
- public void sessionFactoryBuilt(ConsoleConfiguration ccfg, SessionFactory builtSessionFactory) {
- }
-
- public void sessionFactoryClosing(ConsoleConfiguration ccfg, SessionFactory aboutToCloseFactory) {
- }
-
- public void configurationBuilt(ConsoleConfiguration ccfg) {
- updateEnableState();
- }
-
- public void configurationReset(ConsoleConfiguration ccfg) {
- updateEnableState();
- }
-
- public void configurationAdded(ConsoleConfiguration root) {
- }
-
- public void configurationRemoved(ConsoleConfiguration ccfg, boolean forUpdate) {
- if (vecMonitorConsoleConfigs.remove(ccfg)) {
- ccfg.removeConsoleConfigurationListener(this);
- }
- }
}
13 years, 4 months
JBoss Tools SVN: r27881 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-01-04 13:13:05 -0500 (Tue, 04 Jan 2011)
New Revision: 27881
Modified:
trunk/build/aggregate/site/site.xml
Log:
include both org.mozilla.xulrunner.feature and org.jboss.tools.xulrunner.feature as uncategorized (optional but available) features
Modified: trunk/build/aggregate/site/site.xml
===================================================================
--- trunk/build/aggregate/site/site.xml 2011-01-04 18:06:04 UTC (rev 27880)
+++ trunk/build/aggregate/site/site.xml 2011-01-04 18:13:05 UTC (rev 27881)
@@ -130,11 +130,6 @@
<category name="CloudTools" />
</feature>
- <feature url="features/org.jboss.tools.xulrunner.feature_0.0.0.jar" id="org.jboss.tools.xulrunner.feature" version="0.0.0">
- <category name="AllTools" />
- <category name="WebTools" />
- </feature>
-
<!-- jBPM Tools & Flow features -->
<feature url="features/org.jboss.tools.jbpm.convert.feature_0.0.0.jar" id="org.jboss.tools.jbpm.convert.feature" version="0.0.0">
<category name="AllTools" />
@@ -162,6 +157,12 @@
<category name="AllTools" />
</feature>
+ <!-- include but leave uncategorized -->
+ <feature url="features/org.mozilla.xulrunner.feature_0.0.0.jar" id="org.mozilla.xulrunner.feature" version="0.0.0">
+ </feature>
+ <feature url="features/org.jboss.tools.xulrunner.feature_0.0.0.jar" id="org.jboss.tools.xulrunner.feature" version="0.0.0">
+ </feature>
+
<!-- categories - see also ../../../common/aggregateRepos.*.properties -->
<category-def name="SDKTools" label="JBoss Tools SDK">
<description>JBoss Tools SDK contains plugins where an SDK package
13 years, 4 months
JBoss Tools SVN: r27880 - in trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core: runtime and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-01-04 13:06:04 -0500 (Tue, 04 Jan 2011)
New Revision: 27880
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/RuntimeKey.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
Log:
JBIDE-7860 JBIDE-7934 cache classpath for each runtime but listen for runtime changes
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java 2011-01-04 17:58:59 UTC (rev 27879)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ClasspathCorePlugin.java 2011-01-04 18:06:04 UTC (rev 27880)
@@ -10,10 +10,20 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.classpath.core;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.osgi.framework.BundleContext;
/**
@@ -27,6 +37,32 @@
// The shared instance
private static ClasspathCorePlugin plugin;
+ private static Map<RuntimeKey, IClasspathEntry[]> runtimeClasspaths;
+
+ private IRuntimeLifecycleListener listener = new IRuntimeLifecycleListener() {
+
+ public void runtimeRemoved(IRuntime runtime) {
+ removeRuntimeClasspath(runtime);
+ }
+
+ public void runtimeChanged(IRuntime runtime) {
+ removeRuntimeClasspath(runtime);
+ }
+
+ public void runtimeAdded(IRuntime runtime) {
+
+ }
+
+ private void removeRuntimeClasspath(IRuntime runtime) {
+ if (runtime == null) {
+ return;
+ }
+ RuntimeKey key = getRuntimeKey(runtime);
+ if (key != null) {
+ runtimeClasspaths.remove(key);
+ }
+ }
+ };
/**
* The constructor
*/
@@ -40,6 +76,8 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ runtimeClasspaths = new HashMap<RuntimeKey, IClasspathEntry[]>();
+ ServerCore.addRuntimeLifecycleListener(listener);
}
/*
@@ -49,6 +87,8 @@
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
+ runtimeClasspaths = null;
+ ServerCore.removeRuntimeLifecycleListener(listener);
}
/**
@@ -65,4 +105,23 @@
IStatus status = new Status(Status.ERROR,ClasspathCorePlugin.PLUGIN_ID,msg,e);
log.log(status);
}
+
+ public static Map<RuntimeKey, IClasspathEntry[]> getRuntimeClasspaths() {
+ return runtimeClasspaths;
+ }
+
+ public static RuntimeKey getRuntimeKey(IRuntime runtime) {
+ if( runtime == null )
+ return null;
+
+ IJBossServerRuntime jbsrt = (IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ if( jbsrt == null ) {
+ return null;
+ }
+
+ IPath loc = runtime.getLocation();
+ IPath configPath = jbsrt.getConfigurationFullPath();
+ String rtID = runtime.getRuntimeType().getId();
+ return new RuntimeKey(loc, configPath, rtID);
+ }
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/RuntimeKey.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/RuntimeKey.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/RuntimeKey.java 2011-01-04 18:06:04 UTC (rev 27880)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.classpath.core;
+
+import org.eclipse.core.runtime.IPath;
+
+public class RuntimeKey {
+ private IPath location;
+ private IPath configPath;
+ private String id;
+
+ public RuntimeKey(IPath location, IPath configPath, String id) {
+ this.location = location;
+ this.configPath = configPath;
+ this.id = id;
+ }
+
+ public IPath getLocation() {
+ return location;
+ }
+
+ public void setLocation(IPath location) {
+ this.location = location;
+ }
+
+ public IPath getConfigPath() {
+ return configPath;
+ }
+
+ public void setConfigPath(IPath configPath) {
+ this.configPath = configPath;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((configPath == null) ? 0 : configPath.hashCode());
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result
+ + ((location == null) ? 0 : location.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RuntimeKey other = (RuntimeKey) obj;
+ if (configPath == null) {
+ if (other.configPath != null)
+ return false;
+ } else if (!configPath.equals(other.configPath))
+ return false;
+ if (id == null) {
+ if (other.id != null)
+ return false;
+ } else if (!id.equals(other.id))
+ return false;
+ if (location == null) {
+ if (other.location != null)
+ return false;
+ } else if (!location.equals(other.location))
+ return false;
+ return true;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2011-01-04 17:58:59 UTC (rev 27879)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2011-01-04 18:06:04 UTC (rev 27880)
@@ -16,22 +16,24 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.internal.core.ClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.classpath.core.ClasspathConstants;
import org.jboss.ide.eclipse.as.classpath.core.ClasspathCorePlugin;
import org.jboss.ide.eclipse.as.classpath.core.Messages;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.classpath.core.RuntimeKey;
/**
* This class uses the "throw everything you can find" strategy
@@ -49,10 +51,55 @@
// TODO Auto-generated constructor stub
}
+ public static class Entry {
+ private IPath path;
+ private String name;
+ private long length;
+
+ public Entry(IPath path, String name, long length) {
+ super();
+ this.path = path;
+ this.name = name;
+ this.length = length;
+ }
+
+ public IPath getPath() {
+ return path;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (int) (length ^ (length >>> 32));
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Entry other = (Entry) obj;
+ if (length != other.length)
+ return false;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+ }
+
public static class ClientAllFilter {
public static boolean accepts(IPath path) {
if( !path.lastSegment().endsWith(EXT_JAR)) return false;
- if( path.lastSegment().toLowerCase().endsWith("jaxb-xjc.jar")) return false;
+ if( path.lastSegment().toLowerCase().endsWith("jaxb-xjc.jar")) return false; //$NON-NLS-1$
return true;
}
}
@@ -61,19 +108,22 @@
if( runtime == null )
return new IClasspathEntry[0];
- IJBossServerRuntime jbsrt = (IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
- if( jbsrt == null ) {
+ RuntimeKey key = ClasspathCorePlugin.getRuntimeKey(runtime);
+ if( key == null ) {
// log error
IStatus status = new Status(IStatus.WARNING, ClasspathCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.ClientAllRuntimeClasspathProvider_wrong_runtime_type,
runtime.getName()));
ClasspathCorePlugin.getDefault().getLog().log(status);
return new IClasspathEntry[0];
}
-
- IPath loc = runtime.getLocation();
- IPath configPath = jbsrt.getConfigurationFullPath();
- String rtID = runtime.getRuntimeType().getId();
- List<IPath> list = new ArrayList<IPath>();
+ IClasspathEntry[] runtimeClasspath = ClasspathCorePlugin.getRuntimeClasspaths().get(key);
+ if (runtimeClasspath != null) {
+ return runtimeClasspath;
+ }
+ IPath loc = key.getLocation();
+ IPath configPath = key.getConfigPath();
+ String rtID = key.getId();
+ Set<Entry> list = new HashSet<Entry>();
if(AS_32.equals(rtID)) list = get32(loc, configPath);
if(AS_40.equals(rtID)) list = get40(loc,configPath);
if(AS_42.equals(rtID)) list = get42(loc,configPath);
@@ -85,31 +135,35 @@
if(AS_60.equals(rtID)) list = get60(loc,configPath);
if(EAP_50.equals(rtID)) list = get50(loc,configPath);
- if( list == null )
- return null;
- List<IClasspathEntry> entries = convert(list);
- return entries.toArray(new IClasspathEntry[entries.size()]);
+ if( list == null ) {
+ runtimeClasspath = new IClasspathEntry[0];
+ } else {
+ List<IClasspathEntry> entries = convert(list);
+ runtimeClasspath = entries.toArray(new IClasspathEntry[entries.size()]);
+ }
+ ClasspathCorePlugin.getRuntimeClasspaths().put(key, runtimeClasspath);
+ return runtimeClasspath;
}
- protected List<IClasspathEntry> convert(List<IPath> list) {
- ArrayList<IClasspathEntry> fin = new ArrayList<IClasspathEntry>();
- Iterator<IPath> i = list.iterator();
+ protected List<IClasspathEntry> convert(Set<Entry> list) {
+ List<IClasspathEntry> fin = new ArrayList<IClasspathEntry>();
+ Iterator<Entry> i = list.iterator();
while(i.hasNext()) {
fin.add(getEntry(i.next()));
}
return fin;
}
- protected List<IPath> get32(IPath location, IPath configPath) {
- ArrayList<IPath> list = new ArrayList<IPath>();
+ protected Set<Entry> get32(IPath location, IPath configPath) {
+ Set<Entry> list = new HashSet<Entry>();
addPaths(location.append(LIB), list);
addPaths(configPath.append(LIB), list);
addPaths(location.append(CLIENT), list);
return list;
}
- protected List<IPath> get40(IPath location, IPath configPath) {
- ArrayList<IPath> list = new ArrayList<IPath>();
+ protected Set<Entry> get40(IPath location, IPath configPath) {
+ Set<Entry> list = new HashSet<Entry>();
addPaths(location.append(LIB), list);
addPaths(configPath.append(LIB), list);
IPath deployPath = configPath.append(DEPLOY);
@@ -120,16 +174,16 @@
return list;
}
- protected List<IPath> get42(IPath location, IPath configPath) {
+ protected Set<Entry> get42(IPath location, IPath configPath) {
return get40(location, configPath);
}
- protected List<IPath> getEAP43(IPath location, IPath configPath) {
+ protected Set<Entry> getEAP43(IPath location, IPath configPath) {
return get40(location, configPath);
}
- protected List<IPath> get50(IPath location, IPath configPath) {
- ArrayList<IPath> list = new ArrayList<IPath>();
+ protected Set<Entry> get50(IPath location, IPath configPath) {
+ Set<Entry> list = new HashSet<Entry>();
addPaths(location.append(COMMON).append(LIB), list);
addPaths(location.append(LIB), list);
addPaths(configPath.append(LIB), list);
@@ -145,19 +199,19 @@
return list;
}
- protected List<IPath> get60(IPath location, IPath configPath) {
- ArrayList<IPath> list = new ArrayList<IPath>();
+ protected Set<Entry> get60(IPath location, IPath configPath) {
+ Set<Entry> list = new HashSet<Entry>();
list.addAll(get50(location, configPath));
addPaths(configPath.append(DEPLOYERS).append(REST_EASY_DEPLOYER), list);
addPaths(configPath.append(DEPLOYERS).append(JSF_DEPLOYER).append(MOJARRA_20).append(JSF_LIB), list);
return list;
}
- protected IClasspathEntry getEntry(IPath path) {
- return JavaRuntime.newArchiveRuntimeClasspathEntry(path).getClasspathEntry();
+ protected IClasspathEntry getEntry(Entry entry) {
+ return JavaRuntime.newArchiveRuntimeClasspathEntry(entry.getPath()).getClasspathEntry();
}
- protected void addPaths(IPath folder, ArrayList<IPath> list) {
+ protected void addPaths(IPath folder, Set<Entry> list) {
if( folder.toFile().exists()) {
File f = folder.toFile();
if(f.isDirectory()) {
@@ -173,18 +227,12 @@
}
}
- protected void addSinglePath(IPath p, ArrayList<IPath> list) {
- Iterator<IPath> i = list.iterator();
- IPath l;
- while(i.hasNext()) {
- l = i.next();
- if( !p.toFile().exists() ||
- (p.lastSegment().equals(l.lastSegment())
- && p.toFile().length() == l.toFile().length() )) {
- return;
- }
+ protected void addSinglePath(IPath p, Set<Entry> list) {
+ if (!p.toFile().exists()) {
+ return;
}
- list.add(p);
+ list.add(new Entry(p, p.lastSegment(), p.toFile().length()));
+
}
}
13 years, 4 months
JBoss Tools SVN: r27879 - trunk/as/plugins/org.jboss.ide.eclipse.as.ssh.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-01-04 12:58:59 -0500 (Tue, 04 Jan 2011)
New Revision: 27879
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
Log:
JBIDE-7412 - commenting out all ssh extension points
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2011-01-04 17:58:21 UTC (rev 27878)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2011-01-04 17:58:59 UTC (rev 27879)
@@ -2,101 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.wst.server.core.serverTypes">
- <serverType
- behaviourClass="org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate"
- class="org.jboss.ide.eclipse.as.ssh.server.SSHServerDelegate"
- description="%ssh.server.description"
- id="org.jboss.ide.eclipse.as.ssh.server.remoteServerType"
- name="%ssh.server.name"
- runtime="false"
- runtimeTypeId="org.jboss.ide.eclipse.as.ssh.server.remoteServerRuntimeType"
- supportsRemoteHosts="true">
- </serverType>
- </extension>
-
-
- <!-- This runtime type is here just to get around some weird UI checking.
- It *can* be removed later SAFELY without breaking anything. The server
- wizard will *not* create the runtime, but just check that the type is set.
- ... So broken ;) -->
-
- <extension
- point="org.eclipse.wst.server.core.runtimeTypes">
- <runtimeType
- vendor="%basic.vendor"
- class="org.jboss.ide.eclipse.as.ssh.server.SSHServerRuntime"
- description="%ssh.runtime.description"
- name="%ssh.runtime.name"
- id="org.jboss.ide.eclipse.as.ssh.server.remoteServerRuntimeType"
- version="1.0">
- <moduleType
- types="jst.web"
- versions="2.2, 2.3, 2.4, 2.5"/>
- <moduleType
- types="jst.ejb"
- versions="1.0, 1.1, 2.0, 2.1, 3.0"/>
- <moduleType
- types="jst.ear"
- versions="1.2, 1.3, 1.4, 5.0"/>
- <moduleType
- types="jst.connector"
- versions="1.0, 1.5"/>
- <moduleType
- types="jst.utility"
- versions="1.0"/>
- <moduleType
- types="jboss.package"
- versions="1.0"/>
- <moduleType
- types="jboss.singlefile"
- versions="1.0"/>
- <moduleType
- types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,5.0">
- </moduleType>
- <moduleType
- types="jbt.bpel.module"
- versions="1.1, 2.0">
- </moduleType>
- </runtimeType>
- </extension>
- <extension
- point="org.jboss.ide.eclipse.as.core.publishers">
- <publisher
- class="org.jboss.ide.eclipse.as.ssh.server.SSHZippedJSTPublisher"
- priority="3"
- zipDelegate="true">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.as.ssh.server.SSHJstPublisher"
- priority="3"
- zipDelegate="false">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.as.ssh.server.SSHSingleFilePublisher"
- priority="3"
- zipDelegate="false">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.as.ssh.server.SSHPackagesPublisher"
- priority="3"
- zipDelegate="false">
- </publisher>
- </extension>
-
-
- <!-- Some UI -->
- <extension
- point="org.eclipse.wst.server.ui.editorPages">
- <page
- class="org.jboss.ide.eclipse.as.ssh.ui.editor.DeploymentPage"
- id="org.jboss.ide.eclipse.as.ssh.ui.editor.DeploymentPage"
- name="Deployment"
- typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType">
- </page>
- </extension>
- <extension
point="org.eclipse.wst.server.ui.serverImages">
<image
icon="icons/ssh-16x16.png"
@@ -104,30 +9,4 @@
typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType,org.jboss.ide.eclipse.as.ssh.server.remoteServerRuntimeType">
</image>
</extension>
- <extension
- point="org.eclipse.wst.server.ui.wizardFragments">
- <fragment
- class="org.jboss.ide.eclipse.as.ssh.ui.wizard.SCPServerWizardFragment"
- id="org.jboss.ide.eclipse.as.ssh.server.remoteServerWizardFragment"
- typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType">
- </fragment>
- </extension>
- <extension
- point="org.jboss.ide.eclipse.as.core.publishMethod">
- <publishMethod
- class="org.jboss.ide.eclipse.as.ssh.server.SSHServerBehaviourDelegate$SSHPublishMethod"
- id="ssh"
- name="SSH Remote Deployment"
- serverTypes="org.jboss.ide.eclipse.as.ssh.server.remoteServerType">
- </publishMethod>
- </extension>
- <extension
- point="org.eclipse.wst.server.ui.editorPageSections">
- <section
- class="org.jboss.ide.eclipse.as.ssh.ui.editor.ServerPasswordSection"
- id="org.jboss.ide.eclipse.as.ui.editor.passwordSection"
- insertionId="org.eclipse.wst.server.editor.overview.left"
- order="10"
- typeIds="org.jboss.ide.eclipse.as.ssh.server.remoteServerType"/>
- </extension>
</plugin>
13 years, 4 months
JBoss Tools SVN: r27878 - in trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test: editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-01-04 12:58:21 -0500 (Tue, 04 Jan 2011)
New Revision: 27878
Added:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
Log:
Added TextSelectionTest
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-01-04 17:38:09 UTC (rev 27877)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllBotTests.java 2011-01-04 17:58:21 UTC (rev 27878)
@@ -10,6 +10,7 @@
import org.jboss.tools.vpe.ui.bot.test.editor.MinMaxPanesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.StylesOnThePageTest;
import org.jboss.tools.vpe.ui.bot.test.editor.TextEditingActionsTest;
+import org.jboss.tools.vpe.ui.bot.test.editor.TextSelectionTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
import org.jboss.tools.vpe.ui.bot.test.editor.JspFileEditingTest;
@@ -94,7 +95,7 @@
suite.addTestSuite(GlobalELVariablesTest.class);
suite.addTestSuite(IncludedCssFilesJSPTest.class);
suite.addTestSuite(StylesOnThePageTest.class);
-
+ suite.addTestSuite(TextSelectionTest.class);
return new TestSetup(suite);
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java 2011-01-04 17:58:21 UTC (rev 27878)
@@ -0,0 +1,181 @@
+/*******************************************************************************
+
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import java.awt.event.KeyEvent;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.KeyboardHelper;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotEditorExt;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.vpe.ui.bot.test.tools.SWTBotWebBrowser;
+/**
+ * Tests JSP file Editing and Cut, Copy, Paste actions through Visual Editor Menu for Text selection
+ * @author vlado pakan
+ *
+ */
+public class TextSelectionTest extends VPEEditorTestCase {
+
+ private SWTBotExt botExt = null;
+
+ private static final String TEXT_TO_SELECT = "select";
+ private static final String TEXT_TO_TEST = "Text " + TextSelectionTest.TEXT_TO_SELECT +" test";
+ private static final int SELECTION_START_LINE = 8;
+ private static final int SELECTION_START_COLUMN = 32;
+
+ private static final String PAGE_TEXT = "<%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\"%>\n" +
+ "<%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\"%>\n" +
+ "<html>\n" +
+ " <head>\n" +
+ " <title>Input User Name Page</title>\n" +
+ " </head>\n" +
+ " <body>\n" +
+ " <f:view>\n" +
+ " <h:outputText value=\"" + TextSelectionTest.TEXT_TO_TEST + "\"/>\n" +
+ " </f:view>\n" +
+ " </body>\n" +
+ "</html>";
+
+ private static final String TEST_PAGE_NAME = "TextSelectionTest.jsp";
+
+ private SWTBotEditorExt jspEditor;
+ private SWTBotWebBrowser webBrowser;
+
+ public TextSelectionTest() {
+ super();
+ botExt = new SWTBotExt();
+ }
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ eclipse.maximizeActiveShell();
+ createJspPage(TextSelectionTest.TEST_PAGE_NAME);
+ jspEditor = botExt.swtBotEditorExtByTitle(TextSelectionTest.TEST_PAGE_NAME);
+ webBrowser = new SWTBotWebBrowser(TextSelectionTest.TEST_PAGE_NAME,botExt);
+ }
+ /**
+ * Tests Text Selection
+ */
+ public void ttestTextSelection(){
+
+ jspEditor.setText(TextSelectionTest.PAGE_TEXT);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ // select text in Source Pane
+ jspEditor.selectRange(TextSelectionTest.SELECTION_START_LINE, TextSelectionTest.SELECTION_START_COLUMN, TextSelectionTest.TEXT_TO_SELECT.length());
+ webBrowser.setFocus();
+ bot.sleep(Timing.time3S());
+ String selectedText = webBrowser.getSelectionText();
+ // check selected text in Visual Pane
+ assertTrue("Selected text in Visual Pane has to be '" + TextSelectionTest.TEXT_TO_SELECT + "'" +
+ "\nBut is '" + selectedText+ "'",
+ TextSelectionTest.TEXT_TO_SELECT.equals(selectedText));
+ String newText = "newText";
+ // Type text replacing selected text in Visual Pane and check Source Pane content
+ KeyboardHelper.typeBasicStringUsingAWT(newText);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ assertSourceEditorContains(jspEditor.getText(), " " + newText + " ", TextSelectionTest.TEST_PAGE_NAME);
+ jspEditor.setText(TextSelectionTest.PAGE_TEXT);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ // select text in Visual Page
+ jspEditor.deselectAndSetCursorPosition(TextSelectionTest.SELECTION_START_LINE, TextSelectionTest.SELECTION_START_COLUMN);
+ webBrowser.setFocus();
+ bot.sleep(Timing.time1S());
+ KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT, 5);
+ KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT, TextSelectionTest.TEXT_TO_SELECT.length(),KeyEvent.VK_SHIFT);
+ bot.sleep(Timing.time1S());
+ // check selected text in Source Pane
+ selectedText = jspEditor.getSelection();
+ assertTrue("Selected text in Source Pane has to be '" + TextSelectionTest.TEXT_TO_SELECT + "'" +
+ "\nBut is '" + selectedText+ "'",
+ TextSelectionTest.TEXT_TO_SELECT.equals(selectedText));
+ jspEditor.setFocus();
+ // type text replacing selected text in Source Pane and check Visual Pane content
+ KeyboardHelper.typeBasicStringUsingAWT(newText);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ assertVisualEditorContainsNodeWithValue(webBrowser,
+ TextSelectionTest.TEXT_TO_TEST.replaceFirst(TextSelectionTest.TEXT_TO_SELECT, newText),
+ TextSelectionTest.TEST_PAGE_NAME);
+ // check if selection made on Source tab appears on Visual/Source tab Visual Pane
+ jspEditor.setText(TextSelectionTest.PAGE_TEXT);
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ SWTBotEditorExt botEditorExt = new SWTBotExt().swtBotEditorExtByTitle(TextSelectionTest.TEST_PAGE_NAME);
+ botEditorExt.selectPage(IDELabel.VisualPageEditor.SOURCE_TAB_LABEL);
+ jspEditor.selectRange(TextSelectionTest.SELECTION_START_LINE, TextSelectionTest.SELECTION_START_COLUMN, TextSelectionTest.TEXT_TO_SELECT.length());
+ botEditorExt.selectPage(IDELabel.VisualPageEditor.VISUAL_SOURCE_TAB_LABEL);
+ webBrowser.setFocus();
+ bot.sleep(Timing.time3S());
+ selectedText = webBrowser.getSelectionText();
+ // check selected text in Visual Pane
+ assertTrue("Selected text in Visual Pane has to be '" + TextSelectionTest.TEXT_TO_SELECT + "'" +
+ "\nBut is '" + selectedText+ "'",
+ TextSelectionTest.TEXT_TO_SELECT.equals(selectedText));
+ }
+
+ /**
+ * Tests Text Selection of Special Symbols
+ */
+ public void testTextSelectionOfSpecialSymbols(){
+
+ jspEditor.setText("©2007 Exposure. All Rights Reserved." +
+ "•" +
+ "Design by <a href=\"http://www.freecsstemplates.org/\">Free CSS Templates</a>" +
+ "•" +
+ "Icons by <a href=\"http://famfamfam.com/\">FAMFAMFAM</a>.");
+ jspEditor.save();
+ bot.sleep(Timing.time3S());
+ assertVisualEditorContainsNodeWithValue(webBrowser,
+ "©2007 Exposure. All Rights Reserved.•Design by ",
+ TextSelectionTest.TEST_PAGE_NAME);
+ assertVisualEditorContainsNodeWithValue(webBrowser,
+ "•Icons by ",
+ TextSelectionTest.TEST_PAGE_NAME);
+ jspEditor.deselectAndSetCursorPosition(0, 0);
+ webBrowser.setFocus();
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_RIGHT,KeyEvent.VK_SHIFT);
+ String selectedText = jspEditor.getSelection();
+ String copySymbol = "©";
+ assertTrue("Selected text in Source Pane has to be '" + copySymbol + "'" +
+ "\nBut is '" + selectedText+ "'",
+ copySymbol.equals(selectedText));
+ jspEditor.deselectAndSetCursorPosition(0, 0);
+ webBrowser.setFocus();
+ KeyboardHelper.typeKeyCodeUsingAWTRepeately(KeyEvent.VK_RIGHT, 36);
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_RIGHT,KeyEvent.VK_SHIFT);
+ selectedText = jspEditor.getSelection();
+ String bullSymbol = "•";
+ assertTrue("Selected text in Source Pane has to be '" + bullSymbol + "'" +
+ "\nBut is '" + selectedText+ "'",
+ bullSymbol.equals(selectedText));
+
+ }
+
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+ @Override
+ protected void tearDown() throws Exception {
+ jspEditor.close();
+ super.tearDown();
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/TextSelectionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2011-01-04 17:38:09 UTC (rev 27877)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2011-01-04 17:58:21 UTC (rev 27878)
@@ -61,6 +61,7 @@
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsIDOMWindow;
import org.mozilla.interfaces.nsIEditor;
import org.mozilla.interfaces.nsISelection;
@@ -748,5 +749,38 @@
}
return result;
}
+ /**
+ * Returns selected text in first selection range.
+ * Works correctly only when single node is selected.
+ * @return
+ */
+ public String getSelectionText (){
+ String result = null;
+
+ nsISelection selection = getSelection();
+ if (selection != null && selection.getRangeCount() > 0){
+ nsIDOMRange firstSelectedRange = selection.getRangeAt(0);
+ nsIDOMNode selectedNode = getSelectedDomNode();
+ if (selectedNode.getNodeName().equals("#text")){
+ int startOffset = firstSelectedRange.getStartOffset();
+ int endOffset = firstSelectedRange.getEndOffset();
+ int beginIndex, endIndex;
+ if (startOffset > endOffset){
+ beginIndex = endOffset;
+ endIndex = startOffset;
+ }
+ else{
+ beginIndex = startOffset;
+ endIndex = endOffset;
+ }
+ result = selectedNode
+ .getNodeValue()
+ .substring(beginIndex, endIndex);
+ }
+ }
+
+ return result;
+
+ }
}
13 years, 4 months
JBoss Tools SVN: r27877 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-04 12:38:09 -0500 (Tue, 04 Jan 2011)
New Revision: 27877
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java
Log:
[JBIDE-7294] added name parameter to request again
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java 2011-01-04 17:14:35 UTC (rev 27876)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java 2011-01-04 17:38:09 UTC (rev 27877)
@@ -33,11 +33,17 @@
public static String getLabel(DeltaCloudInstance instance) {
StringBuilder sb = new StringBuilder();
if (instance != null) {
- if (instance.getAlias() != null) {
- sb.append(instance.getAlias()).append(' ');
+ String alias = instance.getAlias();
+ if (alias != null) {
+ sb.append(alias).append(' ');
}
- if (instance.getName() != null) {
- sb.append('[').append(instance.getName()).append(']');
+ String name = instance.getName();
+ if (name != null) {
+ if (alias == null) {
+ sb.append(name);
+ } else if (!alias.equals(name)) {
+ sb.append('[').append(name).append(']');
+ }
}
if (instance.getId() != null) {
sb.append('[').append(instance.getId()).append(']');
13 years, 4 months
JBoss Tools SVN: r27876 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-04 12:14:35 -0500 (Tue, 04 Jan 2011)
New Revision: 27876
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
Log:
cleanup
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-04 17:06:56 UTC (rev 27875)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-04 17:14:35 UTC (rev 27876)
@@ -114,8 +114,9 @@
false, null, null);
int retCode = dialog.getReturnCode();
boolean toggleState = dialog.getToggleState();
- if (retCode == Dialog.CANCEL)
+ if (retCode == Dialog.CANCEL) {
return true;
+ }
// If warning turned off by user, set the preference for future
// usage
if (toggleState) {
13 years, 4 months
JBoss Tools SVN: r27875 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-04 12:06:56 -0500 (Tue, 04 Jan 2011)
New Revision: 27875
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudElementCategoryItem.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImagesCategoryItem.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.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/NewInstanceWizard.java
Log:
[JBIDE-7294] added name parameter to request again
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -563,19 +563,19 @@
}
}
- public DeltaCloudInstance createInstance(String alias, String imageId, String realmId, String profileId,
+ public DeltaCloudInstance createInstance(String name, String imageId, String realmId, String profileId,
String keyId, String memory, String storage) throws DeltaCloudException {
try {
Instance instance = null;
if (keyId != null) {
- instance = client.createInstance(imageId, profileId, realmId, keyId, memory, storage);
+ instance = client.createInstance(name, imageId, profileId, realmId, keyId, memory, storage);
} else {
- instance = client.createInstance(imageId, profileId, realmId, memory, storage);
+ instance = client.createInstance(name, imageId, profileId, realmId, memory, storage);
}
if (instance != null) {
DeltaCloudInstancesRepository repo = getInstancesRepository();
DeltaCloudInstance[] instances = repo.get();
- DeltaCloudInstance deltaCloudInstance = DeltaCloudInstanceFactory.create(instance, this, alias);
+ DeltaCloudInstance deltaCloudInstance = DeltaCloudInstanceFactory.create(instance, this, name);
repo.add(deltaCloudInstance);
// TODO: remove notification with all instanceRepo, replace by
// notifying the changed instance
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -115,10 +115,10 @@
* @return
* @throws DeltaCloudClientException
*/
- public Instance createInstance(String imageId, String profileId, String realmId, String memory, String storage)
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String memory, String storage)
throws DeltaCloudClientException;
- public Instance createInstance(String imageId, String profileId, String realmId, String keyname, String memory,
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String keyname, String memory,
String storage) throws DeltaCloudClientException;
/**
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -291,16 +291,16 @@
}
- public Instance createInstance(String imageId, String profileId, String realmId, String memory,
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String memory,
String storage) throws DeltaCloudClientException {
- return createInstance(imageId, profileId, realmId, null, memory, storage);
+ return createInstance(name, imageId, profileId, realmId, null, memory, storage);
}
- public Instance createInstance(String imageId, String profileId, String realmId, String keyId,
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String keyId,
String memory, String storage) throws DeltaCloudClientException {
try {
String response = requestStringResponse(
- new CreateInstanceRequest(baseUrl, imageId, profileId, realmId, keyId, memory, storage));
+ new CreateInstanceRequest(baseUrl, name, imageId, profileId, realmId, keyId, memory, storage));
Instance instance = buildInstance(response);
// TODO: WORKAROUND for
// https://issues.jboss.org/browse/JBIDE-8005
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -22,6 +22,7 @@
*/
public class CreateInstanceRequest extends AbstractDeltaCloudRequest {
+ private String name;
private String imageId;
private String profileId;
private String realmId;
@@ -30,12 +31,13 @@
private String storage;
public CreateInstanceRequest(URL baseUrl, String imageId) {
- this(baseUrl, imageId, null, null, null, null, null);
+ this(baseUrl, imageId, null, null, null, null, null, null);
}
- public CreateInstanceRequest(URL baseUrl, String imageId, String profileId, String realmId,
+ public CreateInstanceRequest(URL baseUrl, String name, String imageId, String profileId, String realmId,
String keyId, String memory, String storage) {
super(baseUrl, HttpMethod.POST);
+ this.name = name;
this.imageId = imageId;
this.profileId = profileId;
this.realmId = realmId;
@@ -51,6 +53,7 @@
// WORKAROUND for JBIDE-8005, STEAM-303
.parameter("key_name", keyname)
// WORKAROUND for JBIDE-8005, STEAM-303
+ .parameter("name", name)
.parameter("image_id", imageId)
.parameter("hwp_id", profileId)
.parameter("realm_id", realmId)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudElementCategoryItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudElementCategoryItem.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/CloudElementCategoryItem.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -38,7 +38,6 @@
public Object[] getChildren() {
if (!initialized.get()) {
asyncAddCloudElements();
- initialized.set(true);
}
return super.getChildren();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImagesCategoryItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImagesCategoryItem.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/ImagesCategoryItem.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -54,6 +54,7 @@
DeltaCloudImage[] images = getCloud().getImages();
clearChildren();
addChildren(images);
+ initialized.set(true);
expand();
return Status.OK_STATUS;
} catch(DeltaCloudException e) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -55,6 +55,7 @@
DeltaCloudInstance[] instances = getCloud().getInstances();
clearChildren();
addChildren(instances);
+ initialized.set(true);
expand();
return Status.OK_STATUS;
} catch (DeltaCloudException e) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/DeltaCloudObjectLabelUtils.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -45,20 +45,4 @@
}
return sb.toString();
}
-
- public static String getId(String imageLabel) {
- if (imageLabel == null) {
- return null;
- }
- int idStart = imageLabel.indexOf('[');
- if (idStart == -1) {
- return imageLabel;
- }
- int idStop = imageLabel.indexOf(']');
- if (idStop == -1) {
- return imageLabel.substring(idStart + 1);
- }
- return imageLabel.substring(idStart + 1, idStop);
- }
-
}
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-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -230,7 +230,7 @@
private void bindWidgets(DataBindingContext dbc, Composite container) {
// name
- bindText(nameText, NewInstancePageModel.PROPERTY_ALIAS, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
+ bindText(nameText, NewInstancePageModel.PROPERTY_NAME, WizardMessages.getString(MUST_ENTER_A_NAME), dbc);
IObservableValue imageObservable = bindImage(imageText, dbc);
bindArchLabel(arch, imageObservable, dbc);
bindRealmCombo(realmCombo, dbc);
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-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePageModel.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -26,7 +26,7 @@
public class NewInstancePageModel extends ObservableUIPojo {
public static final String PROPERTY_URL = "url"; //$NON-NLS-1$
- public static final String PROPERTY_ALIAS = "alias"; //$NON-NLS-1$
+ public static final String PROPERTY_NAME = "name"; //$NON-NLS-1$
public static final String PROPERTY_IMAGE = "image"; //$NON-NLS-1$
public static final String PROPERTY_ARCH = "arch"; //$NON-NLS-1$
public static final String PROPERTY_REALMS = "realms"; //$NON-NLS-1$
@@ -37,7 +37,7 @@
public static final String PROP_FILTERED_PROFILES = "filteredProfiles"; //$NON-NLS-1$
public static final String PROP_SELECTED_PROFILE_INDEX = "selectedProfileIndex"; //$NON-NLS-1$
- private String alias;
+ private String name;
private DeltaCloudImage image;
private String arch;
private String keyId;
@@ -55,12 +55,12 @@
this.image = image;
}
- public String getAlias() {
- return alias;
+ public String getName() {
+ return name;
}
- public void setAlias(String alias) {
- firePropertyChange(PROPERTY_ALIAS, this.alias, this.alias = alias);
+ public void setName(String name) {
+ firePropertyChange(PROPERTY_NAME, this.name, this.name = name);
}
public DeltaCloudImage getImage() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-04 16:26:56 UTC (rev 27874)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceWizard.java 2011-01-04 17:06:56 UTC (rev 27875)
@@ -91,7 +91,7 @@
String memory = model.getMemory();
String storage = model.getStorage();
String keyId = model.getKeyId();
- String alias = utf8Encode(model.getAlias());
+ String name = utf8Encode(model.getName());
// Save persistent settings for this particular cloud
cloud.setLastImageId(imageId);
@@ -122,7 +122,7 @@
prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, true);
}
}
- instance = cloud.createInstance(alias, imageId, realmId, profileId, keyId, memory, storage);
+ instance = cloud.createInstance(name, imageId, realmId, profileId, keyId, memory, storage);
if (instance != null) {
result = true;
}
@@ -153,7 +153,7 @@
ErrorUtils.handleError(
WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG,
- new String[] { alias, imageId, realmId, profileId }),
+ new String[] { name, imageId, realmId, profileId }),
e, getShell());
}
return result;
13 years, 4 months
JBoss Tools SVN: r27874 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-01-04 11:26:56 -0500 (Tue, 04 Jan 2011)
New Revision: 27874
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
Log:
cleanup
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2011-01-04 16:19:50 UTC (rev 27873)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2011-01-04 16:26:56 UTC (rev 27874)
@@ -53,10 +53,9 @@
private void loadClouds() throws DeltaCloudException {
this.clouds = new ArrayList<DeltaCloud>(); // clear present clouds
DeltaCloudMultiException connectionException = new DeltaCloudMultiException("Could not load some clouds");
- IPath stateLocation = Activator.getDefault().getStateLocation();
- File cloudFile = stateLocation.append(CLOUDFILE_NAME).toFile();
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
try {
+ File cloudFile = getOrCreateCloudFile();
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
if (cloudFile.exists()) {
Document d = db.parse(cloudFile);
13 years, 4 months
JBoss Tools SVN: r27873 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-01-04 11:19:50 -0500 (Tue, 04 Jan 2011)
New Revision: 27873
Modified:
trunk/build/target-platform/publish.sh
Log:
include .blobstore in zipped update site too
Modified: trunk/build/target-platform/publish.sh
===================================================================
--- trunk/build/target-platform/publish.sh 2011-01-04 16:17:51 UTC (rev 27872)
+++ trunk/build/target-platform/publish.sh 2011-01-04 16:19:50 UTC (rev 27873)
@@ -52,7 +52,7 @@
targetZip=/tmp/${targetFile}.zip
# create zip, then upload to http://download.jboss.org/jbossotools/updates/target-platform/${targetFil... for public use
- zip -q -r9 ${targetZip} *
+ zip -q -r9 ${targetZip} ${include}
du -sh ${targetZip}
# generate MD5 sum for zip (file contains only the hash, not the hash + filename)
13 years, 4 months