JBoss Tools SVN: r25751 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-12 11:34:12 -0400 (Tue, 12 Oct 2010)
New Revision: 25751
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidatorContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java
Log:
JBIDE-7319
https://jira.jboss.org/browse/JBIDE-7319
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidatorContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidatorContext.java 2010-10-12 15:29:08 UTC (rev 25750)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidatorContext.java 2010-10-12 15:34:12 UTC (rev 25751)
@@ -46,14 +46,18 @@
// save linked ELs.
// don't save links if there are more than 500 ELs for the var name.
if(linkedEls.size()<500) {
- linkedEls.add(el);
+ if(linkedEls.add(el)) {
+ modifications++;
+ }
// Save link between EL and variable names.
Set<String> variableNames = variableNamesByEl.get(el);
if(variableNames==null) {
variableNames = new HashSet<String>();
variableNamesByEl.put(el, variableNames);
}
- variableNames.add(variableName);
+ if(variableNames.add(variableName)) {
+ modifications++;
+ }
}
// Save link between EL and resource.
@@ -62,7 +66,9 @@
els = new HashSet<ELReference>();
elsByResource.put(el.getPath(), els);
}
- els.add(el);
+ if(els.add(el)) {
+ modifications++;
+ }
}
public synchronized void removeLinkedEls(Set<IFile> resorces) {
@@ -74,7 +80,9 @@
public synchronized void removeLinkedEls(IFile resource) {
Set<ELReference> els = elsByResource.get(resource.getFullPath());
if(els!=null) {
- elsByResource.remove(resource.getFullPath());
+ if(elsByResource.remove(resource.getFullPath()) != null) {
+ modifications++;
+ }
for (ELReference el : els) {
Set<String> names = variableNamesByEl.get(el);
if(names!=null) {
@@ -95,7 +103,9 @@
public synchronized void removeLinkedEl(String name, ELReference el) {
Set<ELReference> linkedEls = elsByVariableName.get(name);
if(linkedEls!=null) {
- linkedEls.remove(el);
+ if(linkedEls.remove(el)) {
+ modifications++;
+ }
}
if(linkedEls.isEmpty()) {
elsByVariableName.remove(name);
@@ -104,7 +114,9 @@
// Remove link between EL and variable names.
Set<String> variableNames = variableNamesByEl.get(el);
if(variableNames!=null) {
- variableNames.remove(name);
+ if(variableNames.remove(name)) {
+ modifications++;
+ }
}
if(variableNames.isEmpty()) {
variableNamesByEl.remove(el);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java 2010-10-12 15:29:08 UTC (rev 25750)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/LinkCollection.java 2010-10-12 15:34:12 UTC (rev 25751)
@@ -31,6 +31,8 @@
protected Map<IPath, Set<String>> declaringVariableNamesByResource = new HashMap<IPath, Set<String>>();
protected Set<IPath> unnamedResources = new HashSet<IPath>();
+ protected int modifications = 0;
+
/**
* Save link between resource and variable name.
* It's needed for incremental validation because we must save all linked resources of changed java file.
@@ -51,7 +53,9 @@
resourcesByVariableName.put(variableName, linkedResources);
}
// save linked resources.
- linkedResources.add(linkedResourcePath);
+ if(linkedResources.add(linkedResourcePath)) {
+ modifications++;
+ }
}
// Save link between resource and variable names. It's needed if variable name changes in resource file.
@@ -60,7 +64,9 @@
variableNames = new HashSet<String>();
variableNamesByResource.put(linkedResourcePath, variableNames);
}
- variableNames.add(variableName);
+ if(variableNames.add(variableName)) {
+ modifications++;
+ }
if(declaration) {
synchronized(this) {
@@ -71,7 +77,9 @@
resourcesByDeclaringVariableName.put(variableName, linkedResources);
}
// save linked resources.
- linkedResources.add(linkedResourcePath);
+ if(linkedResources.add(linkedResourcePath)) {
+ modifications++;
+ }
}
// Save link between resource and declaring variable names. It's needed if variable name changes in resource file.
@@ -80,7 +88,9 @@
variableNames = new HashSet<String>();
declaringVariableNamesByResource.put(linkedResourcePath, variableNames);
}
- variableNames.add(variableName);
+ if(variableNames.add(variableName)) {
+ modifications++;
+ }
}
}
@@ -94,7 +104,9 @@
Set<IPath> linkedResources = resourcesByVariableName.get(name);
if(linkedResources!=null) {
// remove linked resource.
- linkedResources.remove(linkedResourcePath);
+ if(linkedResources.remove(linkedResourcePath)) {
+ modifications++;
+ }
}
if(linkedResources.isEmpty()) {
resourcesByVariableName.remove(name);
@@ -103,7 +115,9 @@
// Remove link between resource and declaring variable names.
Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
if(variableNames!=null) {
- variableNames.remove(name);
+ if(variableNames.remove(name)) {
+ modifications++;
+ }
}
if(variableNames.isEmpty()) {
variableNamesByResource.remove(linkedResourcePath);
@@ -112,7 +126,9 @@
Set<IPath> linkedResources = resourcesByDeclaringVariableName.get(name);
if(linkedResources!=null) {
// remove linked resource.
- linkedResources.remove(linkedResourcePath);
+ if(linkedResources.remove(linkedResourcePath)) {
+ modifications++;
+ }
}
if(linkedResources.isEmpty()) {
resourcesByDeclaringVariableName.remove(name);
@@ -121,7 +137,9 @@
// Remove link between resource and declaring variable names.
variableNames = declaringVariableNamesByResource.get(linkedResourcePath);
if(variableNames!=null) {
- variableNames.remove(name);
+ if(variableNames.remove(name)) {
+ modifications++;
+ }
}
if(variableNames.isEmpty()) {
declaringVariableNamesByResource.remove(linkedResourcePath);
@@ -148,28 +166,36 @@
for (String name : resourceNames) {
Set<IPath> linkedResources = resourcesByVariableName.get(name);
if(linkedResources!=null) {
- linkedResources.remove(resource);
+ if(linkedResources.remove(resource)) {
+ modifications++;
+ }
if(linkedResources.isEmpty()) {
resourcesByVariableName.remove(name);
}
}
}
}
- variableNamesByResource.remove(resource);
+ if(variableNamesByResource.remove(resource) != null) {
+ modifications++;
+ }
resourceNames = declaringVariableNamesByResource.get(resource);
if(resourceNames!=null) {
for (String name : resourceNames) {
Set<IPath> linkedResources = resourcesByDeclaringVariableName.get(name);
if(linkedResources!=null) {
- linkedResources.remove(resource);
+ if(linkedResources.remove(resource)) {
+ modifications++;
+ }
if(linkedResources.isEmpty()) {
resourcesByDeclaringVariableName.remove(name);
}
}
}
}
- declaringVariableNamesByResource.remove(resource);
+ if(declaringVariableNamesByResource.remove(resource) != null) {
+ modifications++;
+ }
}
public Set<IPath> getResourcesByVariableName(String variableName, boolean declaration) {
@@ -185,7 +211,9 @@
* @param fullPath
*/
public void addUnnamedResource(IPath fullPath) {
- unnamedResources.add(fullPath);
+ if(unnamedResources.add(fullPath)) {
+ modifications++;
+ }
}
/**
@@ -201,7 +229,9 @@
* @param fullPath
*/
public void removeUnnamedResource(IPath fullPath) {
- unnamedResources.remove(fullPath);
+ if(unnamedResources.remove(fullPath)) {
+ modifications++;
+ }
}
/**
@@ -213,6 +243,7 @@
declaringVariableNamesByResource.clear();
resourcesByDeclaringVariableName.clear();
unnamedResources.clear();
+ modifications = 0;
}
/**
@@ -237,6 +268,7 @@
Element unnamedPathElement = XMLUtilities.createElement(root, "unnamed-path"); //$NON-NLS-1$
unnamedPathElement.setAttribute("path", unnamedPath.toString()); //$NON-NLS-1$
}
+ modifications = 0;
}
private boolean checkDeclaration(IPath resource, String variableName) {
@@ -273,5 +305,10 @@
IPath pathObject = new Path(path);
addUnnamedResource(pathObject);
}
+ modifications = 0;
}
+
+ public int getModificationsSinceLastStore() {
+ return modifications;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java 2010-10-12 15:29:08 UTC (rev 25750)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ProjectValidationContext.java 2010-10-12 15:34:12 UTC (rev 25751)
@@ -39,6 +39,8 @@
private Set<IFile> registeredResources = new HashSet<IFile>();
private Set<String> oldVariableNamesForELValidation = new HashSet<String>();
+ int modifications = 0;
+
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidationContext#addLinkedCoreResource(java.lang.String, org.eclipse.core.runtime.IPath, boolean)
@@ -268,6 +270,7 @@
coreLinks.store(core);
Element el = XMLUtilities.createElement(validation, "el"); //$NON-NLS-1$
elLinks.store(el);
+ modifications = 0;
}
/*
@@ -285,6 +288,7 @@
if(el != null) {
elLinks.load(el);
}
+ modifications = 0;
}
/*
@@ -321,7 +325,10 @@
*/
public void registerFile(IFile file) {
synchronized (registeredResources) {
- registeredResources.add(file);
+ if(!registeredResources.contains(file)) {
+ registeredResources.add(file);
+ modifications++;
+ }
}
}
@@ -340,4 +347,8 @@
public List<IValidator> getValidators() {
return null;
}
+
+ public int getModificationsSinceLastStore() {
+ return modifications + coreLinks.getModificationsSinceLastStore() + elLinks.getModificationsSinceLastStore();
+ }
}
\ No newline at end of file
14 years, 3 months
JBoss Tools SVN: r25750 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-12 11:29:08 -0400 (Tue, 12 Oct 2010)
New Revision: 25750
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
Log:
https://jira.jboss.org/browse/JBIDE-7318 Fixed NPE
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-10-12 14:57:27 UTC (rev 25749)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2010-10-12 15:29:08 UTC (rev 25750)
@@ -147,7 +147,9 @@
List<TextProposal> completions = new ArrayList<TextProposal>();
ELResolutionImpl status = resolveELOperand(file, parseOperand("" + prefix), returnEqualedVariablesOnly, bundles); //$NON-NLS-1$
- completions.addAll(status.getProposals());
+ if(status!=null) {
+ completions.addAll(status.getProposals());
+ }
return completions;
}
14 years, 3 months
JBoss Tools SVN: r25749 - in trunk: jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-12 10:57:27 -0400 (Tue, 12 Oct 2010)
New Revision: 25749
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
https://jira.jboss.org/browse/JBIDE-7318 Fixed NPE
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-12 14:56:11 UTC (rev 25748)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2010-10-12 14:57:27 UTC (rev 25749)
@@ -103,7 +103,9 @@
ELResolutionImpl resolution;
try {
resolution = resolveELOperand(context.getResource(), parseOperand(el), false, vars, new ElVarSearcher(context.getResource(), this));
- completions.addAll(resolution.getProposals());
+ if(resolution!=null) {
+ completions.addAll(resolution.getProposals());
+ }
} catch (StringIndexOutOfBoundsException e) {
log(e);
} catch (BadLocationException e) {
@@ -315,6 +317,9 @@
String prefix = operand.toString();
if(v.getName().startsWith(prefix)) {
ELResolution r = resolveEL(file, v.getElToken(), true, vars, varSearcher);
+ if(r==null) {
+ continue;
+ }
ELSegment lastSegment = r.getLastSegment();
JavaMemberELSegment jmSegment = null;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2010-10-12 14:56:11 UTC (rev 25748)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFImplicitObjectELResolver.java 2010-10-12 14:57:27 UTC (rev 25749)
@@ -104,7 +104,7 @@
for (String var : elVars) {
try {
ELResolution resolution = resolveEL(file, IMPLICT_OBJECTS_ELS.get(var), false);
- if(resolution.isResolved()) {
+ if(resolution!=null && resolution.isResolved()) {
ELSegment segment = resolution.getLastSegment();
if(segment instanceof JavaMemberELSegment) {
TypeInfoCollector.MemberInfo info = ((JavaMemberELSegment)segment).getMemberInfo();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2010-10-12 14:56:11 UTC (rev 25748)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2010-10-12 14:57:27 UTC (rev 25749)
@@ -334,7 +334,7 @@
List<Var> vars = varSearcher.findAllVars(file, expr.getStartPosition());
ELResolution resolution = resolveELOperand(file, expr, true, vars, varSearcher);
- if (resolution.isResolved()) {
+ if (resolution!=null && resolution.isResolved()) {
ELSegment segment = resolution.getLastSegment();
if(segment instanceof JavaMemberELSegment) {
IJavaElement el = ((JavaMemberELSegment)segment).getJavaElement();
14 years, 3 months
JBoss Tools SVN: r25748 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-10-12 10:56:11 -0400 (Tue, 12 Oct 2010)
New Revision: 25748
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6482
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2010-10-12 12:51:02 UTC (rev 25747)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2010-10-12 14:56:11 UTC (rev 25748)
@@ -11,23 +11,25 @@
package org.jboss.tools.seam.core.test.refactoring;
import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
import junit.framework.TestCase;
-import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameJavaProjectProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameSourceFolderProcessor;
import org.eclipse.jdt.internal.corext.refactoring.reorg.IConfirmQuery;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ICreateTargetQueries;
import org.eclipse.jdt.internal.corext.refactoring.reorg.ICreateTargetQuery;
@@ -37,12 +39,15 @@
import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory;
import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgPolicy.IMovePolicy;
import org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating;
-import org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper;
-import org.eclipse.jdt.internal.ui.refactoring.reorg.RenameSelectionState;
-import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper;
import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.ltk.core.refactoring.RefactoringCore;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.participants.MoveArguments;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
import org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor;
import org.eclipse.swt.widgets.Shell;
@@ -51,6 +56,10 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.refactoring.SeamFolderMoveParticipant;
+import org.jboss.tools.seam.internal.core.refactoring.SeamFolderRenameParticipant;
+import org.jboss.tools.seam.internal.core.refactoring.SeamProjectChange;
+import org.jboss.tools.seam.internal.core.refactoring.SeamProjectRenameParticipant;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -81,7 +90,7 @@
static ISeamProject seamWarProject;
static ISeamProject seamEjbProject;
static ISeamProject seamTestProject;
-
+
public SeamPropertyRefactoringTest() {
super("Seam Property Refactoring Tests");
}
@@ -113,124 +122,152 @@
JobUtils.waitForIdle();
return seamProject;
}
-
+
public void testWarProjectRename() throws CoreException {
warProjectName = "NewWarProjectName";
- updateFields();
- warProject = renameProject(warProject, warProjectName);
- seamWarProject = SeamCorePlugin.getSeamProject(warProject, true);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SEAM_PARENT_PROJECT, warProjectName);
+ preferences.put(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "/"+warProjectName+"/src");
+ preferences.put(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "/"+warProjectName+"/webroot/WebContent");
+
+ try{
+ renameProject(warProject, warProjectName, preferences);
+ }finally{
+ warProjectName = "RefactoringTestProject-war";
+ updateFields();
+ }
}
public void testEjbProjectRename() throws CoreException {
ejbProjectName = "NewEjbProjectName";
- updateFields();
- ejbProject = renameProject(ejbProject, ejbProjectName);
- seamEjbProject = SeamCorePlugin.getSeamProject(ejbProject, true);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ejbProjectName);
+ preferences.put(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "/"+ejbProjectName+"/src");
+
+ try{
+ renameProject(ejbProject, ejbProjectName, preferences);
+ }finally{
+ ejbProjectName = "RefactoringTestProject-ejb";
+ updateFields();
+ }
}
public void testTestProjectRename() throws CoreException {
testProjectName = "NewTestProjectName";
- updateFields();
- testProject = renameProject(testProject, testProjectName);
- seamTestProject = SeamCorePlugin.getSeamProject(testProject, true);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, testProjectName);
+ preferences.put(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "/"+testProjectName+"/src");
+
+ try{
+ renameProject(testProject, testProjectName, preferences);
+ }finally{
+ testProjectName = "RefactoringTestProject-test";
+ updateFields();
+ }
}
public void testActionSourceFolderRename() throws CoreException {
actionSourceFolderName = "newActionSrc";
- renameSourceFolder(actionSourceFolderPath, actionSourceFolderName);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "/RefactoringTestProject-ejb/RefactoringTestProject-ejb/"+actionSourceFolderName);
+
+ try{
+ renameSourceFolder(actionSourceFolderPath, actionSourceFolderName, preferences);
+ }finally{
+ actionSourceFolderName = "src";
+ updateFields();
+ }
}
public void testModelSourceFolderRename() throws CoreException {
modelSourceFolderName = "newModelSrc";
- renameSourceFolder(modelSourceFolderPath, modelSourceFolderName);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "/RefactoringTestProject-ejb/RefactoringTestProject-war/"+modelSourceFolderName);
+
+ try{
+ renameSourceFolder(modelSourceFolderPath, modelSourceFolderName, preferences);
+ }finally{
+ modelSourceFolderName = "src";
+ updateFields();
+ }
}
public void testTestSourceFolderRename() throws CoreException {
testSourceFolderName = "newTestSrc";
- renameSourceFolder(testSourceFolderPath, testSourceFolderName);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "/RefactoringTestProject-ejb/RefactoringTestProject-test/"+testSourceFolderName);
+
+ try{
+ renameSourceFolder(testSourceFolderPath, testSourceFolderName, preferences);
+ }finally{
+ testSourceFolderName = "src";
+ updateFields();
+ }
}
public void testViewFolderRename() throws CoreException {
viewFolderName = "newViewFolder";
- renameFolder(viewFolderPath, viewFolderName);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "/RefactoringTestProject-war/webroot/"+viewFolderName);
+
+ try{
+ renameFolder(viewFolderPath, viewFolderName, preferences);
+ }finally{
+ viewFolderName = "WebContent";
+ updateFields();
+ }
}
-// public void testActionPackageRename() throws CoreException {
-// System.out.println("SeamPropertyRefactoringTest testActionPackageRename");
-// String oldName = actionPackageName;
-// actionPackageName = "newejbdemo";
-// renamePackage(actionSourceFolderPath, oldName, actionPackageName);
-// assertCorrectProperties();
-// }
+ public void testActionPackageRename() throws CoreException {
+ String oldName = actionPackageName;
+ actionPackageName = "newejbdemo";
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "/RefactoringTestProject-ejb/"+actionPackageName);
+
+ try{
+ renamePackage(actionSourceFolderPath, oldName, actionPackageName, preferences);
+ }finally{
+ actionPackageName = "ejbdemo";
+ updateFields();
+ }
+ }
-// public void testModelPackageRename() throws CoreException {
-// System.out.println("SeamPropertyRefactoringTest testModelPackageRename");
-// String oldName = modelPackageName;
-// modelPackageName = "newwardemo";
-// renamePackage(modelSourceFolderPath, oldName, modelPackageName);
-// assertCorrectProperties();
-// }
+ public void testModelPackageRename() throws CoreException {
+ String oldName = modelPackageName;
+ modelPackageName = "newwardemo";
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "/RefactoringTestProject-war/"+modelPackageName);
+
+ try{
+ renamePackage(modelSourceFolderPath, oldName, modelPackageName, preferences);
+ }finally{
+ modelPackageName = "wardemo";
+ updateFields();
+ }
+ }
-// public void testTestPackageRename() throws CoreException {
-// System.out.println("SeamPropertyRefactoringTest testTestPackageRename");
-// String oldName = testPackageName;
-// testPackageName = "newtestdemo";
-// renamePackage(testSourceFolderPath, oldName, testPackageName);
-// assertCorrectProperties();
-// }
+ public void testTestPackageRename() throws CoreException {
+ String oldName = testPackageName;
+ testPackageName = "newtestdemo";
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "/RefactoringTestProject-test/"+testPackageName);
+
+ try{
+ renamePackage(testSourceFolderPath, oldName, testPackageName, preferences);
+ }finally{
+ testPackageName = "testdemo";
+ updateFields();
+ }
+ }
public void testViewFolderMove() throws CoreException {
viewFolderParentName = "testwebroot";
- moveFolder(viewFolderPath, "/" + warProjectName + "/" + viewFolderParentName);
- assertCorrectProperties();
+ HashMap<String, String> preferences = new HashMap<String, String>();
+ preferences.put(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "/RefactoringTestProject-war/"+viewFolderParentName+"/WebContent");
+
+ moveFolder(viewFolderPath, "/" + warProjectName + "/" + viewFolderParentName, preferences);
}
- private void assertCorrectProperties() {
- updateFields();
-
- IEclipsePreferences pref = SeamCorePlugin.getSeamPreferences(warProject);
-
- String parentName = seamEjbProject.getParentProjectName();
- assertEquals("Parent seam project property for EJB project was not updated.", warProjectName, parentName);
-
- parentName = seamTestProject.getParentProjectName();
- assertEquals("Parent seam project property for Test project was not updated.", warProjectName, parentName);
-
- String ejbName = pref.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, "");
- assertEquals("EJB project name property was not updated.", ejbProjectName, ejbName);
-
- String testName = pref.get(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, "");
- assertEquals("Test project name property was not updated.", testProjectName, testName);
-
- String actionSources = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, "");
- assertEquals("Action source folder property was not updated.", actionSourceFolderPath, actionSources);
-
- String modelSources = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, "");
- assertEquals("Model source folder property was not.", modelSourceFolderPath, modelSources);
-
- String testSources = pref.get(ISeamFacetDataModelProperties.TEST_SOURCE_FOLDER, "");
- assertEquals("Test source folder property was not updated.", testSourceFolderPath, testSources);
-
- String viewFolder = pref.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, "");
- assertEquals("View folder property was not updated.", viewFolderPath, viewFolder);
-
- String actionPackage = pref.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "");
- assertEquals("Action package name property was not updated.", actionPackageName, actionPackage);
-
- String modelPackage = pref.get(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "");
- assertEquals("Model package name property was not updated.", modelPackageName, modelPackage);
-
- String testPackage = pref.get(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "");
- assertEquals("Test package name property was not updated.", testPackageName, testPackage);
- }
-
private void updateFields() {
actionSourceFolderPath = "/" + ejbProjectName + "/" + actionSourceFolderName;
modelSourceFolderPath = "/" + warProjectName + "/" + modelSourceFolderName;
@@ -238,14 +275,16 @@
viewFolderPath = "/" + warProjectName + "/" + viewFolderParentName + "/" + viewFolderName;
}
- private IPackageFragmentRoot renameSourceFolder(String folderPath, String newFolderName) throws CoreException {
+ private void renameSourceFolder(String folderPath, String newFolderName, HashMap<String, String> preferences) throws CoreException {
IPackageFragmentRoot packageFragmentRoot = getSourceFolder(folderPath);
IProject project = packageFragmentRoot.getResource().getProject();
- performRename(RenameSupport.create(packageFragmentRoot, newFolderName));
String newPath = project.getFullPath().toString() + "/" + newFolderName;
- IPackageFragmentRoot newPackageFragmentRoot = getSourceFolder(newPath);
- assertNotNull("Cannot find renamed source folder: " + newPath, newPackageFragmentRoot);
- return newPackageFragmentRoot;
+
+ JavaRenameProcessor processor= new RenameSourceFolderProcessor(packageFragmentRoot);
+ SeamFolderRenameParticipant participant = new SeamFolderRenameParticipant();
+ IResource folder = ResourcesPlugin.getWorkspace().getRoot().findMember(actionSourceFolderPath);
+
+ checkRename(processor, folder, newPath, participant, preferences);
}
private IPackageFragmentRoot getSourceFolder(String folderPath) {
@@ -269,7 +308,7 @@
return packageFragmentRoot;
}
- private IFolder renameFolder(String folderPath, String newFolderName) throws CoreException {
+ private void renameFolder(String folderPath, String newFolderName, HashMap<String, String> preferences) throws CoreException {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(folderPath);
assertNotNull("Can't find folder: " + folderPath, resource);
@@ -283,33 +322,12 @@
text.setUpdateTextualMatches(true);
}
- // perform
- Object[] elements = processor.getElements();
- RenameSelectionState state = elements.length==1?new RenameSelectionState(elements[0]):null;
- RefactoringExecutionHelper helper= new RefactoringExecutionHelper(refactoring,
- RefactoringCore.getConditionCheckingFailedSeverity(),
- RefactoringSaveHelper.SAVE_ALL,
- WorkbenchUtils.getActiveShell(),
- WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
- try {
- helper.perform(true, true);
- } catch (InterruptedException e) {
- JUnitUtils.fail("Exception during perform folder renaming: " + folderPath, e);
- } catch (InvocationTargetException e) {
- JUnitUtils.fail("Exception during perform folder renaming: " + folderPath, e);
- }
-
- JobUtils.waitForIdle();
-
- IPath path = new Path(folderPath);
- String newFolderPath = path.removeLastSegments(1).append(newFolderName).toString();
- resource = ResourcesPlugin.getWorkspace().getRoot().findMember(newFolderPath);
- assertNotNull("Can't find folder: " + newFolderPath, resource);
-
- return (IFolder)resource;
+ SeamFolderRenameParticipant participant = new SeamFolderRenameParticipant();
+
+ checkRename(processor, resource, newFolderName, participant, preferences);
}
- private IPackageFragment renamePackage(String sourceFolderPath, String oldPackageName, String newPackageName) throws CoreException {
+ private void renamePackage(String sourceFolderPath, String oldPackageName, String newPackageName, HashMap<String, String> preferences) throws CoreException {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(sourceFolderPath);
assertNotNull("Can't find source folder: " + sourceFolderPath, resource);
IProject project = resource.getProject();
@@ -332,12 +350,11 @@
IPackageFragment oldPackage = findPackage(root, oldPackageName);
assertNotNull("Can't find package \"" + oldPackageName + "\". So it's impossible to rename it.", oldPackage);
- IJavaElement[] packages = root.getChildren();
- performRename(RenameSupport.create(oldPackage, newPackageName, RenameSupport.UPDATE_REFERENCES));
-
- IPackageFragment newPackage = findPackage(root, newPackageName);
- assertNotNull("Can't find renamed package \"" + newPackageName + "\". It seems this package was not renamed.", newPackage);
- return null;
+ JavaRenameProcessor processor= new RenamePackageProcessor(oldPackage);
+
+ SeamFolderRenameParticipant participant = new SeamFolderRenameParticipant();
+
+ checkRename(processor, resource, newPackageName, participant, preferences);
}
private IPackageFragment findPackage(IPackageFragmentRoot root, String packageName) {
@@ -354,13 +371,13 @@
}
return null;
}
-
- private IProject renameProject(IProject project, String newProjectName) throws CoreException {
- performRename(RenameSupport.create(JavaCore.create(project), newProjectName, RenameSupport.UPDATE_REFERENCES));
-
- IProject renamedProject = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember(newProjectName);
- assertNotNull("Can't load renamed project " + newProjectName, renamedProject);
- return renamedProject;
+
+ private void renameProject(IProject project, String newProjectName, HashMap<String, String> preferences) throws CoreException {
+ JavaRenameProcessor processor= new RenameJavaProjectProcessor(JavaCore.create(project));
+
+ SeamProjectRenameParticipant participant = new SeamProjectRenameParticipant();
+
+ checkRename(processor, project, newProjectName, participant, preferences);
}
private void performRename(RenameSupport support) throws CoreException {
@@ -376,7 +393,7 @@
JobUtils.waitForIdle();
}
- private IFolder moveFolder(String folderPath, String destinationFolderPath) throws CoreException {
+ private void moveFolder(String folderPath, String destinationFolderPath, HashMap<String, String> preferences) throws CoreException {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(folderPath);
assertNotNull("Can't find folder: " + folderPath, resource);
IResource destination = ResourcesPlugin.getWorkspace().getRoot().findMember(destinationFolderPath);
@@ -409,29 +426,56 @@
return null;
}
});
+
+ SeamFolderMoveParticipant participant = new SeamFolderMoveParticipant();
+
+ checkMove(processor, resource, destination, participant, preferences);
+ }
- // perform
- Object[] elements = processor.getElements();
- RenameSelectionState state = elements.length==1?new RenameSelectionState(elements[0]):null;
- RefactoringExecutionHelper helper= new RefactoringExecutionHelper(refactoring,
- RefactoringCore.getConditionCheckingFailedSeverity(),
- RefactoringSaveHelper.SAVE_ALL,
- WorkbenchUtils.getActiveShell(),
- WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
- try {
- helper.perform(true, true);
- } catch (InterruptedException e) {
- JUnitUtils.fail("Exception during perform folder moving: " + folderPath, e);
- } catch (InvocationTargetException e) {
- JUnitUtils.fail("Exception during perform folder moving: " + folderPath, e);
+ private void checkMove(RefactoringProcessor processor, Object oldObject, Object destinationObject, MoveParticipant participant, HashMap<String, String> preferences) throws CoreException {
+ // Move
+ MoveArguments arguments = new MoveArguments(destinationObject, true);
+ participant.initialize(processor, oldObject, arguments);
+ participant.checkConditions(new NullProgressMonitor(), null);
+
+ CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+
+ for(Change change : rootChange.getChildren()){
+ if(change instanceof SeamProjectChange){
+ SeamProjectChange seamChange = (SeamProjectChange)change;
+ HashMap<String, String> preferencesToCheck = seamChange.getPreferencesForTest();
+
+ checkChanges(preferencesToCheck, preferences);
+ }
}
+ }
- JobUtils.waitForIdle();
+ private void checkRename(RefactoringProcessor processor, Object oldObject, String newName, RenameParticipant participant, HashMap<String, String> preferences) throws CoreException {
+ // Rename
+ RenameArguments arguments = new RenameArguments(newName, true);
+ participant.initialize(processor, oldObject, arguments);
+ participant.checkConditions(new NullProgressMonitor(), null);
+
+ CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+
+ for(Change change : rootChange.getChildren()){
+ if(change instanceof SeamProjectChange){
+ SeamProjectChange seamChange = (SeamProjectChange)change;
+ HashMap<String, String> preferencesToCheck = seamChange.getPreferencesForTest();
+
+ checkChanges(preferencesToCheck, preferences);
+ }
+ }
+ }
+
+ private void checkChanges(HashMap<String, String> preferencesToCheck, HashMap<String, String> preferences){
+ for(String key : preferencesToCheck.keySet()){
+ String value = preferences.get(key);
+ assertNotNull("Unexpected preference "+key+" not found", value);
+
+ String valueToCheck = preferencesToCheck.get(key);
+ assertEquals("Wrong preference value", value, valueToCheck);
+ }
+ }
- String newFolderPath = destination.getFullPath().append(resource.getName()).toString();
- resource = ResourcesPlugin.getWorkspace().getRoot().findMember(newFolderPath);
- assertNotNull("Can't find folder: " + newFolderPath, resource);
-
- return (IFolder)resource;
- }
}
\ No newline at end of file
14 years, 3 months
JBoss Tools SVN: r25746 - 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: 2010-10-12 08:49:02 -0400 (Tue, 12 Oct 2010)
New Revision: 25746
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-7260] changed links. key-pair links does not work. need to find another consistent solution
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-12 12:13:14 UTC (rev 25745)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-12 12:49:02 UTC (rev 25746)
@@ -59,8 +59,8 @@
ConfirmCreate.msg=Launching an instance may result in financial charges. Do you wish to continue?
DontShowThisAgain.msg=Don't show this dialog again
-EC2UserNameLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access ID</a>
-EC2PasswordLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access Secret Key</a>
+EC2UserNameLink.text=For EC2 use the <a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8...">Access ID</a>
+EC2PasswordLink.text=For EC2 use the <a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8...">Access Secret Key</a>
ErrorNameInUse.text=Error: the name chosen is already in use
ErrorMustNameConnection.text=You must name the connection
14 years, 3 months
JBoss Tools SVN: r25745 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-12 08:13:14 -0400 (Tue, 12 Oct 2010)
New Revision: 25745
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties
Log:
[JBIDE-7314] changed name to "Deltacloud" (from "Delta Cloud") in perspective, perferences, category
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch 2010-10-12 12:13:14 UTC (rev 25745)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="true"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Deltacloud Tools"/>
+<booleanAttribute key="default" value="false"/>
+<stringAttribute key="deselected_workspace_plugins" value="org.eclipse.epp.usagedata.recording,org.eclipse.epp.usagedata.gathering,org.mozilla.xulrunner.cocoa.macosx,org.mozilla.xulrunner.gtk.linux.x86_64,org.mozilla.xulrunner.win32.win32.x86,com.jboss.jbds.usage.branding,org.jboss.tools.usage.test,org.mozilla.xulrunner.gtk.linux.x86,org.eclipse.epp.usagedata.ui,org.mozilla.xulrunner.carbon.macosx,org.mozilla.xpcom,org.jboss.tools.tests"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../runtime-New_configuration(1)"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx1024m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<stringAttribute key="selected_target_plugins" value="org.eclipse.ui.console@default:default,org.eclipse.wst.common.frameworks@default:default,org.eclipse.ecf.filetransfer@default:default,org.hamcrest.core@default:default,org.eclipse.help.webapp@default:default,org.eclipse.wst.validation@default:default,org.eclipse.emf.ecore.xmi@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.ecf.ssl@default:false,org.eclipse.equinox.http.jetty@default:default,org.apache.xerces@default:default,org.eclipse.ltk.ui.refactoring@default:default,org.junit*4.8.1.v4_8_1_v20100427-1100@default:default,org.eclipse.equinox.p2.repository@default:default,org.eclipse.compare.core@default:default,com.ibm.icu@default:default,org.eclipse.wst.common.environment@default:default,org.eclipse.wst.sse.core@default:default,org.eclipse.core.databinding@default:default,org.eclipse.help.appserver@default:default,org.eclipse.emf.edit@default:default,org.eclipse.equinox.p2.core@default:defau!
lt,org.eclipse.ecf.provider.filetransfer@default:default,org.eclipse.equinox.jsp.jasper.registry@default:default,org.jboss.tools.common@default:default,org.eclipse.equinox.concurrent@default:default,org.apache.commons.codec*1.3.0.v20100518-1140@default:default,org.eclipse.swtbot.ant.optional.junit4@default:false,org.eclipse.wst.common.project.facet.core@default:default,org.eclipse.wst.common.emfworkbench.integration@default:default,org.eclipse.rse.services@default:default,org.eclipse.ui.ide@default:default,org.eclipse.equinox.app@default:default,org.eclipse.jface.databinding@default:default,org.eclipse.jdt.compiler.apt@default:false,org.eclipse.core.runtime.compatibility@default:default,org.apache.commons.httpclient*3.1.0.v201005080502@default:default,org.apache.commons.el@default:default,org.eclipse.jdt.debug@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.views@default:default,org.apach!
e.xml.serializer@default:default,org.eclipse.rse.core@default:!
default,
org.eclipse.jdt.compiler.tool@default:false,org.eclipse.text@default:default,org.eclipse.equinox.security@default:default,org.eclipse.ui.ide.application@default:default,org.eclipse.core.resources@default:default,org.apache.jasper@default:default,org.eclipse.wst.common.emf@default:default,org.eclipse.ui.forms@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.update.configurator@3:true,org.eclipse.osgi.util@default:default,javax.servlet@default:default,org.eclipse.debug.ui@default:default,org.eclipse.ecf@default:default,org.eclipse.team.core@default:default,org.eclipse.jdt.launching@default:default,org.eclipse.emf.ecore@default:default,com.instantiations.designer.jdt.fragment@default:false,org.eclipse.core.jobs@default:default,org.eclipse.wst.xml.core@default:default,org.eclipse.wst.common.uriresolver@default:default,org.eclipse.jdt.core.manipulation@default:default,org.apache.xml.resolver@default:default,org.eclipse.help@default:default,org.eclipse.jdt.ui!
@default:default,org.eclipse.jem.util@default:default,org.eclipse.ltk.core.refactoring@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,org.eclipse.core.databinding.beans@default:default,org.eclipse.core.filesystem.linux.x86_64@default:false,org.eclipse.core.commands@default:default,javax.servlet.jsp@default:default,org.eclipse.core.expressions@default:default,org.eclipse.emf.common@default:default,org.eclipse.search@default:default,org.eclipse.jface.text@default:default,org.eclipse.team.ui@default:default,org.eclipse.ant.core@default:default,org.eclipse.ui@default:default,org.eclipse.ui.editors@default:default,org.apache.ant@default:default,org.eclipse.equinox.p2.engine@default:default,org.apache.lucene@default:default,org.eclipse.jface@default:default,org.eclipse.swt.gtk.linux.x86_64@default:false,org.eclipse.core.databinding.observable@default:default,org.eclipse.ecf.identity@default:default,org.jbos!
s.tools.xulrunner.initializer@default:false,org.eclipse.emf.ec!
ore.chan
ge@default:default,org.eclipse.compare@default:default,org.eclipse.core.net.linux.x86_64@default:false,org.eclipse.equinox.preferences@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,org.eclipse.osgi@-1:true,org.eclipse.ui.views.properties.tabbed@default:default,org.eclipse.jdt.core@default:default,org.apache.commons.logging*1.0.4.v201005080501@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.help.ui@default:default,org.mortbay.jetty.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.security.ui@default:default,org.eclipse.core.filebuffers@default:default,org.eclipse.core.variables@default:default,org.eclipse.core.contenttype@default:default,org.mortbay.jetty.server@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.ui.workbench.texteditor@default:default,org.eclipse.core.net@default:default,org.eclipse.debug.core@default:default,org.eclipse.equinox.p2.metadata.repo!
sitory@default:default,org.eclipse.ecf.provider.filetransfer.ssl@default:false,org.eclipse.core.runtime@default:true,org.apache.lucene.analysis@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.jsp.jasper@default:default,org.eclipse.ui.navigator.resources@default:default,org.junit4@default:default,javax.xml@default:default,org.eclipse.swtbot.ant.optional.junit3@default:false,org.eclipse.sdk@default:default,org.eclipse.help.base@default:default,org.eclipse.swt@default:default,org.eclipse.wst.common.core@default:default,org.eclipse.ui.navigator@default:default"/>
+<stringAttribute key="selected_workspace_plugins" value="org.jboss.tools.deltacloud.ui@default:default,org.jboss.tools.usage@default:default,org.jboss.tools.deltacloud.docs@default:default,org.jboss.tools.deltacloud.core@default:default"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/Deltacloud Tools.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties 2010-10-12 08:11:35 UTC (rev 25744)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties 2010-10-12 12:13:14 UTC (rev 25745)
@@ -1,9 +1,9 @@
-DeltaCloudCategory=Delta Cloud
+DeltaCloudCategory=Deltacloud
CloudViewerName=Cloud Viewer
InstanceViewer.name=Instances
ImageViewer.name=Images
-DeltaCloudPerspective.name=Delta Cloud
-Preferences.name=Delta Cloud
+DeltaCloudPerspective.name=Deltacloud
+Preferences.name=Deltacloud
Advanced.label=Advanced
NewWizard.name=Cloud Connection
\ No newline at end of file
14 years, 3 months
JBoss Tools SVN: r25744 - 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: 2010-10-12 04:11:35 -0400 (Tue, 12 Oct 2010)
New Revision: 25744
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-7315] added Cloud "Type:" label again
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 2010-10-12 08:03:54 UTC (rev 25743)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-12 08:11:35 UTC (rev 25744)
@@ -63,6 +63,7 @@
private static final String TITLE = "NewCloudConnection.title"; //$NON-NLS-1$
private static final String URL_LABEL = "Url.label"; //$NON-NLS-1$
private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
+ private static final String CLOUDTYPE_LABEL = "Type.label"; //$NON-NLS-1$
private static final String USERNAME_LABEL = "UserName.label"; //$NON-NLS-1$
private static final String PASSWORD_LABEL = "Password.label"; //$NON-NLS-1$
private static final String TESTBUTTON_LABEL = "TestButton.label"; //$NON-NLS-1$
@@ -147,7 +148,10 @@
// cloud type
Label typeLabel = new Label(container, SWT.NULL);
- Binding urlBinding = bindCloudTypeLabel(dbc, urlText, typeLabel);
+ typeLabel.setText(WizardMessages.getString(CLOUDTYPE_LABEL));
+
+ Label computedTypeLabel = new Label(container, SWT.NULL);
+ Binding urlBinding = bindCloudTypeLabel(dbc, urlText, computedTypeLabel);
// username
Label usernameLabel = new Label(container, SWT.NULL);
@@ -228,15 +232,15 @@
f.left = new FormAttachment(urlText, 0, SWT.LEFT);
f.top = new FormAttachment(urlText, 5 + centering);
f.right = new FormAttachment(100, 0);
- typeLabel.setLayoutData(f);
+ computedTypeLabel.setLayoutData(f);
f = new FormData();
f.top = new FormAttachment(typeLabel, 10 + centering);
usernameLabel.setLayoutData(f);
f = new FormData();
- f.left = new FormAttachment(typeLabel, 0, SWT.LEFT);
- f.top = new FormAttachment(typeLabel, 10);
+ f.left = new FormAttachment(computedTypeLabel, 0, SWT.LEFT);
+ f.top = new FormAttachment(computedTypeLabel, 10);
f.right = new FormAttachment(100, -70);
usernameText.setLayoutData(f);
14 years, 3 months
JBoss Tools SVN: r25743 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-12 04:03:54 -0400 (Tue, 12 Oct 2010)
New Revision: 25743
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7307] added "create new connection" action in the context menu and the view menu
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-12 07:56:18 UTC (rev 25742)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-12 08:03:54 UTC (rev 25743)
@@ -30,6 +30,7 @@
CloudSelector.label=Select Cloud:
+NewConnection.label=New Cloud Connection
RemoveCloud.label=Disconnect Cloud
EditCloud.label=Edit Connection
Refresh.label=Refresh Cloud
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-12 07:56:18 UTC (rev 25742)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-12 08:03:54 UTC (rev 25743)
@@ -29,6 +29,7 @@
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
@@ -54,17 +55,18 @@
import org.jboss.tools.internal.deltacloud.ui.wizards.EditCloudConnection;
import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
+import org.jboss.tools.internal.deltacloud.ui.wizards.NewCloudConnection;
import org.jboss.tools.internal.deltacloud.ui.wizards.NewInstance;
+public class DeltaCloudView extends ViewPart implements ICloudManagerListener,
+ ITabbedPropertySheetPageContributor {
-public class DeltaCloudView extends ViewPart implements ICloudManagerListener,
-ITabbedPropertySheetPageContributor {
-
/**
* The ID of the view as specified by the extension.
*/
public static final String ID = "org.jboss.tools.deltacloud.ui.views.DeltaCloudView";
-
+
+ private static final String NEW_CONNECTION = "NewConnection.label"; //$NON-NLS-1$
private static final String REMOVE_CLOUD = "RemoveCloud.label"; //$NON-NLS-1$
private static final String EDIT_CLOUD = "EditCloud.label"; //$NON-NLS-1$
private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
@@ -85,10 +87,12 @@
private final static String DESTROYING_INSTANCE_MSG = "DestroyingInstance.msg"; //$NON-NLS-1$
private final static String IMAGE_FILTER = "ImageFilter.label"; //$NON-NLS-1$
private final static String INSTANCE_FILTER = "InstanceFilter.label"; //$NON-NLS-1$
-
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
+
private TreeViewer viewer;
+
+ private Action createConnection;
private Action removeCloud;
private Action refreshAction;
private Action startAction;
@@ -101,11 +105,12 @@
private Action editCloud;
private Action imageFilterAction;
private Action instanceFilterAction;
-
+
private Map<String, Action> instanceActions;
-
+
private CloudViewElement selectedElement;
+
/**
* The constructor.
*/
@@ -113,8 +118,8 @@
}
/**
- * This is a callback that will allow us
- * to create the viewer and initialize it.
+ * This is a callback that will allow us to create the viewer and initialize
+ * it.
*/
public void createPartControl(Composite parent) {
viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
@@ -139,7 +144,7 @@
DeltaCloudManager.getDefault().removeCloudManagerListener(this);
super.dispose();
}
-
+
private void hookSelection() {
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
@@ -148,7 +153,7 @@
}
});
}
-
+
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
@@ -176,16 +181,17 @@
private void handleSelection() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- selectedElement = (CloudViewElement)selection.getFirstElement();
+ selectedElement = (CloudViewElement) selection.getFirstElement();
editCloud.setEnabled(selectedElement != null);
removeCloud.setEnabled(selectedElement != null);
refreshAction.setEnabled(selectedElement != null);
imageFilterAction.setEnabled(selectedElement != null);
instanceFilterAction.setEnabled(selectedElement != null);
}
-
+
private void fillLocalPullDown(IMenuManager manager) {
manager.removeAll();
+ manager.add(createConnection);
manager.add(editCloud);
manager.add(removeCloud);
manager.add(refreshAction);
@@ -197,14 +203,15 @@
if (selectedElement instanceof CVImageElement) {
manager.add(createInstance);
} else if (selectedElement instanceof CVInstanceElement) {
- CVInstanceElement element = (CVInstanceElement)selectedElement;
- DeltaCloudInstance instance = (DeltaCloudInstance)element.getElement();
+ CVInstanceElement element = (CVInstanceElement) selectedElement;
+ DeltaCloudInstance instance = (DeltaCloudInstance) element.getElement();
List<String> actions = instance.getActions();
for (String action : actions) {
manager.add(instanceActions.get(action));
}
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
+ manager.add(createConnection);
manager.add(editCloud);
manager.add(removeCloud);
manager.add(imageFilterAction);
@@ -212,120 +219,217 @@
// Other plug-ins can contribute there actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
+
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(collapseall);
}
private void makeActions() {
- removeCloud = new RemoveAction();
- removeCloud.setText(CVMessages.getString(REMOVE_CLOUD));
- removeCloud.setToolTipText(CVMessages.getString(REMOVE_CLOUD));
- removeCloud.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));
+ createConnection = createNewConnectionAction();
+ removeCloud = createRemoveAction();
+ createInstance = createInstanceAction();
+ editCloud = createEditCloudAction();
+ refreshAction = createRefreshAction();
+ startAction = createStartAction();
+ stopAction = createStopAction();
+ rebootAction = createRebootAction();
+ destroyAction = createDestroyAction();
- createInstance = new Action() {
+ instanceActions = new HashMap<String, Action>();
+ instanceActions.put(DeltaCloudInstance.START, startAction);
+ instanceActions.put(DeltaCloudInstance.STOP, stopAction);
+ instanceActions.put(DeltaCloudInstance.REBOOT, rebootAction);
+ instanceActions.put(DeltaCloudInstance.DESTROY, destroyAction);
+
+ imageFilterAction = createImageFilterAction();
+ instanceFilterAction = createInstanceFilterAction();
+
+ collapseall = createCollapseAllAction();
+
+ doubleClickAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Shell shell = viewer.getControl().getShell();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof CVImageElement) {
- CVImageElement imageElement = (CVImageElement)obj;
- DeltaCloudImage image = (DeltaCloudImage)imageElement.getElement();
- CVCategoryElement images = (CVCategoryElement)imageElement.getParent();
- CVCloudElement cloudElement = (CVCloudElement)images.getParent();
- DeltaCloud cloud = (DeltaCloud)cloudElement.getElement();
- IWizard wizard = new NewInstance(cloud, image);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
+ @SuppressWarnings("unused")
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ }
+ };
+
+ }
+
+ private Action createNewConnectionAction() {
+ Action createConnection = new Action() {
+ public void run() {
+ NewCloudConnection wizard = new NewCloudConnection();
+ wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
+ WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.open();
+ }
+ };
+ createConnection.setText(CVMessages.getString(NEW_CONNECTION));
+ createConnection.setToolTipText(CVMessages.getString(NEW_CONNECTION));
+ createConnection.setImageDescriptor(SWTImagesFactory.DESC_CLOUD);
+ return createConnection;
+ }
+
+ private Action createCollapseAllAction() {
+ Action collapseAll = new Action() {
+ public void run() {
+ viewer.collapseAll();
+ }
+ };
+ collapseAll.setText(CVMessages.getString(COLLAPSE_ALL));
+ collapseAll.setToolTipText(CVMessages.getString(COLLAPSE_ALL));
+ collapseAll.setImageDescriptor(SWTImagesFactory.DESC_COLLAPSE_ALL);
+ return collapseAll;
+ }
+
+ private Action createInstanceFilterAction() {
+ Action instanceFilterAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ CloudViewElement element = (CloudViewElement) selection.getFirstElement();
+ while (element != null && !(element instanceof CVCloudElement)) {
+ element = (CloudViewElement) element.getParent();
}
+ if (element != null) {
+ CVCloudElement cve = (CVCloudElement) element;
+ final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ Shell shell = viewer.getControl().getShell();
+ IWizard wizard = new InstanceFilter(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+
+ });
+ }
}
- };
- createInstance.setText(CVMessages.getString(CREATE_INSTANCE));
- createInstance.setToolTipText(CVMessages.getString(CREATE_INSTANCE));
- createInstance.setImageDescriptor(SWTImagesFactory.DESC_INSTANCE);
-
- editCloud = new Action() {
+ };
+ instanceFilterAction.setText(CVMessages.getString(INSTANCE_FILTER));
+ instanceFilterAction.setToolTipText(CVMessages.getString(INSTANCE_FILTER));
+ instanceFilterAction.setEnabled(selectedElement != null);
+
+ return instanceFilterAction;
+ }
+
+ private Action createImageFilterAction() {
+ Action imageFilterAction = new Action() {
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- CloudViewElement element = (CloudViewElement)selection.getFirstElement();
+ CloudViewElement element = (CloudViewElement) selection.getFirstElement();
while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement)element.getParent();
+ element = (CloudViewElement) element.getParent();
}
if (element != null) {
- CVCloudElement cloudElement = (CVCloudElement)element;
- DeltaCloud cloud = (DeltaCloud)cloudElement.getElement();
- IWizard wizard = new EditCloudConnection(cloud);
- Shell shell = viewer.getControl().getShell();
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
+ CVCloudElement cve = (CVCloudElement) element;
+ final DeltaCloud cloud = (DeltaCloud) cve.getElement();
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ Shell shell = viewer.getControl().getShell();
+ IWizard wizard = new ImageFilter(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+
+ });
}
}
- };
- editCloud.setText(CVMessages.getString(EDIT_CLOUD));
- editCloud.setToolTipText(CVMessages.getString(EDIT_CLOUD));
-
- refreshAction = new Action() {
+ };
+ imageFilterAction.setText(CVMessages.getString(IMAGE_FILTER));
+ imageFilterAction.setToolTipText(CVMessages.getString(IMAGE_FILTER));
+ imageFilterAction.setEnabled(selectedElement != null);
+ return imageFilterAction;
+ }
+
+ private Action createDestroyAction() {
+ Action destroyAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof CloudViewElement) {
- CloudViewElement element = (CloudViewElement)obj;
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj instanceof CVInstanceElement) {
+ CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
+ CloudViewElement element = (CloudViewElement) obj;
while (!(element instanceof CVCloudElement))
- element = (CloudViewElement)element.getParent();
- CVCloudElement cloud = (CVCloudElement)element;
- cloud.loadChildren();
+ element = (CloudViewElement) element.getParent();
+ CVCloudElement cvcloud = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ PerformDestroyInstanceActionThread t = new PerformDestroyInstanceActionThread(cloud, instance,
+ CVMessages.getString(DESTROYING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[] { instance.getName() }));
+ t.setUser(true);
+ t.schedule();
}
}
};
- refreshAction.setText(CVMessages.getString(REFRESH));
- refreshAction.setToolTipText(CVMessages.getString(REFRESH));
- refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
-
- startAction = new Action() {
+ destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
+ destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
+ ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+ ImageDescriptor delete = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
+ ImageDescriptor delete_disabled = ImageDescriptor.createFromImage(sharedImages
+ .getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
+ destroyAction.setImageDescriptor(delete);
+ destroyAction.setDisabledImageDescriptor(delete_disabled);
+ return destroyAction;
+ }
+
+ private Action createRebootAction() {
+ Action rebootAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof CVInstanceElement) {
- CVInstanceElement cvinstance = (CVInstanceElement)obj;
- DeltaCloudInstance instance = (DeltaCloudInstance)cvinstance.getElement();
- CloudViewElement element = (CloudViewElement)obj;
+ CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
+ CloudViewElement element = (CloudViewElement) obj;
while (!(element instanceof CVCloudElement))
- element = (CloudViewElement)element.getParent();
- CVCloudElement cvcloud = (CVCloudElement)element;
- DeltaCloud cloud = (DeltaCloud)cvcloud.getElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance, DeltaCloudInstance.START,
- CVMessages.getString(STARTING_INSTANCE_TITLE),
- CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[]{instance.getName()}),
+ element = (CloudViewElement) element.getParent();
+ CVCloudElement cvcloud = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
+ DeltaCloudInstance.REBOOT,
+ CVMessages.getString(REBOOTING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[] { instance.getName() }),
DeltaCloudInstance.RUNNING);
t.setUser(true);
t.schedule();
}
}
};
- startAction.setText(CVMessages.getString(START_LABEL));
- startAction.setToolTipText(CVMessages.getString(START_LABEL));
- startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
- startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
-
- stopAction = new Action() {
+ rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
+ rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
+ rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
+ rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
+ return rebootAction;
+ }
+
+ private Action createStopAction() {
+ Action stopAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof CVInstanceElement) {
- CVInstanceElement cvinstance = (CVInstanceElement)obj;
- DeltaCloudInstance instance = (DeltaCloudInstance)cvinstance.getElement();
- CloudViewElement element = (CloudViewElement)obj;
+ CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
+ CloudViewElement element = (CloudViewElement) obj;
while (!(element instanceof CVCloudElement))
- element = (CloudViewElement)element.getParent();
- CVCloudElement cvcloud = (CVCloudElement)element;
- DeltaCloud cloud = (DeltaCloud)cvcloud.getElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance, DeltaCloudInstance.STOP,
- CVMessages.getString(STOPPING_INSTANCE_TITLE),
- CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[]{instance.getName()}),
+ element = (CloudViewElement) element.getParent();
+ CVCloudElement cvcloud = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
+ DeltaCloudInstance.STOP,
+ CVMessages.getString(STOPPING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[] { instance.getName() }),
DeltaCloudInstance.STOPPED);
t.setUser(true);
t.schedule();
@@ -336,146 +440,119 @@
stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
-
- rebootAction = new Action() {
+ return stopAction;
+ }
+
+ private Action createStartAction() {
+ Action startAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof CVInstanceElement) {
- CVInstanceElement cvinstance = (CVInstanceElement)obj;
- DeltaCloudInstance instance = (DeltaCloudInstance)cvinstance.getElement();
- CloudViewElement element = (CloudViewElement)obj;
+ CVInstanceElement cvinstance = (CVInstanceElement) obj;
+ DeltaCloudInstance instance = (DeltaCloudInstance) cvinstance.getElement();
+ CloudViewElement element = (CloudViewElement) obj;
while (!(element instanceof CVCloudElement))
- element = (CloudViewElement)element.getParent();
- CVCloudElement cvcloud = (CVCloudElement)element;
- DeltaCloud cloud = (DeltaCloud)cvcloud.getElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance, DeltaCloudInstance.REBOOT,
- CVMessages.getString(REBOOTING_INSTANCE_TITLE),
- CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[]{instance.getName()}),
+ element = (CloudViewElement) element.getParent();
+ CVCloudElement cvcloud = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ PerformInstanceActionThread t = new PerformInstanceActionThread(cloud, instance,
+ DeltaCloudInstance.START,
+ CVMessages.getString(STARTING_INSTANCE_TITLE),
+ CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] { instance.getName() }),
DeltaCloudInstance.RUNNING);
t.setUser(true);
t.schedule();
}
}
};
- rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
- rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
- rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
- rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
-
- destroyAction = new Action() {
+ startAction.setText(CVMessages.getString(START_LABEL));
+ startAction.setToolTipText(CVMessages.getString(START_LABEL));
+ startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
+ startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
+ return startAction;
+ }
+
+ private Action createRefreshAction() {
+ Action refreshAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof CVInstanceElement) {
- CVInstanceElement cvinstance = (CVInstanceElement)obj;
- DeltaCloudInstance instance = (DeltaCloudInstance)cvinstance.getElement();
- CloudViewElement element = (CloudViewElement)obj;
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj instanceof CloudViewElement) {
+ CloudViewElement element = (CloudViewElement) obj;
while (!(element instanceof CVCloudElement))
- element = (CloudViewElement)element.getParent();
- CVCloudElement cvcloud = (CVCloudElement)element;
- DeltaCloud cloud = (DeltaCloud)cvcloud.getElement();
- PerformDestroyInstanceActionThread t = new PerformDestroyInstanceActionThread(cloud, instance,
- CVMessages.getString(DESTROYING_INSTANCE_TITLE),
- CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[]{instance.getName()}));
- t.setUser(true);
- t.schedule();
+ element = (CloudViewElement) element.getParent();
+ CVCloudElement cloud = (CVCloudElement) element;
+ cloud.loadChildren();
}
}
};
- destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
- destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- ImageDescriptor delete = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
- ImageDescriptor delete_disabled = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
- destroyAction.setImageDescriptor(delete);
- destroyAction.setDisabledImageDescriptor(delete_disabled);
+ refreshAction.setText(CVMessages.getString(REFRESH));
+ refreshAction.setToolTipText(CVMessages.getString(REFRESH));
+ refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+ refreshAction.setEnabled(selectedElement != null);
+ return refreshAction;
+ }
- instanceActions = new HashMap<String, Action>();
- instanceActions.put(DeltaCloudInstance.START, startAction);
- instanceActions.put(DeltaCloudInstance.STOP, stopAction);
- instanceActions.put(DeltaCloudInstance.REBOOT, rebootAction);
- instanceActions.put(DeltaCloudInstance.DESTROY, destroyAction);
-
- imageFilterAction = new Action() {
+ private Action createEditCloudAction() {
+ Action editCloud = new Action() {
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- CloudViewElement element = (CloudViewElement)selection.getFirstElement();
+ CloudViewElement element = (CloudViewElement) selection.getFirstElement();
while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement)element.getParent();
+ element = (CloudViewElement) element.getParent();
}
if (element != null) {
- CVCloudElement cve = (CVCloudElement)element;
- final DeltaCloud cloud = (DeltaCloud)cve.getElement();
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- // TODO Auto-generated method stub
- Shell shell = viewer.getControl().getShell();
- IWizard wizard = new ImageFilter(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
-
- });
+ CVCloudElement cloudElement = (CVCloudElement) element;
+ DeltaCloud cloud = (DeltaCloud) cloudElement.getElement();
+ IWizard wizard = new EditCloudConnection(cloud);
+ Shell shell = viewer.getControl().getShell();
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
}
}
};
- imageFilterAction.setText(CVMessages.getString(IMAGE_FILTER));
- imageFilterAction.setToolTipText(CVMessages.getString(IMAGE_FILTER));
-
- instanceFilterAction = new Action() {
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- CloudViewElement element = (CloudViewElement)selection.getFirstElement();
- while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement)element.getParent();
- }
- if (element != null) {
- CVCloudElement cve = (CVCloudElement)element;
- final DeltaCloud cloud = (DeltaCloud)cve.getElement();
- Display.getDefault().asyncExec(new Runnable() {
+ editCloud.setText(CVMessages.getString(EDIT_CLOUD));
+ editCloud.setToolTipText(CVMessages.getString(EDIT_CLOUD));
+ editCloud.setEnabled(selectedElement != null);
+ return editCloud;
+ }
- @Override
- public void run() {
- // TODO Auto-generated method stub
- Shell shell = viewer.getControl().getShell();
- IWizard wizard = new InstanceFilter(cloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- }
+ private Action createRemoveAction() {
+ Action removeCloud = new RemoveAction();
+ removeCloud.setText(CVMessages.getString(REMOVE_CLOUD));
+ removeCloud.setToolTipText(CVMessages.getString(REMOVE_CLOUD));
+ removeCloud.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));
+ removeCloud.setEnabled(selectedElement != null);
+ return removeCloud;
+ }
- });
- }
- }
- };
- instanceFilterAction.setText(CVMessages.getString(INSTANCE_FILTER));
- instanceFilterAction.setToolTipText(CVMessages.getString(INSTANCE_FILTER));
-
- doubleClickAction = new Action() {
+ private Action createInstanceAction() {
+ Action createInstance = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
- @SuppressWarnings("unused")
- Object obj = ((IStructuredSelection)selection).getFirstElement();
+ Shell shell = viewer.getControl().getShell();
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj instanceof CVImageElement) {
+ CVImageElement imageElement = (CVImageElement) obj;
+ DeltaCloudImage image = (DeltaCloudImage) imageElement.getElement();
+ CVCategoryElement images = (CVCategoryElement) imageElement.getParent();
+ CVCloudElement cloudElement = (CVCloudElement) images.getParent();
+ DeltaCloud cloud = (DeltaCloud) cloudElement.getElement();
+ IWizard wizard = new NewInstance(cloud, image);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
}
};
- collapseall = new Action() {
- public void run() {
- viewer.collapseAll();
- }
- };
- collapseall.setText(CVMessages.getString(COLLAPSE_ALL));
- collapseall.setToolTipText(CVMessages.getString(COLLAPSE_ALL));
- collapseall.setImageDescriptor(SWTImagesFactory.DESC_COLLAPSE_ALL);
-
- editCloud.setEnabled(selectedElement != null);
- removeCloud.setEnabled(selectedElement != null);
- refreshAction.setEnabled(selectedElement != null);
- imageFilterAction.setEnabled(selectedElement != null);
- instanceFilterAction.setEnabled(selectedElement != null);
+ createInstance.setText(CVMessages.getString(CREATE_INSTANCE));
+ createInstance.setToolTipText(CVMessages.getString(CREATE_INSTANCE));
+ createInstance.setImageDescriptor(SWTImagesFactory.DESC_INSTANCE);
+ return createInstance;
}
private void hookDoubleClickAction() {
@@ -500,26 +577,27 @@
@Override
public String getContributorId() {
- return getSite().getId();
+ return getSite().getId();
}
-
- @SuppressWarnings("unchecked")
+
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
- if (adapter == IPropertySheetPage.class)
- // If Tabbed view is desired, then change the
- // following to new TabbedPropertySheetPage(this)
- return new CVPropertySheetPage();
- return super.getAdapter(adapter);
- }
+ if (adapter == IPropertySheetPage.class)
+ // If Tabbed view is desired, then change the
+ // following to new TabbedPropertySheetPage(this)
+ return new CVPropertySheetPage();
+ return super.getAdapter(adapter);
+ }
- /**
- * A JFace action that removes the clouds that are selected in the tree viewer.
- */
- private class RemoveAction extends Action {
+ /**
+ * A JFace action that removes the clouds that are selected in the tree
+ * viewer.
+ */
+ private class RemoveAction extends Action {
public void run() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- for (Iterator<?> iterator = selection.toList().iterator(); iterator.hasNext(); ) {
+ for (Iterator<?> iterator = selection.toList().iterator(); iterator.hasNext();) {
CloudViewElement element = (CloudViewElement) iterator.next();
remove(element);
}
@@ -527,17 +605,17 @@
private void remove(CloudViewElement element) {
while (element != null && !(element instanceof CVCloudElement)) {
- element = (CloudViewElement)element.getParent();
+ element = (CloudViewElement) element.getParent();
}
if (element != null) {
- CVCloudElement cve = (CVCloudElement)element;
+ CVCloudElement cve = (CVCloudElement) element;
Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
- boolean confirmed = MessageDialog.openConfirm(shell,
+ boolean confirmed = MessageDialog.openConfirm(shell,
CVMessages.getString(CONFIRM_CLOUD_DELETE_TITLE),
CVMessages.getFormattedString(CONFIRM_CLOUD_DELETE_MSG, cve.getName()));
if (confirmed) {
- DeltaCloudManager.getDefault().removeCloud((DeltaCloud)element.getElement());
- CloudViewContentProvider p = (CloudViewContentProvider)viewer.getContentProvider();
+ DeltaCloudManager.getDefault().removeCloud((DeltaCloud) element.getElement());
+ CloudViewContentProvider p = (CloudViewContentProvider) viewer.getContentProvider();
Object[] elements = p.getElements(getViewSite());
int index = -1;
for (int i = 0; i < elements.length; ++i) {
@@ -545,7 +623,7 @@
index = i;
}
if (index >= 0)
- ((TreeViewer)cve.getViewer()).remove(getViewSite(), index);
+ ((TreeViewer) cve.getViewer()).remove(getViewSite(), index);
}
}
}
14 years, 3 months
JBoss Tools SVN: r25742 - in trunk: deltacloud/plugins/org.jboss.tools.deltacloud.core and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-10-12 03:56:18 -0400 (Tue, 12 Oct 2010)
New Revision: 25742
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/
trunk/gwt/plugins/org.jboss.tools.gwt.core/
trunk/gwt/plugins/org.jboss.tools.gwt.ui/
trunk/maven/plugins/org.jboss.tools.maven.cdi/
trunk/maven/plugins/org.jboss.tools.maven.hibernate/
trunk/maven/plugins/org.jboss.tools.maven.jsf/
trunk/maven/plugins/org.jboss.tools.maven.portlet/
trunk/maven/tests/org.jboss.tools.maven.ui.bot.test/
Log:
svn ignores
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.bot.test
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core
___________________________________________________________________
Name: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui
___________________________________________________________________
Name: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/gwt/plugins/org.jboss.tools.gwt.core
___________________________________________________________________
Name: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/gwt/plugins/org.jboss.tools.gwt.ui
___________________________________________________________________
Name: svn:ignore
- target
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.cdi
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.hibernate
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.jsf
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/plugins/org.jboss.tools.maven.portlet
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
Property changes on: trunk/maven/tests/org.jboss.tools.maven.ui.bot.test
___________________________________________________________________
Name: svn:ignore
+ target
buildlog.latest.txt
bin
build
14 years, 3 months