JBoss Tools SVN: r22602 - branches/3.2.helios/seam/tests/org.jboss.tools.seam.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-06-07 10:34:31 -0400 (Mon, 07 Jun 2010)
New Revision: 22602
Modified:
branches/3.2.helios/seam/tests/org.jboss.tools.seam.ui.bot.test/pom.xml
Log:
match pom to manifest version
Modified: branches/3.2.helios/seam/tests/org.jboss.tools.seam.ui.bot.test/pom.xml
===================================================================
--- branches/3.2.helios/seam/tests/org.jboss.tools.seam.ui.bot.test/pom.xml 2010-06-07 14:32:35 UTC (rev 22601)
+++ branches/3.2.helios/seam/tests/org.jboss.tools.seam.ui.bot.test/pom.xml 2010-06-07 14:34:31 UTC (rev 22602)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.seam.ui.bot.test</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
</project>
14 years, 7 months
JBoss Tools SVN: r22601 - branches/3.2.helios/seam/features/org.jboss.tools.seam.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-06-07 10:32:35 -0400 (Mon, 07 Jun 2010)
New Revision: 22601
Modified:
branches/3.2.helios/seam/features/org.jboss.tools.seam.feature/pom.xml
Log:
match pom to feature.xml version
Modified: branches/3.2.helios/seam/features/org.jboss.tools.seam.feature/pom.xml
===================================================================
--- branches/3.2.helios/seam/features/org.jboss.tools.seam.feature/pom.xml 2010-06-07 14:11:32 UTC (rev 22600)
+++ branches/3.2.helios/seam/features/org.jboss.tools.seam.feature/pom.xml 2010-06-07 14:32:35 UTC (rev 22601)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.seam.feature</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>3.1.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
14 years, 7 months
JBoss Tools SVN: r22600 - in trunk/jsf: plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-06-07 10:11:32 -0400 (Mon, 07 Jun 2010)
New Revision: 22600
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameDescriptor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameProcessor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameRefactoringWizard.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/IRenameDescriptor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameAction.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameRefactoring.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceStarter.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredChanges.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredTextFileChange.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/view/StructuredChangesPreviewViewer.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AttributeRenameTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2MoveParticipantTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2RenameParticipantTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6276 - preview for JSF 2 refactoring was created. SWTBot tests were added.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -15,37 +15,25 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jdt.internal.core.JarEntryFile;
-import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.html.core.internal.encoding.HTMLModelLoader;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.text.JobSafeStructuredDocument;
-import org.eclipse.wst.validation.ValidationFramework;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.eclipse.wst.xml.core.internal.parser.XMLSourceParser;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.format.DocumentNodeFormatter;
import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.util.JSF2ComponentUtil;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -95,172 +83,6 @@
return file;
}
- public void renameCompositeComponents(IResource resource, String URI,
- String oldName, String newName) throws CoreException {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- renameCompositeComponentsInFile(file, URI, oldName, newName);
- } else if (resource instanceof IProject) {
- IResource[] children = ((IProject) resource).members();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- renameCompositeComponents(children[i], URI, oldName,
- newName);
- }
- }
- } else if (resource instanceof IFolder) {
- IResource[] children = ((IFolder) resource).members();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- renameCompositeComponents(children[i], URI, oldName,
- newName);
- }
- }
- }
- }
-
- private boolean isFileCorrect(IFile file) {
- if (file == null) {
- return false;
- }
- if (!"xhtml".equals(file.getFileExtension()) && !"jsp".equals(file.getFileExtension())) { //$NON-NLS-1$ //$NON-NLS-2$
- IContentType contentType = IDE.getContentType(file);
- if (contentType == null) {
- return false;
- }
- String id = contentType.getId();
- if (!"org.eclipse.jst.jsp.core.jspsource".equals(id) && !"org.eclipse.wst.html.core.htmlsource".equals(id)) { //$NON-NLS-1$ //$NON-NLS-2$
- return false;
- }
- }
- return true;
- }
-
- private void renameCompositeComponentsInFile(final IFile file,
- final String URI, final String oldName, final String newName) {
- if (!isFileCorrect(file)) {
- return;
- }
- updateFileContent(new EditableDOMFile() {
-
- @Override
- public IFile getFile() {
- return file;
- }
-
- @Override
- protected void edit(IDOMModel model) throws CoreException,
- IOException {
- IDOMDocument document = model.getDocument();
- Map<String, List<Element>> compositeComponentsMap = JSF2ComponentUtil
- .findCompositeComponents(document);
- List<Element> compositeComponents = compositeComponentsMap
- .get(URI);
- if (compositeComponents != null) {
- for (Element element : compositeComponents) {
- if (oldName.equals(element.getLocalName())) {
- renameElement((IDOMElement) element, oldName,
- newName);
- }
- }
- model.save();
- ValidationFramework.getDefault().validate(file,
- new NullProgressMonitor());
- }
- }
- });
- }
-
- public void renameURIs(IResource resource, Map<String, String> urisMap)
- throws CoreException {
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- renameURIsInFile(file, urisMap);
- } else if (resource instanceof IProject) {
- IResource[] children = ((IProject) resource).members();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- renameURIs(children[i], urisMap);
- }
- }
- } else if (resource instanceof IFolder) {
- IResource[] children = ((IFolder) resource).members();
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- renameURIs(children[i], urisMap);
- }
- }
- }
- }
-
- private void renameURIsInFile(final IFile file,
- final Map<String, String> urisMap) {
- if (!isFileCorrect(file)) {
- return;
- }
- updateFileContent(new EditableDOMFile() {
-
- @Override
- public IFile getFile() {
- return file;
- }
-
- @Override
- protected void edit(IDOMModel model) throws CoreException,
- IOException {
- IDOMDocument document = model.getDocument();
- IDOMAttr[] uriAttrs = JSF2ComponentUtil
- .findURIContainers(document);
- for (int i = 0; i < uriAttrs.length; i++) {
- if (urisMap.containsKey(uriAttrs[i].getValue())) {
- renameURIAttr(uriAttrs[i], urisMap.get(uriAttrs[i]
- .getValue()));
- }
- }
- model.save();
- ValidationFramework.getDefault().validate(file,
- new NullProgressMonitor());
- }
-
- });
- }
-
- private void renameURIAttr(IDOMAttr idomAttr, final String replaceValue) {
- int startOffset = idomAttr.getStartOffset();
- String attrValue = idomAttr.getValue();
- IStructuredDocument document = idomAttr.getStructuredDocument();
- String value = document.getText().substring(idomAttr.getStartOffset());
- value = value.substring(0, value.indexOf(attrValue)
- + idomAttr.getValue().length());
- try {
- document.replace(startOffset + value.indexOf(attrValue), attrValue
- .length(), replaceValue);
- } catch (BadLocationException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
- idomAttr.getName();
- }
-
- private void renameElement(final IDOMElement element, final String oldName,
- final String newName) {
- String sourceString = element.getSource();
- IStructuredDocument structuredDocument = element
- .getStructuredDocument();
- int startOffset = element.getStartOffset();
- int endStartOffset = element.getEndStartOffset();
- int endOffset = element.getEndOffset();
- try {
- if (endOffset != endStartOffset) {
- structuredDocument.replace(sourceString.lastIndexOf(oldName)
- + startOffset, oldName.length(), newName);
- }
- structuredDocument.replace(element.getStartOffset()
- + sourceString.indexOf(oldName), oldName.length(), newName);
- } catch (BadLocationException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
- }
-
private void updateJSF2CompositeComponent(IDOMDocument componentDoc,
String[] attrNames) {
IDOMElement[] interfaceElement = new IDOMElement[1];
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSF2RenameParticipant.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -23,7 +23,7 @@
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.ui.ide.IDE;
-import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
+import org.jboss.tools.jsf.jsf2.refactoring.core.StructuredChanges;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
@@ -54,12 +54,13 @@
}
oldFileName = oldFileName.substring(0, oldFileName.lastIndexOf('.'));
newFileName = newFileName.substring(0, newFileName.lastIndexOf('.'));
- JSF2ComponentModelManager.getManager().renameCompositeComponents(
- project, URI, oldFileName, newFileName);
+ StructuredChanges changes = RefactoringChangesFactory
+ .createRenameCompositeComponentsChanges(project, URI,
+ oldFileName, newFileName);
project = null;
URI = null;
oldFileName = null;
- return null;
+ return changes;
}
@Override
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/JSf2MoveParticipant.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -27,7 +27,6 @@
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
@@ -52,7 +51,7 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
if (project != null) {
- JSF2ComponentModelManager.getManager().renameURIs(project, urisMap);
+ return RefactoringChangesFactory.createRenameURIChanges(project, urisMap);
}
return null;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionFactory.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionFactory.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring;
import org.eclipse.core.resources.IFile;
@@ -12,6 +23,12 @@
import org.jboss.tools.jsf.jsf2.refactoring.action.rename.IRenameDescriptor;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
public class RefactoringActionFactory {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionManager.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringActionManager.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring;
import java.util.HashSet;
@@ -12,10 +23,17 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.jsf2.refactoring.action.rename.IRenameDescriptor;
import org.jboss.tools.jsf.jsf2.refactoring.action.rename.RenameUserInterfaceManager;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
public class RefactoringActionManager {
@@ -68,7 +86,8 @@
starter.activate(descriptor.getRenameRefactoring(), parent,
RefactoringSaveHelper.SAVE_NOTHING);
} catch (CoreException e) {
- e.printStackTrace();
+ JSFModelPlugin.getPluginLog().logError(e);
}
}
+
}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/RefactoringChangesFactory.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.jsf2.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility;
+import org.eclipse.ltk.core.refactoring.GroupCategory;
+import org.eclipse.ltk.core.refactoring.GroupCategorySet;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
+import org.jboss.tools.jsf.jsf2.refactoring.core.StructuredChanges;
+import org.jboss.tools.jsf.jsf2.refactoring.core.StructuredTextFileChange;
+import org.jboss.tools.jsf.jsf2.util.JSF2ComponentUtil;
+import org.jboss.tools.jsf.messages.JSFUIMessages;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+@SuppressWarnings("restriction")
+public class RefactoringChangesFactory {
+
+ private static final GroupCategorySet CATEGORY_COMPOSITE_URI_RENAME = new GroupCategorySet(
+ new GroupCategory(
+ "org.jboss.tools.jsf.jsf2.refactoring.rename.composite.uri.type", JSFUIMessages.Refactoring_JSF_2_Rename_Composite_URI_Changes, JSFUIMessages.Refactoring_JSF_2_Changes_Rename_Composite_URI)); //$NON-NLS-1$
+
+ private static final GroupCategorySet CATEGORY_COMPOSITE_COMPONENT_RENAME = new GroupCategorySet(
+ new GroupCategory(
+ "org.jboss.tools.jsf.jsf2.refactoring.rename.composite.uri.type", JSFUIMessages.Refactoring_JSF_2_Rename_Composite_Component_Changes, JSFUIMessages.Refactoring_JSF_2_Changes_Rename_Composite_Component)); //$NON-NLS-1$
+
+ public static StructuredChanges createRenameURIChanges(IResource resource,
+ Map<String, String> urisMap) throws CoreException {
+ StructuredChanges changes = new StructuredChanges(
+ JSFUIMessages.Refactoring_JSF_2_Rename_Composite_URI_Changes);
+ createRenameURIChangesRecursively(resource, urisMap, changes);
+ if (changes.getChildren() == null || changes.getChildren().length == 0) {
+ return null;
+ }
+ return changes;
+ }
+
+ public static StructuredChanges createRenameCompositeComponentsChanges(
+ IResource resource, String uri, String oldFileName,
+ String newFileName) throws CoreException {
+ StructuredChanges changes = new StructuredChanges(
+ JSFUIMessages.Refactoring_JSF_2_Rename_Composite_Component_Changes);
+ createRenameComponentChangesRecursively(resource, uri, oldFileName,
+ newFileName, changes);
+ if (changes.getChildren() == null || changes.getChildren().length == 0) {
+ return null;
+ }
+ return changes;
+ }
+
+ private static void createRenameComponentChangesRecursively(
+ IResource resource, String uri, String oldFileName,
+ String newFileName, StructuredChanges changes) throws CoreException {
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ StructuredTextFileChange change = createRanameComponentChange(file,
+ uri, oldFileName, newFileName);
+ if (change != null) {
+ changes.add(change);
+ }
+ } else if (resource instanceof IProject) {
+ IResource[] children = ((IProject) resource).members();
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ createRenameComponentChangesRecursively(children[i], uri,
+ oldFileName, newFileName, changes);
+ }
+ }
+ } else if (resource instanceof IFolder) {
+ IResource[] children = ((IFolder) resource).members();
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ createRenameComponentChangesRecursively(children[i], uri,
+ oldFileName, newFileName, changes);
+ }
+ }
+ }
+ }
+
+ private static StructuredTextFileChange createRanameComponentChange(
+ IFile file, String uri, String oldName, String newName) {
+ if (!isFileCorrect(file)) {
+ return null;
+ }
+ StructuredTextFileChange fileChange = null;
+ Map<String, List<Element>> compositeComponentsMap = JSF2ComponentUtil
+ .findCompositeComponents(JSF2ComponentModelManager
+ .getReadableDOMDocument(file));
+ List<Element> compositeComponents = compositeComponentsMap.get(uri);
+ if (compositeComponents != null) {
+ for (Element element : compositeComponents) {
+ if (oldName.equals(element.getLocalName())) {
+ if (element instanceof IDOMElement) {
+ IDOMElement domElement = (IDOMElement) element;
+ if (fileChange == null) {
+ fileChange = new StructuredTextFileChange(file
+ .getFullPath().toOSString(), file);
+ }
+ ReplaceEdit[] edits = createReplaceEditsForElement(domElement, oldName, newName);
+ for (int i = 0; i < edits.length; i++) {
+ TextChangeCompatibility.addTextEdit(fileChange,
+ JSFUIMessages.Refactoring_JSF_2_Rename_Composite_Component,
+ edits[i], CATEGORY_COMPOSITE_COMPONENT_RENAME);
+ }
+ }
+ }
+ }
+ }
+ return fileChange;
+ }
+
+ private static ReplaceEdit[] createReplaceEditsForElement(IDOMElement element, String oldName, String newName){
+ List<ReplaceEdit> edits = new ArrayList<ReplaceEdit>();
+ String sourceString = element.getSource();
+ int startOffset = element.getStartOffset();
+ int endStartOffset = element.getEndStartOffset();
+ int endOffset = element.getEndOffset();
+ if (endOffset != endStartOffset) {
+ ReplaceEdit edit = new ReplaceEdit(sourceString.lastIndexOf(oldName) + startOffset, oldName.length(), newName);
+ edits.add(edit);
+ }
+ ReplaceEdit edit = new ReplaceEdit(startOffset + sourceString.indexOf(oldName), oldName.length(), newName);
+ edits.add(edit);
+ return edits.toArray(new ReplaceEdit[0]);
+ }
+
+ private static void createRenameURIChangesRecursively(IResource resource,
+ Map<String, String> urisMap, StructuredChanges changes)
+ throws CoreException {
+ if (resource instanceof IFile) {
+ IFile file = (IFile) resource;
+ StructuredTextFileChange change = createRanameURIChange(file,
+ urisMap);
+ if (change != null) {
+ changes.add(change);
+ }
+ } else if (resource instanceof IProject) {
+ IResource[] children = ((IProject) resource).members();
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ createRenameURIChangesRecursively(children[i], urisMap,
+ changes);
+ }
+ }
+ } else if (resource instanceof IFolder) {
+ IResource[] children = ((IFolder) resource).members();
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ createRenameURIChangesRecursively(children[i], urisMap,
+ changes);
+ }
+ }
+ }
+ }
+
+ private static StructuredTextFileChange createRanameURIChange(IFile file,
+ Map<String, String> urisMap) {
+ if (!isFileCorrect(file)) {
+ return null;
+ }
+ StructuredTextFileChange fileChange = null;
+ IDOMAttr[] uriAttrs = JSF2ComponentUtil
+ .findURIContainers(JSF2ComponentModelManager
+ .getReadableDOMDocument(file));
+ for (IDOMAttr uriAttr : uriAttrs) {
+ String valueToBeReplaced = uriAttr.getValue();
+ if (urisMap.containsKey(valueToBeReplaced)) {
+ if (fileChange == null) {
+ fileChange = new StructuredTextFileChange(file
+ .getFullPath().toOSString(), file);
+ }
+ ReplaceEdit edit = new ReplaceEdit(uriAttr
+ .getValueRegionStartOffset() + 1, valueToBeReplaced
+ .length(), urisMap.get(valueToBeReplaced));
+ TextChangeCompatibility.addTextEdit(fileChange,
+ JSFUIMessages.Refactoring_JSF_2_Rename_Composite_URI,
+ edit, CATEGORY_COMPOSITE_URI_RENAME);
+ }
+ }
+ return fileChange;
+ }
+
+ private static boolean isFileCorrect(IFile file) {
+ if (file == null) {
+ return false;
+ }
+ if (!"xhtml".equals(file.getFileExtension()) && !"jsp".equals(file.getFileExtension())) { //$NON-NLS-1$ //$NON-NLS-2$
+ IContentType contentType = IDE.getContentType(file);
+ if (contentType == null) {
+ return false;
+ }
+ String id = contentType.getId();
+ if (!"org.eclipse.jst.jsp.core.jspsource".equals(id) && !"org.eclipse.wst.html.core.htmlsource".equals(id)) { //$NON-NLS-1$ //$NON-NLS-2$
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameDescriptor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameDescriptor.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameDescriptor.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.core.resources.IFile;
@@ -4,6 +15,11 @@
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+/**
+ *
+ * @author yzhishko
+ *
+ */
@SuppressWarnings("restriction")
public class CompositeAttributeRenameDescriptor implements IRenameDescriptor{
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameProcessor.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameProcessor.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import java.util.List;
@@ -32,6 +43,12 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
public class CompositeAttributeRenameProcessor extends RenameProcessor
implements INameUpdating {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameRefactoringWizard.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameRefactoringWizard.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/CompositeAttributeRenameRefactoringWizard.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
@@ -5,6 +16,12 @@
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
public class CompositeAttributeRenameRefactoringWizard extends
org.eclipse.jdt.internal.ui.refactoring.reorg.RenameRefactoringWizard {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/IRenameDescriptor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/IRenameDescriptor.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/IRenameDescriptor.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
@@ -2,2 +13,8 @@
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
public interface IRenameDescriptor {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameAction.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameAction.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameAction.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.core.commands.AbstractHandler;
@@ -18,6 +29,12 @@
import org.jboss.tools.jsf.jsf2.refactoring.RefactoringActionManager;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
public class RenameAction extends AbstractHandler implements
IEditorActionDelegate {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameRefactoring.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameRefactoring.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameRefactoring.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
@@ -2,2 +13,8 @@
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("deprecation")
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceManager.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceManager.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.jdt.internal.ui.refactoring.UserInterfaceManager;
@@ -2,2 +13,8 @@
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceStarter.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceStarter.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/action/rename/RenameUserInterfaceStarter.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.action.rename;
import org.eclipse.jdt.internal.ui.refactoring.UserInterfaceStarter;
@@ -2,2 +13,8 @@
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredChanges.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredChanges.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredChanges.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.core;
import org.eclipse.ltk.core.refactoring.Change;
@@ -3,4 +14,10 @@
import org.eclipse.ltk.core.refactoring.CompositeChange;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
public class StructuredChanges extends CompositeChange {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredTextFileChange.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredTextFileChange.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/core/StructuredTextFileChange.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.core;
import org.eclipse.core.resources.IFile;
@@ -11,6 +22,12 @@
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.common.text.ext.IMultiPageEditor;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
public class StructuredTextFileChange extends TextFileChange{
public StructuredTextFileChange(String name, IFile file) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/view/StructuredChangesPreviewViewer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/view/StructuredChangesPreviewViewer.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/refactoring/view/StructuredChangesPreviewViewer.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.jsf2.refactoring.view;
import org.eclipse.ltk.internal.ui.refactoring.TextEditChangePreviewViewer;
@@ -2,2 +13,8 @@
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
@SuppressWarnings("restriction")
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/JSFUIMessages.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -140,6 +140,12 @@
public static String Refactoring_JSF_2_Rename_Composite_Attr;
public static String Refactoring_JSF_2_Invalid_Attr;
public static String Refactoring_JSF_2_Isnt_Available;
+ public static String Refactoring_JSF_2_Rename_Composite_URI_Changes;
+ public static String Refactoring_JSF_2_Changes_Rename_Composite_URI;
+ public static String Refactoring_JSF_2_Rename_Composite_URI;
+ public static String Refactoring_JSF_2_Rename_Composite_Component_Changes;
+ public static String Refactoring_JSF_2_Changes_Rename_Composite_Component;
+ public static String Refactoring_JSF_2_Rename_Composite_Component;
static {
// load message values from bundle file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties 2010-06-07 14:11:32 UTC (rev 22600)
@@ -116,4 +116,10 @@
Refactoring_JSF_2_Rename_Composite_Attr_Name=Rename composite attribute name
Refactoring_JSF_2_Rename_Composite_Attr=Rename composite attribute
Refactoring_JSF_2_Invalid_Attr=Attribute name is not valid
-Refactoring_JSF_2_Isnt_Available=Refactoring is not available in the current place
\ No newline at end of file
+Refactoring_JSF_2_Isnt_Available=Refactoring is not available in the current place
+Refactoring_JSF_2_Rename_Composite_URI_Changes=Rename composite URI changes
+Refactoring_JSF_2_Changes_Rename_Composite_URI=Changes to rename composite URI
+Refactoring_JSF_2_Rename_Composite_URI=Rename composite URI
+Refactoring_JSF_2_Rename_Composite_Component_Changes=Rename composite component changes
+Refactoring_JSF_2_Changes_Rename_Composite_Component=Changes to rename composite component
+Refactoring_JSF_2_Rename_Composite_Component=Rename composite component
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/JSFAutoTestCase.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -89,9 +89,16 @@
protected String loadFileContent(String resourceRelativePath) throws IOException {
File file = new File(getPathToResources(resourceRelativePath));
StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
- Scanner scanner = new Scanner(file);
- while (scanner.hasNextLine()) {
- builder.append(scanner.nextLine()+"\n"); //$NON-NLS-1$
+ Scanner scanner = null;
+ try {
+ scanner = new Scanner(file);
+ while (scanner.hasNextLine()) {
+ builder.append(scanner.nextLine()+"\n"); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ if (scanner != null) {
+ scanner.close();
+ }
}
return builder.toString();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AbstractRefactorTest.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -97,5 +97,5 @@
bot.sleep(2000);
editor.saveAndClose();
}
-
+
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AttributeRenameTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AttributeRenameTest.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2AttributeRenameTest.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -4,6 +4,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotStyledText;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
@@ -16,13 +17,15 @@
checkContent();
}
- private void renameCompositeAttribute() {
+ private void renameCompositeAttribute() throws IOException {
SWTBotEclipseEditor editor = bot
.editorByTitle("echo.xhtml").toTextEditor(); //$NON-NLS-1$
editor.selectRange(9, 29, 1);
bot.menu("Refactor").menu("Rename").click(); //$NON-NLS-1$ //$NON-NLS-2$
bot.shell("Rename Composite Attribute").activate(); //$NON-NLS-1$
bot.textWithLabel("New name:").setText("echo1"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.button("Preview >").click(); //$NON-NLS-1$
+ checkPreview();
bot.button("OK").click(); //$NON-NLS-1$
}
@@ -77,4 +80,16 @@
super.tearDown();
}
+ private void checkPreview() throws IOException {
+ delay();
+ SWTBotTree tree = bot.tree();
+ tree
+ .expandNode("Composite attribute name changes").expandNode("echo.xhtml - " + projectProperties.getProperty("JSFProjectName") + "/WebContent/resources/mycomp").expandNode("Rename composite attribute name"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ tree
+ .expandNode("Composite attribute name changes").expandNode("jsf2TestPage.xhtml - " + projectProperties.getProperty("JSFProjectName") + "/WebContent").expandNode("Rename composite attribute"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ SWTBotStyledText styledText = bot.styledText(0);
+ assertEquals(loadFileContent("refactor/compositeComponent.html"), styledText.getText()); //$NON-NLS-1$
+ System.out.println(styledText.getText());
+ }
+
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2MoveParticipantTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2MoveParticipantTest.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2MoveParticipantTest.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -42,7 +42,8 @@
tree = innerBot.tree();
tree
.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("WebContent").expandNode("resources").expandNode("mycomp1").select(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- delay();
+ bot.button("Preview >").click(); //$NON-NLS-1$
+ checkPreview();
bot.button("OK").click(); //$NON-NLS-1$
delay();
}
@@ -83,5 +84,12 @@
delay();
super.tearDown();
}
+
+ private void checkPreview(){
+ delay();
+ SWTBotTree tree = bot.tree();
+ tree
+ .expandNode("Rename composite URI changes").expandNode("jsf2TestPage.xhtml - " + projectProperties.getProperty("JSFProjectName") + "/WebContent").expandNode("Rename composite URI"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2RenameParticipantTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2RenameParticipantTest.java 2010-06-07 14:05:12 UTC (rev 22599)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/jsf2/refactor/JSF2RenameParticipantTest.java 2010-06-07 14:11:32 UTC (rev 22600)
@@ -22,6 +22,8 @@
.expandNode(projectProperties.getProperty("JSFProjectName")).expandNode("WebContent").expandNode("resources").expandNode("mycomp").expandNode("echo.xhtml").select(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
bot.menu("Refactor").menu("Rename...").click(); //$NON-NLS-1$ //$NON-NLS-2$
bot.textWithLabel("New name:").setText("echo1.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ bot.button("Preview >").click(); //$NON-NLS-1$
+ checkPreview();
bot.button("OK").click(); //$NON-NLS-1$
delay();
}
@@ -59,4 +61,11 @@
super.tearDown();
}
+ private void checkPreview() {
+ delay();
+ SWTBotTree tree = bot.tree();
+ tree
+ .expandNode("Rename composite component changes").expandNode("jsf2TestPage.xhtml - " + projectProperties.getProperty("JSFProjectName") + "/WebContent").expandNode("Rename composite component"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ }
+
}
14 years, 7 months
JBoss Tools SVN: r22599 - in trunk/cdi: plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-06-07 10:05:12 -0400 (Mon, 07 Jun 2010)
New Revision: 22599
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6418
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIUtil.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -117,9 +117,9 @@
Set<IBean> nonAlternativeBeans = new HashSet<IBean>();
for (IBean bean : beans) {
- if (bean == null || bean instanceof IDecorator || bean instanceof IInterceptor) {
- continue;
- }
+// if (bean == null || bean instanceof IDecorator || bean instanceof IInterceptor) {
+// continue;
+// }
if (bean.isAlternative()) {
alternativeBeans.add(bean);
} else {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/IBeanManager.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -37,7 +37,7 @@
* attemptToResolveAmbiguousNames==true the manager should try to
* resolve the EL name. If any of the beans are alternatives, the
* manager will eliminate all beans that are not alternatives,
- * expect for producer methods and fields of beans that are
+ * except for producer methods and fields of beans that are
* alternatives. If the name of a bean is not resolvable then
* both beans would be included in the result list.
* @return all @Named beans
@@ -54,7 +54,7 @@
* attemptToResolveAmbiguousNames==true the manager should try to
* resolve the EL name. If any of the beans are alternatives, the
* manager will eliminate all beans that are not alternatives,
- * expect for producer methods and fields of beans that are
+ * except for producer methods and fields of beans that are
* alternatives.
* @return the matched beans
*/
@@ -75,7 +75,7 @@
* and attemptToResolveAmbiguousDependency==true the manager
* should try to resolve the ambiguity. If any of the beans are
* alternatives, the manager will eliminate all beans that are
- * not alternatives, expect for producer methods and fields of
+ * not alternatives, except for producer methods and fields of
* beans that are alternatives.
*
* @return the resulting set of beans
@@ -97,7 +97,7 @@
* and attemptToResolveAmbiguousDependency==true the manager
* should try to resolve the ambiguity. If any of the beans are
* alternatives, the manager will eliminate all beans that are
- * not alternatives, expect for producer methods and fields of
+ * not alternatives, except for producer methods and fields of
* beans that are alternatives.
*
* @return the resulting set of beans
@@ -119,7 +119,7 @@
* and attemptToResolveAmbiguousDependency==true the manager
* should try to resolve the ambiguity. If any of the beans are
* alternatives, the manager will eliminate all beans that are
- * not alternatives, expect for producer methods and fields of
+ * not alternatives, except for producer methods and fields of
* beans that are alternatives.
*
* @return the resulting set of beans
@@ -131,9 +131,17 @@
* points.
*
* @param injectionPoint
+ * @param attemptToResolveAmbiguousDependency
+ * if there are a few beans which are eligible for the given injection
+ * and attemptToResolveAmbiguousDependency==true the manager
+ * should try to resolve the ambiguity. If any of the beans are
+ * alternatives, the manager will eliminate all beans that are
+ * not alternatives, except for producer methods and fields of
+ * beans that are alternatives.
+
* @return the resulting set of beans
*/
- Set<IBean> getBeans(IInjectionPoint injectionPoint);
+ Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency, IInjectionPoint injectionPoint);
/**
* Returns the bean which is declared in the given IType.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferenceInitializer.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -39,5 +39,7 @@
defaultPreferences.put(CDIPreferences.INTERCEPTOR_ANNOTATED_SPECIALIZES, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.DECORATOR_ANNOTATED_SPECIALIZES, CDIPreferences.WARNING);
defaultPreferences.put(CDIPreferences.MISSING_NONBINDING_IN_QUALIFIER_TYPE_MEMBER, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.UNSATISFIED_INJECTION_POINTS, CDIPreferences.WARNING);
+ defaultPreferences.put(CDIPreferences.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.WARNING);
}
}
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -46,6 +46,11 @@
//Type group
+// 5.2.1. Unsatisfied and ambiguous dependencies
+// - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and
+// treats it as a deployment problem.
+ public static final String UNSATISFIED_INJECTION_POINTS = INSTANCE.createSeverityOption("unsatisfiedInjectionPoints"); //$NON-NLS-1$
+ public static final String AMBIGUOUS_INJECTION_POINTS = INSTANCE.createSeverityOption("ambiguousInjectionPoints"); //$NON-NLS-1$
// - bean class or producer method or field specifies a @Typed annotation,
// and the value member specifies a class which does not correspond to a type
// in the unrestricted set of bean types of a bean (2.2.2)
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -241,21 +241,25 @@
return getResolvedBeans(result, attemptToResolveAmbiguousDependency);
}
- public Set<IBean> getBeans(IInjectionPoint injectionPoints) {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.cdi.core.IBeanManager#getBeans(boolean, org.jboss.tools.cdi.core.IInjectionPoint)
+ */
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency, IInjectionPoint injectionPoint) {
Set<IBean> result = new HashSet<IBean>();
- IParametedType type = injectionPoints.getType();
+ IParametedType type = injectionPoint.getType();
if(type == null) {
return result;
}
- boolean isParameter = injectionPoints instanceof InjectionPointParameter;
+ boolean isParameter = injectionPoint instanceof InjectionPointParameter;
boolean isNew = false;
- Set<IQualifierDeclaration> qs = injectionPoints.getQualifierDeclarations();
+ Set<IQualifierDeclaration> qs = injectionPoint.getQualifierDeclarations();
List<IType> qs2 = null;
if(isParameter) {
qs2 = new ArrayList<IType>();
- Set<IQualifier> qs_ = ((InjectionPointParameter)injectionPoints).getQualifiers();
+ Set<IQualifier> qs_ = ((InjectionPointParameter)injectionPoint).getQualifiers();
for (IQualifier q: qs_) {
IType t = q.getSourceType();
if(t != null) {
@@ -279,6 +283,8 @@
synchronized(allBeans) {
beans.addAll(allBeans);
}
+ boolean delegateInjectionPoint = injectionPoint.isDelegate();
+
for (IBean b: beans) {
if(isNew) {
//TODO improve
@@ -291,6 +297,9 @@
Set<IParametedType> types = b.getLegalTypes();
if(containsType(types, type)) {
try {
+ if(delegateInjectionPoint && b == injectionPoint.getClassBean()) {
+ continue;
+ }
Set<IQualifierDeclaration> qsb = b.getQualifierDeclarations(true);
if(isParameter) {
if(areMatchingQualifiers(qsb, qs2.toArray(new IType[0]))) {
@@ -307,7 +316,7 @@
}
}
- return result;
+ return getResolvedBeans(result, attemptToResolveAmbiguousDependency);
}
public static boolean containsType(Set<IParametedType> types, IParametedType type) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -953,14 +953,29 @@
addError(CDIValidationMessages.STATIC_METHOD_ANNOTATED_INJECT, CDIPreferences.GENERIC_METHOD_ANNOTATED_INJECT, declaration, injection.getResource());
}
}
+
+ IAnnotationDeclaration declaration = injection.getInjectAnnotation();
+
/*
* 5.2.2. Legal injection point types
* - injection point type is a type variable
*/
if(!(injection instanceof IInjectionPointMethod) && CDIUtil.isTypeVariable(injection, false)) {
- IAnnotationDeclaration declaration = injection.getInjectAnnotation();
addError(CDIValidationMessages.INJECTION_TYPE_IS_VARIABLE, CDIPreferences.INJECTION_TYPE_IS_VARIABLE, declaration, injection.getResource());
}
+
+ /*
+ * 5.2.1. Unsatisfied and ambiguous dependencies
+ * - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
+ */
+ if(declaration!=null && !(injection instanceof IInjectionPointParameter)) {
+ Set<IBean> beans = cdiProject.getBeans(true, injection);
+ if(beans.isEmpty()) {
+ addError(CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, CDIPreferences.UNSATISFIED_INJECTION_POINTS, declaration, injection.getResource());
+ } else if(beans.size()>1) {
+ addError(CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, CDIPreferences.AMBIGUOUS_INJECTION_POINTS, declaration, injection.getResource());
+ }
+ }
}
/**
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -27,6 +27,8 @@
public static String INTERCEPTOR_HAS_NAME;
public static String DECORATOR_HAS_NAME;
+ public static String UNSATISFIED_INJECTION_POINTS;
+ public static String AMBIGUOUS_INJECTION_POINTS;
public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION;
public static String PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD;
public static String PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/errorList.txt 2010-06-07 14:05:12 UTC (rev 22599)
@@ -130,8 +130,12 @@
+5.2.1. Unsatisfied and ambiguous dependencies
+- If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and
+ treats it as a deployment problem.
+
5.5.7. Injection point metadata
- bean that declares any scope other than @Dependent has an injection point of type
InjectionPoint and qualifier @Default
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-06-07 14:05:12 UTC (rev 22599)
@@ -6,6 +6,8 @@
INTERCEPTOR_HAS_NAME=Interceptor has a name
DECORATOR_HAS_NAME=Decorator has a name
+UNSATISFIED_INJECTION_POINTS=No bean is eligible for injection to the injection point
+AMBIGUOUS_INJECTION_POINTS=Multiple beans are eligible for injection to the injection point
ILLEGAL_TYPE_IN_TYPED_DECLARATION=Bean class or producer method or field specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean
PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD=Producer method return type contains a wildcard type parameter
PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE=Producer method return type is a type variable
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -127,7 +127,7 @@
return false;
}
- Set<IBean> resultBeanSet = cdiProject.getBeans(injectionPoint);
+ Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
if(resultBeanSet.size() > 0)
return true;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointListHyperlink.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -78,7 +78,7 @@
return;
}
- Set<IBean> resultBeanSet = cdiProject.getBeans(injectionPoint);
+ Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
IHyperlink[] hyperlinks = new IHyperlink[resultBeanList.size()];
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -42,6 +42,8 @@
private static SectionDescription SECTION_TYPE = new SectionDescription(
CDIPreferencesMessages.CDIValidatorConfigurationBlock_section_type,
new String[][]{
+ {CDIPreferences.UNSATISFIED_INJECTION_POINTS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_unsatisfiedInjectionPoints_label},
+ {CDIPreferences.AMBIGUOUS_INJECTION_POINTS, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_ambiguousInjectionPoints_label},
{CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_illegalTypeInTypedDeclaration_label},
{CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeHasWildcard_label},
{CDIPreferences.PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label},
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -42,6 +42,8 @@
// Section Type
public static String CDIValidatorConfigurationBlock_section_type;
+ public static String CDIValidatorConfigurationBlock_pb_unsatisfiedInjectionPoints_label;
+ public static String CDIValidatorConfigurationBlock_pb_ambiguousInjectionPoints_label;
public static String CDIValidatorConfigurationBlock_pb_illegalTypeInTypedDeclaration_label;
public static String CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeHasWildcard_label;
public static String CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-06-07 14:05:12 UTC (rev 22599)
@@ -31,6 +31,8 @@
##Section Type
CDIValidatorConfigurationBlock_section_type=Type
+CDIValidatorConfigurationBlock_pb_unsatisfiedInjectionPoints_label=Unsatisfied dependencies for injection point:
+CDIValidatorConfigurationBlock_pb_ambiguousInjectionPoints_label=Ambiguous dependencies for injection point:
CDIValidatorConfigurationBlock_pb_illegalTypeInTypedDeclaration_label=Illegal type in @Typed:
CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeHasWildcard_label=Wildcard in producer method return type:
CDIValidatorConfigurationBlock_pb_producerMethodReturnTypeIsVariable_label=Variable in producer method return type:
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -82,7 +82,7 @@
return;
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
if(injectionPoint != null){
- Set<IBean> resultBeanSet = cdiProject.getBeans(injectionPoint);
+ Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
for(IBean bean : resultBeanList){
if(bean != null){
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/QualifierDefinitionTest.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -126,7 +126,7 @@
assertEquals("Wrong number of qualifier declarations.", 1, declarations.size());
assertLocationEquals(declarations, 914, 5);
- Set<IBean> injectedBeans = cdiProject.getBeans(point);
+ Set<IBean> injectedBeans = cdiProject.getBeans(true, point);
assertEquals("Wrong number of beans.", 1, injectedBeans.size());
IBean injectedBean = injectedBeans.iterator().next();
IType beanClass = injectedBean.getBeanClass();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-07 13:51:20 UTC (rev 22598)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-06-07 14:05:12 UTC (rev 22599)
@@ -919,6 +919,18 @@
}
/**
+ * 5.2.1. Unsatisfied and ambiguous dependencies
+ * - If an unsatisfied or unresolvable ambiguous dependency exists, the container automatically detects the problem and treats it as a deployment problem.
+ *
+ * @throws Exception
+ */
+ public void testAmbiguousDependency() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/decorators/definition/inject/delegateField/TimestampLogger.java");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.AMBIGUOUS_INJECTION_POINTS, 34);
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, CDIValidationMessages.UNSATISFIED_INJECTION_POINTS, 34);
+ }
+
+ /**
* 10.4.2. Declaring an observer method
* - method has more than one parameter annotated @Observes
*
14 years, 7 months
JBoss Tools SVN: r22598 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-06-07 09:51:20 -0400 (Mon, 07 Jun 2010)
New Revision: 22598
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierCreationWizard.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierWizardPage.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-6413
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-06-07 13:27:25 UTC (rev 22597)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-06-07 13:51:20 UTC (rev 22598)
@@ -33,4 +33,5 @@
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.cdi.ui,
org.jboss.tools.cdi.ui.ca,
- org.jboss.tools.cdi.ui.preferences
+ org.jboss.tools.cdi.ui.preferences,
+ org.jboss.tools.cdi.ui.wizard
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-06-07 13:27:25 UTC (rev 22597)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-06-07 13:51:20 UTC (rev 22598)
@@ -115,4 +115,22 @@
</menuContribution>
</extension>
+ <extension point="org.eclipse.ui.newWizards">
+ <category
+ name="CDI"
+ id="org.jboss.tools.cdi.ui">
+ </category>
+ <wizard
+ category="org.jboss.tools.cdi.ui"
+ class="org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard"
+ icon="icons/cdi16.png"
+ id="org.jboss.tools.cdi.ui.wizard.NewQualifierCreationWizard"
+ name="Qualifier Annotation Type"
+ project="false">
+ <description>
+ Create a Qualifier Java File
+ </description>
+ </wizard>
+ </extension>
+
</plugin>
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierCreationWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierCreationWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierCreationWizard.java 2010-06-07 13:51:20 UTC (rev 22598)
@@ -0,0 +1,54 @@
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.wizards.NewElementWizard;
+import org.eclipse.jdt.ui.wizards.NewAnnotationWizardPage;
+
+public class NewQualifierCreationWizard extends NewElementWizard {
+
+ private NewAnnotationWizardPage fPage;
+ private boolean fOpenEditorOnFinish = true;
+
+ public NewQualifierCreationWizard() {}
+
+ public void addPages() {
+ super.addPages();
+ if (fPage == null) {
+ fPage= new NewQualifierWizardPage();
+ fPage.init(getSelection());
+ }
+ addPage(fPage);
+
+ }
+
+ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException {
+ fPage.createType(monitor); // use the full progress monitor
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.IWizard#performFinish()
+ */
+ public boolean performFinish() {
+ warnAboutTypeCommentDeprecation();
+ boolean res= super.performFinish();
+ if (res) {
+ IResource resource= fPage.getModifiedResource();
+ if (resource != null) {
+ selectAndReveal(resource);
+ if (fOpenEditorOnFinish) {
+ openResource((IFile) resource);
+ }
+ }
+ }
+ return res;
+ }
+
+ public IJavaElement getCreatedElement() {
+ return fPage.getCreatedType();
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierCreationWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierWizardPage.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierWizardPage.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierWizardPage.java 2010-06-07 13:51:20 UTC (rev 22598)
@@ -0,0 +1,108 @@
+package org.jboss.tools.cdi.ui.wizard;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IBuffer;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.ui.wizards.NewAnnotationWizardPage;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.ui.widget.editor.CheckBoxFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+//import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.common.ui.widget.editor.LabelFieldEditor;
+
+public class NewQualifierWizardPage extends NewAnnotationWizardPage {
+ IFieldEditor inherited = null;
+ CheckBoxFieldEditor cbInherited = null;
+
+ protected void createTypeMembers(IType newType, final ImportsManager imports, IProgressMonitor monitor) throws CoreException {
+ ISourceRange range = newType.getSourceRange();
+ IBuffer buf = newType.getCompilationUnit().getBuffer();
+
+ StringBuffer sb = new StringBuffer();
+
+ if(inherited != null && inherited.getValue() == Boolean.TRUE) {
+ imports.addImport("java.lang.annotation.Inherited");
+ sb.append("@Inherited").append("\n");
+ }
+
+ imports.addImport("java.lang.annotation.Target");
+ imports.addImport("static java.lang.annotation.ElementType.TYPE");
+ imports.addImport("static java.lang.annotation.ElementType.METHOD");
+ imports.addImport("static java.lang.annotation.ElementType.PARAMETER");
+ imports.addImport("static java.lang.annotation.ElementType.FIELD");
+ sb.append("@Target( {TYPE, METHOD, PARAMETER, FIELD} )").append("\n");
+
+ imports.addImport("java.lang.annotation.Retention");
+ imports.addImport("static java.lang.annotation.RetentionPolicy.RUNTIME");
+ sb.append("@Retention(RUNTIME)").append("\n");
+
+ imports.addImport("java.lang.annotation.Documented");
+ sb.append("@Documented").append("\n");
+
+ imports.addImport("javax.inject.Qualifier");
+ sb.append("@Qualifier").append("\n");
+
+ buf.replace(range.getOffset(), 0, sb.toString());
+ }
+
+ public void createControl(Composite parent) {
+ super_createControl(parent);
+
+ Composite composite = (Composite)getControl();
+
+ String label = "Add @Inherited";
+
+ inherited = /*IFieldEditorFactory.INSTANCE.*/createCheckboxEditor("isInherited", label, false);
+ inherited.doFillIntoGrid(composite);
+
+ ((Button)cbInherited.getCheckBoxControl()).setText(label);
+
+ }
+
+ void super_createControl(Composite parent) {
+ initializeDialogUnits(parent);
+
+ Composite composite= new Composite(parent, SWT.NONE);
+
+ int nColumns= 4;
+
+ GridLayout layout= new GridLayout();
+ layout.numColumns= nColumns;
+ composite.setLayout(layout);
+
+ createContainerControls(composite, nColumns);
+ createPackageControls(composite, nColumns);
+// createEnclosingTypeControls(composite, nColumns);
+
+ createSeparator(composite, nColumns);
+
+ createTypeNameControls(composite, nColumns);
+// createModifierControls(composite, nColumns);
+
+ createCommentControls(composite, nColumns);
+ enableCommentControl(true);
+
+ setControl(composite);
+
+ Dialog.applyDialogFont(composite);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_ANNOTATION_WIZARD_PAGE);
+ }
+
+ public IFieldEditor createCheckboxEditor(String name, String label,
+ boolean defaultValue) {
+ cbInherited = new CheckBoxFieldEditor(name,label,Boolean.valueOf(defaultValue));
+ CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
+ editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,""), cbInherited,});
+ return editor;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/NewQualifierWizardPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r22597 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-06-07 09:27:25 -0400 (Mon, 07 Jun 2010)
New Revision: 22597
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
Log:
https://jira.jboss.org/browse/JBIDE-6115
do not export generated script to database by default
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-06-07 11:56:55 UTC (rev 22596)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2010-06-07 13:27:25 UTC (rev 22597)
@@ -23,6 +23,7 @@
import org.hibernate.tool.hbm2x.ArtifactCollector;
import org.hibernate.tool.hbm2x.Exporter;
import org.hibernate.tool.hbm2x.GenericExporter;
+import org.hibernate.tool.hbm2x.Hbm2DDLExporter;
import org.hibernate.util.StringHelper;
/**
@@ -175,7 +176,7 @@
Properties props = new Properties();
props.putAll(globalProperties);
props.putAll(getProperties());
-
+
exporter.setProperties(props);
exporter.setArtifactCollector(collector);
@@ -255,6 +256,13 @@
props.remove("for_each"); //$NON-NLS-1$
}
+ // special handling for Hbm2DDLExporter
+ if(getExporterDefinition().getId().equals("org.hibernate.tools.hbm2ddl")) { //$NON-NLS-1$
+ Hbm2DDLExporter ddlExporter = (Hbm2DDLExporter) exporter;
+ //avoid users to delete their databases with a single click
+ ddlExporter.setExport(Boolean.getBoolean(props.getProperty("exportToDatabase", Boolean.toString(false)))); //$NON-NLS-1$
+ props.remove("exportToDatabase"); //$NON-NLS-1$
+ }
return exporter;
}
14 years, 7 months
JBoss Tools SVN: r22596 - branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-06-07 07:56:55 -0400 (Mon, 07 Jun 2010)
New Revision: 22596
Modified:
branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
Log:
https://jira.jboss.org/browse/JBIDE-6359
Modified: branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta
===================================================================
--- branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-06-07 08:44:31 UTC (rev 22595)
+++ branches/jbosstools-3.1.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-notifiers.meta 2010-06-07 11:56:55 UTC (rev 22596)
@@ -774,7 +774,8 @@
<XActionItem HandlerClassName="%DefaultReplaceUnique%"
ICON="action.empty"
PROPERTIES="child=NotifyEmail;significanceMessageClass=%Replace%"
- displayName="Notify Email..." kind="action" name="CreateTargetNotifyEmail">
+ WizardClassName="%Default%" displayName="Notify Email..."
+ kind="action" name="CreateTargetNotifyEmail">
<EntityData EntityName="ESBPreTargetNotifyEmail">
<AttributeData AttributeName="from"/>
<AttributeData AttributeName="send to"/>
@@ -848,4 +849,4 @@
</XActionItem>
</XActionItem>
</XEntityExtension>
-</XModelEntityGroup>
+</XModelEntityGroup>
\ No newline at end of file
14 years, 7 months
JBoss Tools SVN: r22595 - workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-06-07 04:44:31 -0400 (Mon, 07 Jun 2010)
New Revision: 22595
Modified:
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
Log:
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2010-06-07 07:46:49 UTC (rev 22594)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2010-06-07 08:44:31 UTC (rev 22595)
@@ -536,7 +536,7 @@
AbstractSmooksGraphicalModel graphModel = createGraphModel(childModel);
if (graphModel == null)
continue;
- root.addTreeNode(graphModel);
+ root.getTargetContainerModel().addTreeNode(graphModel);
applyGraphicalInformation(graphModel);
Collection<TreeNodeConnection> connections = createAllConnection(graphModel);
expandConnectedModels(connections);
14 years, 7 months
JBoss Tools SVN: r22594 - in workspace/smooks-dmb/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-06-07 03:46:49 -0400 (Mon, 07 Jun 2010)
New Revision: 22594
Added:
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputSourceContainerEditPart.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/OutputContainerEditPart.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputSourceContainerModel.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/OutputTargetModel.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerBorder.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerFigure.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/FillLayout.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/SourceContainerFigure.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/TargetContainerFigure.java
Modified:
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/RootModel.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/RootEditPart.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksEditFactory.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/autolayout/JavaMappingAutoLayout.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java
workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
Log:
add scrolled figures
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.core/plugin.xml 2010-06-07 07:46:49 UTC (rev 22594)
@@ -4,18 +4,7 @@
<extension
point="org.eclipse.core.contenttype.contentTypes">
</extension>
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/groovy-1.1.xsd"
- class="org.jboss.tools.smooks.model.groovy.GroovyPackage"
- genModel="model/groovy-1.1.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="groovy"
- class="org.jboss.tools.smooks.model.groovy.util.GroovyResourceFactoryImpl"/>
- </extension>
+
<extension point="org.eclipse.emf.ecore.generated_package">
@@ -57,32 +46,8 @@
class="org.jboss.tools.smooks.model.smooks.util.SmooksResourceFactoryImpl"/>
</extension>
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/xsl-1.1.xsd"
- class="org.jboss.tools.smooks.model.xsl.XslPackage"
- genModel="ecore.model/xsl-1.1.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="xsl"
- class="org.jboss.tools.smooks.model.xsl.util.XslResourceFactoryImpl"/>
- </extension>
+
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd"
- class="org.jboss.tools.smooks.model.javabean.JavabeanPackage"
- genModel="ecore.model/javabean-1.1.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="javabean"
- class="org.jboss.tools.smooks.model.javabean.util.JavabeanResourceFactoryImpl"/>
- </extension>
-
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="http://www.milyn.org/schema/edi-message-mapping-1.0.xsd"
@@ -96,97 +61,10 @@
class="org.jboss.tools.smooks.model.medi.util.MEdiResourceFactoryImpl"/>
</extension>
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/file-routing-1.1.xsd"
- class="org.jboss.tools.smooks.model.fileRouting.FileRoutingPackage"
- genModel="model/file-routing-1.1.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="filerouting"
- class="org.jboss.tools.smooks.model.fileRouting.util.FileRoutingResourceFactoryImpl"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/csv-1.1.xsd"
- class="org.jboss.tools.smooks.model.csv.CsvPackage"
- genModel="model/csv-1.1.genmodel"/>
- </extension>
+
<extension
point="org.eclipse.emf.ecore.generated_package">
<package
- class="org.jboss.tools.smooks.model.iorouting.IoroutingPackage"
- genModel="model/io-routing-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/io-routing-1.1.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.dbrouting.DbroutingPackage"
- genModel="model/db-routing-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/db-routing-1.1.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage"
- genModel="model/jms-routing-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/jms-routing-1.1.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.json.JsonPackage"
- genModel="model/json-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/json-1.1.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.edi.EdiPackage"
- genModel="model/edi-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/edi-1.1.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.datasource.DatasourcePackage"
- genModel="model/datasource-1.1.genmodel"
- uri="http://www.milyn.org/xsd/smooks/datasource-1.1.xsd">
- </package>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.milyn.org/xsd/smooks/calc-1.1.xsd"
- class="org.jboss.tools.smooks.model.calc.CalcPackage"
- genModel="model/calc-1.1.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="calc"
- class="org.jboss.tools.smooks.model.calc.util.CalcResourceFactoryImpl"/>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.esbrouting.EsbroutingPackage"
- genModel="model/esbrouting-1.0.genmodel"
- uri="http://www.jboss.org/xsd/jbossesb/smooks/routing-1.0.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
class="org.jboss.tools.smooks.model.javabean12.Javabean12Package"
genModel="model/smooks-1.2-models/javabean12.genmodel"
uri="http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
@@ -216,39 +94,8 @@
uri="http://www.milyn.org/xsd/smooks/edi-1.2.xsd">
</package>
</extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.jmsrouting12.Jmsrouting12Package"
- genModel="model/smooks-1.2-models/jmsrouting12.genmodel"
- uri="http://www.milyn.org/xsd/smooks/jms-routing-1.2.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.persistence12.Persistence12Package"
- genModel="model/smooks-1.2-models/persistence12.genmodel"
- uri="http://www.milyn.org/xsd/smooks/persistence-1.2.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.rules10.Rules10Package"
- genModel="model/smooks-1.2-models/rules10.genmodel"
- uri="http://www.milyn.org/xsd/smooks/rules-1.0.xsd">
- </package>
- </extension>
- <extension
- point="org.eclipse.emf.ecore.generated_package">
- <package
- class="org.jboss.tools.smooks.model.validation10.Validation10Package"
- genModel="model/smooks-1.2-models/validation10.genmodel"
- uri="http://www.milyn.org/xsd/smooks/validation-1.0.xsd">
- </package>
- </extension>
+
</plugin>
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/RootModel.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/RootModel.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/RootModel.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -9,10 +9,10 @@
public class RootModel extends AbstractSmooksGraphicalModel{
- public RootModel() {
- super(null);
- }
-
+ private RootModel targetContainerModel = null;
+
+ private RootModel sourceContainerModel = null;
+
public static final String ADD_CHILDREN = "__pro_add_children"; //$NON-NLS-1$
public static final String REMOVE_CHILDREN = "__pro_remove_children"; //$NON-NLS-1$
@@ -21,6 +21,37 @@
private List<AbstractSmooksGraphicalModel> children;
+
+ public RootModel() {
+ super(null);
+ }
+
+
+
+ public RootModel getTargetContainerModel() {
+ return targetContainerModel;
+ }
+
+
+
+ public void setTargetContainerModel(RootModel targetContainerModel) {
+ this.targetContainerModel = targetContainerModel;
+ }
+
+
+
+ public RootModel getSourceContainerModel() {
+ return sourceContainerModel;
+ }
+
+
+
+ public void setSourceContainerModel(RootModel sourceContainerModel) {
+ this.sourceContainerModel = sourceContainerModel;
+ }
+
+
+
public List<AbstractSmooksGraphicalModel> getChildren() {
if (children == null) {
children = new ArrayList<AbstractSmooksGraphicalModel>();
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/RootEditPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/RootEditPart.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/RootEditPart.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -8,12 +8,15 @@
import java.util.List;
import org.eclipse.draw2d.FreeformLayer;
-import org.eclipse.draw2d.FreeformLayout;
import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.jboss.tools.smooks.gef.common.RootModel;
import org.jboss.tools.smooks.gef.tree.editpolicy.RootPanelXYLayoutEditPolicy;
+import org.jboss.tools.smooks.graphical.figures.FillLayout;
/**
* @author DartPeng
@@ -26,8 +29,11 @@
*/
@Override
protected IFigure createFigure() {
+
FreeformLayer layer = new FreeformLayer();
- layer.setLayoutManager(new FreeformLayout());
+ ToolbarLayout tl = new ToolbarLayout();
+ tl.setVertical(true);
+ layer.setLayoutManager(new FillLayout(((GraphicalViewer)((GraphicalEditPart)this).getViewer()).getControl()));
return layer;
}
@@ -60,7 +66,7 @@
*/
@Override
protected void createEditPolicies() {
- this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new RootPanelXYLayoutEditPolicy());
+// this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new RootPanelXYLayoutEditPolicy());
}
protected List<?> getModelChildren(){
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksEditFactory.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksEditFactory.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksEditFactory.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -25,6 +25,8 @@
import org.jboss.tools.smooks.gef.tree.model.ValueBindingConnection;
import org.jboss.tools.smooks.graphical.editors.editparts.InputDataContainerEditPart;
import org.jboss.tools.smooks.graphical.editors.editparts.InputDataTreeNodeEditPart;
+import org.jboss.tools.smooks.graphical.editors.editparts.InputSourceContainerEditPart;
+import org.jboss.tools.smooks.graphical.editors.editparts.OutputContainerEditPart;
import org.jboss.tools.smooks.graphical.editors.editparts.ResourceConfigEditFactory;
import org.jboss.tools.smooks.graphical.editors.editparts.SmooksRootEditPart;
import org.jboss.tools.smooks.graphical.editors.editparts.TriggerConnectionEditPart;
@@ -34,6 +36,8 @@
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataContianerModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.InputSourceContainerModel;
+import org.jboss.tools.smooks.graphical.editors.model.OutputTargetModel;
/**
* @author Dart
@@ -41,14 +45,13 @@
*/
public class SmooksEditFactory extends SmooksGEFEditFactory implements EditPartFactory {
private ResourceConfigEditFactory resourceConfigFactory;
-
+
private boolean displayInput = true;
public SmooksEditFactory() {
super();
resourceConfigFactory = new ResourceConfigEditFactory();
}
-
/**
* @return the displayInput
@@ -57,21 +60,27 @@
return displayInput;
}
-
-
/**
- * @param displayInput the displayInput to set
+ * @param displayInput
+ * the displayInput to set
*/
public void setDisplayInput(boolean displayInput) {
this.displayInput = displayInput;
}
-
-
public EditPart createEditPart(EditPart context, Object model) {
EditPart editPart = null;
+
if (model instanceof RootModel) {
- editPart = new SmooksRootEditPart();
+ if (model instanceof OutputTargetModel) {
+ editPart = new OutputContainerEditPart();
+ }
+ if (model instanceof InputSourceContainerModel) {
+ editPart = new InputSourceContainerEditPart();
+ }
+ if (editPart == null) {
+ editPart = new SmooksRootEditPart();
+ }
}
if (model.getClass() == TreeNodeModel.class) {
editPart = new TreeNodeEditPart();
@@ -86,20 +95,19 @@
editPart = new InputDataContainerEditPart();
}
- if (model instanceof AbstractResourceConfigGraphModel
- || model instanceof AbstractResourceConfigChildNodeGraphModel) {
+ if (model instanceof AbstractResourceConfigGraphModel || model instanceof AbstractResourceConfigChildNodeGraphModel) {
editPart = resourceConfigFactory.createEditPart(model);
}
if (model.getClass() == TreeNodeConnection.class) {
editPart = new TreeNodeConnectionEditPart();
}
- if(model.getClass() == TriggerConnection.class){
+ if (model.getClass() == TriggerConnection.class) {
editPart = new TriggerConnectionEditPart();
}
- if(model.getClass() == ValueBindingConnection.class){
+ if (model.getClass() == ValueBindingConnection.class) {
editPart = new ValueBindingConnectionEditPart();
}
- if(model.getClass() == BeanReferenceConnection.class){
+ if (model.getClass() == BeanReferenceConnection.class) {
editPart = new BeanReferenceConnectionEditPart();
}
if (editPart != null) {
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -51,6 +51,7 @@
import org.eclipse.gef.commands.CommandStackEvent;
import org.eclipse.gef.commands.CommandStackEventListener;
import org.eclipse.gef.dnd.TemplateTransferDropTargetListener;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.gef.editparts.FreeformGraphicalRootEditPart;
import org.eclipse.gef.ui.actions.SelectionAction;
import org.eclipse.gef.ui.parts.GraphicalEditor;
@@ -64,6 +65,10 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
@@ -96,12 +101,16 @@
import org.jboss.tools.smooks.graphical.actions.AutoLayoutAction;
import org.jboss.tools.smooks.graphical.editors.autolayout.IAutoLayout;
import org.jboss.tools.smooks.graphical.editors.commands.IgnoreException;
+import org.jboss.tools.smooks.graphical.editors.editparts.InputSourceContainerEditPart;
+import org.jboss.tools.smooks.graphical.editors.editparts.OutputContainerEditPart;
import org.jboss.tools.smooks.graphical.editors.editparts.RightClickSelectMarqueeDragTraker;
import org.jboss.tools.smooks.graphical.editors.editparts.SmooksGraphUtil;
import org.jboss.tools.smooks.graphical.editors.model.IValidatableModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataContianerModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataRootModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataTreeNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.InputSourceContainerModel;
+import org.jboss.tools.smooks.graphical.editors.model.OutputTargetModel;
import org.jboss.tools.smooks.graphical.editors.process.TaskType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
@@ -114,8 +123,8 @@
* @author Dart
*
*/
-public class SmooksGraphicalEditorPart extends GraphicalEditor implements ISelectionChangedListener,
- ISourceSynchronizeListener, IGraphicalEditorPart, ITaskNodeProvider, ISmooksModelValidateListener {
+public class SmooksGraphicalEditorPart extends GraphicalEditor implements ISelectionChangedListener, ISourceSynchronizeListener,
+ IGraphicalEditorPart, ITaskNodeProvider, ISmooksModelValidateListener {
private CommandStackListener emfCommandStackListener = null;
@@ -186,8 +195,7 @@
private void createEMFCommandStackListener() {
emfCommandStackListener = new org.eclipse.emf.common.command.CommandStackListener() {
public void commandStackChanged(EventObject event) {
- final Command mostRecentCommand = ((org.eclipse.emf.common.command.CommandStack) event.getSource())
- .getMostRecentCommand();
+ final Command mostRecentCommand = ((org.eclipse.emf.common.command.CommandStack) event.getSource()).getMostRecentCommand();
final EventObject fe = event;
getEditorSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
@@ -197,10 +205,8 @@
rawCommand = ((CommandWrapper) rawCommand).getCommand();
}
int commandType = EXECUTE_COMMAND;
- Command undoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource())
- .getUndoCommand();
- Command redoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource())
- .getRedoCommand();
+ Command undoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource()).getUndoCommand();
+ Command redoCommand = ((org.eclipse.emf.common.command.CommandStack) fe.getSource()).getRedoCommand();
if (undoCommand != null || rawCommand.equals(undoCommand)) {
commandType = EXECUTE_COMMAND;
}
@@ -215,8 +221,8 @@
command = ((CommandWrapper) command).getCommand();
}
handleInputParamChange(command);
- if (command instanceof SetCommand || command instanceof AddCommand
- || command instanceof DeleteCommand || command instanceof RemoveCommand) {
+ if (command instanceof SetCommand || command instanceof AddCommand || command instanceof DeleteCommand
+ || command instanceof RemoveCommand) {
refershRecentAffectedModel(command, command.getAffectedObjects(), commandType);
}
}
@@ -224,8 +230,7 @@
if (rawCommand instanceof SetCommand || rawCommand instanceof AddCommand
|| rawCommand instanceof DeleteCommand || rawCommand instanceof RemoveCommand) {
handleInputParamChange(rawCommand);
- refershRecentAffectedModel(rawCommand, mostRecentCommand.getAffectedObjects(),
- commandType);
+ refershRecentAffectedModel(rawCommand, mostRecentCommand.getAffectedObjects(), commandType);
}
}
}
@@ -266,6 +271,7 @@
mainComposite.setLayout(fillLayout);
super.createPartControl(mainComposite);
return;
+
}
super.createPartControl(parent);
}
@@ -288,8 +294,7 @@
@Override
public void dispose() {
if (smooksModelProvider != null) {
- smooksModelProvider.getEditingDomain().getCommandStack()
- .removeCommandStackListener(emfCommandStackListener);
+ smooksModelProvider.getEditingDomain().getCommandStack().removeCommandStackListener(emfCommandStackListener);
}
super.dispose();
}
@@ -424,8 +429,7 @@
getSelectionActions().add(autoLayout.getId());
}
- private void deleteRelatedConnection(AbstractSmooksGraphicalModel effecedNode, EStructuralFeature feature,
- SetCommand command) {
+ private void deleteRelatedConnection(AbstractSmooksGraphicalModel effecedNode, EStructuralFeature feature, SetCommand command) {
EObject data = (EObject) AdapterFactoryEditingDomain.unwrap(effecedNode.getData());
if (feature.equals(SmooksUIUtils.getBeanIDRefFeature(data))) {
@@ -435,7 +439,8 @@
TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
AbstractSmooksGraphicalModel target = treeNodeConnection.getTargetNode();
Object refValue = command.getValue();
- if(refValue == null) continue;
+ if (refValue == null)
+ continue;
String refID = refValue.toString();
Object targetModel = AdapterFactoryEditingDomain.unwrap(target.getData());
if (targetModel instanceof EObject) {
@@ -552,7 +557,7 @@
if (graphModel == null)
continue;
AbstractSmooksGraphicalModel.disconnectAllConnections(graphModel);
- root.removeTreeNode(graphModel);
+ root.getTargetContainerModel().removeTreeNode(graphModel);
}
}
} else {
@@ -579,7 +584,7 @@
if (graphModel == null)
continue;
try {
- root.addTreeNode(graphModel);
+ root.getTargetContainerModel().addTreeNode(graphModel);
} catch (Throwable t) {
t.printStackTrace();
}
@@ -618,7 +623,7 @@
object2 = AdapterFactoryEditingDomain.unwrap(object2);
AbstractSmooksGraphicalModel gmodel = findGraphicalModel(object2);
if (gmodel != null) {
- root.removeTreeNode(gmodel);
+ root.getTargetContainerModel().removeTreeNode(gmodel);
break;
}
}
@@ -661,7 +666,7 @@
if (graphModel == null)
continue;
node = graphModel;
- root.addTreeNode(graphModel);
+ root.getTargetContainerModel().addTreeNode(graphModel);
Collection<TreeNodeConnection> connections = createAllConnection(graphModel);
expandConnectedModels(connections);
applyGraphicalInformation(graphModel);
@@ -708,7 +713,23 @@
super.configureGraphicalViewer();
getGraphicalViewer().setEditDomain(editDomain);
getGraphicalViewer().setEditPartFactory(createEdtiPartFactory());
+ getGraphicalViewer().getControl().addControlListener(new ControlListener() {
+ public void controlResized(ControlEvent e) {
+ }
+
+ public void controlMoved(ControlEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+ });
+ getGraphicalViewer().getControl().addPaintListener(new PaintListener() {
+
+ public void paintControl(PaintEvent e) {
+ // ((AbstractGraphicalEditPart)getGraphicalViewer().getRootEditPart()).getFigure().getLayoutManager().layout(null);
+ }
+ });
+
getGraphicalViewer().setRootEditPart(new FreeformGraphicalRootEditPart() {
public DragTracker getDragTracker(Request req) {
return new RightClickSelectMarqueeDragTraker();
@@ -719,8 +740,7 @@
(TransferDropTargetListener) new TemplateTransferDropTargetListener(getGraphicalViewer()));
GraphicalViewerKeyHandler keyHandler = new GraphicalViewerKeyHandler(getGraphicalViewer());
- keyHandler.put(org.eclipse.gef.KeyStroke.getPressed(SWT.DEL, 0), this.getActionRegistry().getAction(
- ActionFactory.DELETE.getId()));
+ keyHandler.put(org.eclipse.gef.KeyStroke.getPressed(SWT.DEL, 0), this.getActionRegistry().getAction(ActionFactory.DELETE.getId()));
ContextMenuProvider provider = getContextMenuProvider();
getGraphicalViewer().setContextMenu(provider);
@@ -745,6 +765,9 @@
protected List<AbstractSmooksGraphicalModel> createInputDataGraphModel() {
List<AbstractSmooksGraphicalModel> inputGraphModel = new ArrayList<AbstractSmooksGraphicalModel>();
if (inputDataList != null && root != null) {
+ InputSourceContainerModel tcontainer = new InputSourceContainerModel();
+ root.setSourceContainerModel(tcontainer);
+ root.addTreeNode(tcontainer);
for (Iterator<?> iterator = inputDataList.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
ITreeContentProvider contentProvider = new XMLStructuredDataContentProvider();
@@ -758,9 +781,9 @@
}
containerModel.getChildren().add((IXMLStructuredObject) object);
if (containerModel != null) {
- TreeContainerModel container = new InputDataContianerModel(containerModel, contentProvider,
- labelProvider, getSmooksModelProvider());
- root.addTreeNode(container);
+ TreeContainerModel container = new InputDataContianerModel(containerModel, contentProvider, labelProvider,
+ getSmooksModelProvider());
+ tcontainer.addTreeNode(container);
inputGraphModel.add(container);
}
}
@@ -785,8 +808,10 @@
Object obj = smooksModelProvider.getSmooksModel();
if (obj == null)
return;
- AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider
- .getEditingDomain();
+ OutputTargetModel targetContainer = new OutputTargetModel();
+ root.addTreeNode(targetContainer);
+ root.setTargetContainerModel(targetContainer);
+ AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain) smooksModelProvider.getEditingDomain();
if (inputDataList != null && obj != null && obj instanceof DocumentRoot && editingDomain != null) {
createInputDataGraphModel();
SmooksResourceListType listType = ((DocumentRoot) obj).getSmooksResourceList();
@@ -795,7 +820,7 @@
Object object = (Object) iterator.next();
AbstractSmooksGraphicalModel gmodel = createGraphModel(object);
if (gmodel != null) {
- root.addTreeNode(gmodel);
+ targetContainer.addTreeNode(gmodel);
}
}
getGraphicalViewer().setContents(root);
@@ -832,7 +857,15 @@
protected List<TreeNodeConnection> createConnectionModel() {
List<TreeNodeConnection> connections = new ArrayList<TreeNodeConnection>();
if (root != null) {
- createConnection(root.getChildren(), connections);
+ List<AbstractSmooksGraphicalModel> children = new ArrayList<AbstractSmooksGraphicalModel>();
+ List<?> containers = root.getChildren();
+ for (Iterator<?> iterator = containers.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ if (object instanceof RootModel) {
+ children.addAll(((RootModel) object).getChildren());
+ }
+ }
+ createConnection(children, connections);
}
return connections;
}
@@ -870,30 +903,12 @@
List<TreeNodeConnection> cs = new ArrayList<TreeNodeConnection>();
if (connectionModelFactory != null) {
if (connectionModelFactory.hasConnection(model)) {
- Collection<TreeNodeConnection> cList = connectionModelFactory.createConnection(inputDataList,
- getSmooksResourceList(), root, model);
+ Collection<TreeNodeConnection> cList = connectionModelFactory.createConnection(inputDataList, getSmooksResourceList(),
+ root, model);
if (cList != null) {
cs.addAll(cList);
}
}
- // if (connectionModelFactory.hasBeanIDConnection(model)) {
- // Collection<TreeNodeConnection> c =
- // connectionModelFactory.createBeanIDReferenceConnection(
- // getSmooksResourceList(), root, model);
- // if (c != null) {
- // cs.addAll(c);
- // }
- // }
- // // for xsl template
- //
- // if (connectionModelFactory.hasXSLConnection(model)) {
- // Collection<TreeNodeConnection> c =
- // connectionModelFactory.createXSLConnection(inputDataList, root,
- // model);
- // if (c != null) {
- // cs.addAll(c);
- // }
- // }
}
if (cs.isEmpty())
return null;
@@ -962,16 +977,14 @@
public void createConnection(List<AbstractSmooksGraphicalModel> children, List<TreeNodeConnection> connections) {
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
- if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
- if (canCreateConnection(abstractSmooksGraphicalModel)) {
- Collection<TreeNodeConnection> c = createConnection(abstractSmooksGraphicalModel);
- if (c != null) {
- connections.addAll(c);
- }
+ if (canCreateConnection(abstractSmooksGraphicalModel)) {
+ Collection<TreeNodeConnection> c = createConnection(abstractSmooksGraphicalModel);
+ if (c != null) {
+ connections.addAll(c);
}
- List<AbstractSmooksGraphicalModel> cchildren = abstractSmooksGraphicalModel.getChildren();
- createConnection(cchildren, connections);
}
+ List<AbstractSmooksGraphicalModel> cchildren = abstractSmooksGraphicalModel.getChildren();
+ createConnection(cchildren, connections);
}
}
@@ -1033,21 +1046,15 @@
}
EditPart rootEditPart = getGraphicalViewer().getContents();
if (rootEditPart != null) {
- List<?> childrenEditPart = rootEditPart.getChildren();
+ List<?> containers = rootEditPart.getChildren();
+ List<?> childrenEditPart = new ArrayList();
+ for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ childrenEditPart.addAll(((EditPart)object).getChildren());
+ }
for (Iterator<?> iterator = childrenEditPart.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
-// Object model = ((EditPart) object).getModel();
-// if (object instanceof InputDataContainerEditPart || model instanceof XSLTemplateGraphicalModel) {
- SmooksUIUtils.expandGraphTree(expanedTreeNodeList, (TreeNodeEditPart) object);
-// }
- // if(model instanceof XSLTemplateGraphicalModel){
- // ((TreeNodeEditPart) object).expandNode();
- // if(!((TreeNodeEditPart) object).getChildren().isEmpty()){
- // SmooksUIUtils.expandGraphTree(expanedTreeNodeList,
- // (TreeNodeEditPart) ((TreeNodeEditPart)
- // object).getChildren().get(0));
- // }
- // }
+ SmooksUIUtils.expandGraphTree(expanedTreeNodeList, (TreeNodeEditPart) object);
}
}
@@ -1061,6 +1068,7 @@
@Override
protected void initializeGraphicalViewer() {
initGraphicalModel();
+ ((GraphicalEditPart) getGraphicalViewer().getRootEditPart()).getFigure().validate();
}
protected void applyGraphicalInformation(AbstractSmooksGraphicalModel graphicalModel) {
@@ -1126,9 +1134,12 @@
Node node = (Node) nodeMap.get(part);
figureList.add(part);
graphAnimation.recordInit(part);
- IMoveableModel graphicalModel = (IMoveableModel) part.getModel();
- map.put(graphicalModel, new Point(node.x, node.y));
- graphAnimation.recordFinal(part, new Rectangle(node.x, node.y, 0, 0));
+ Object gm = part.getModel();
+ if (gm instanceof IMoveableModel) {
+ IMoveableModel graphicalModel = (IMoveableModel) gm;
+ map.put(graphicalModel, new Point(node.x, node.y));
+ graphAnimation.recordFinal(part, new Rectangle(node.x, node.y, 0, 0));
+ }
}
IEditorSite editorSite = getEditorSite();
@@ -1188,7 +1199,17 @@
return graph;
}
EditPart rootEditorPart = this.getGraphicalViewer().getContents();
- List<?> children = rootEditorPart.getChildren();
+
+ List<?> containers = rootEditorPart.getChildren();
+ List children = new ArrayList();
+ for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
+ Object c = (Object) iterator.next();
+ if (c instanceof OutputContainerEditPart || c instanceof InputSourceContainerEditPart) {
+ children.addAll(((AbstractGraphicalEditPart) c).getChildren());
+ }
+ // children.add(c);
+ }
+
// HashMap<Object, Edge> edgeMap = new HashMap<Object, Edge>();
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
@@ -1308,8 +1329,8 @@
public void selectionChanged(SelectionChangedEvent event) {
updateActions(getSelectionActions());
- ISelectionProvider provider = ((SmooksTaskDetailsEditorSite)getSite()).getMultiPageEditor().getSite().getSelectionProvider();
- if(provider != null){
+ ISelectionProvider provider = ((SmooksTaskDetailsEditorSite) getSite()).getMultiPageEditor().getSite().getSelectionProvider();
+ if (provider != null) {
provider.setSelection(event.getSelection());
}
}
@@ -1356,8 +1377,7 @@
List<AbstractSmooksGraphicalModel> children = root.getChildren();
// remove all input data graph model
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator
- .next();
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
if (abstractSmooksGraphicalModel instanceof InputDataContianerModel) {
inputs.add((InputDataContianerModel) abstractSmooksGraphicalModel);
}
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -47,6 +47,7 @@
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -141,7 +142,7 @@
private GraphViewer processGraphViewer;
- private ScrolledPageBook pageBook;
+// private ScrolledPageBook pageBook;
private Map<String, Object> registedTaskPages = new HashMap<String, Object>();
@@ -152,7 +153,11 @@
private ProcessType process;
private Map<Object, String> smooksModelIdMap = new HashMap<Object, String>();
+
+ private Map<String,Object> detailsControlMap = new HashMap<String, Object>();
+ private Composite detailsContentsComposite;
+
public SmooksProcessGraphicalEditor(FormEditor editor, String id, String title, ISmooksModelProvider provider) {
super(editor, id, title);
this.smooksModelProvider = provider;
@@ -533,14 +538,17 @@
Section section = toolkit.createSection(taskDetailsComposite, Section.TITLE_BAR);
section.setText(Messages.SmooksProcessGraphicalEditor_TaskConfigurationSectionTitle);
- pageBook = new ScrolledPageBook(section);
- pageBook.setBackground(toolkit.getColors().getBackground());
- section.setClient(pageBook);
+ detailsContentsComposite = toolkit.createComposite(section);
+ section.setClient(detailsContentsComposite);
+// pageBook = new ScrolledPageBook(section);
+ section.setLayout(new FillLayout());
+// pageBook.setBackground(toolkit.getColors().getBackground());
+// section.setClient(pageBook);
- Composite emptyComposite = pageBook.createPage(emptyKey);
- emptyComposite.setLayout(new FillLayout());
- createEmptyTaskPanel(emptyComposite, toolkit);
- pageBook.showPage(emptyKey);
+// Composite emptyComposite = pageBook.createPage(emptyKey);
+// emptyComposite.setLayout(new FillLayout());
+// createEmptyTaskPanel(emptyComposite, toolkit);
+// pageBook.showPage(emptyKey);
}
/*
@@ -575,7 +583,7 @@
createTaskDetailsSection(toolkit, sashForm);
- sashForm.setWeights(new int[] { 3, 7 });
+ sashForm.setWeights(new int[] { 2, 8 });
validateEnd(null);
}
@@ -891,20 +899,45 @@
}
public Object getActiveEditorPage() {
- if (pageBook != null) {
- Control control = pageBook.getCurrentPage();
- return control.getData();
+ if(detailsContentsComposite != null){
+ Control[] controls = detailsContentsComposite.getChildren();
+ for (int i = 0; i < controls.length; i++) {
+ Control control = controls[i];
+ if( control.isVisible()){
+ return control.getData();
+ }
+ }
}
+// if (pageBook != null) {
+// Control control = pageBook.getCurrentPage();
+// return control.getData();
+// }
return null;
}
+
+ private void showEmptyPage(){
+ Control[] childrens = detailsContentsComposite.getChildren();
+ for (int i = 0; i < childrens.length; i++) {
+ Control child = childrens[i];
+ GridData gd = new GridData();
+ gd.exclude = true;
+ child.setLayoutData(gd);
+ child.setVisible(false);
+ child.setBounds(new Rectangle(0, 0, 0, 0));
+ }
+ detailsContentsComposite.setLayout(new GridLayout());
+ detailsContentsComposite.layout(false);
+ }
protected void showTaskControl(Object model) {
- if (pageBook == null)
+ if (detailsContentsComposite == null)
return;
- if (model == null)
- pageBook.showEmptyPage();
+ if (model == null){
+ showEmptyPage();
+ }
final Object finalModel = model;
- pageBook.getShell().getDisplay().syncExec(new Runnable() {
+ detailsContentsComposite.setLayout(new FillLayout());
+ detailsContentsComposite.getShell().getDisplay().syncExec(new Runnable() {
/*
* (non-Javadoc)
@@ -929,34 +962,60 @@
}
}
if (id != null) {
- if (!pageBook.hasPage(id)) {
- Composite parent = pageBook.createPage(id);
+ if (!detailsControlMap.containsKey(id)) {
+// Composite parent = pageBook.createPage(id);
+ Control[] childrens = detailsContentsComposite.getChildren();
+ for (int i = 0; i < childrens.length; i++) {
+ Control child = childrens[i];
+ child.setVisible(false);
+ child.setBounds(new Rectangle(0, 0, 0, 0));
+ if(child.getLayoutData() instanceof GridData){
+ ((GridData)child.getLayoutData()).exclude = true;
+ }
+ }
Object page = getRegisteTaskPage(id);
if (page != null && page instanceof IEditorPart) {
try {
- parent.setLayout(new FillLayout());
-
+ detailsContentsComposite.setLayout(new GridLayout());
+ Composite contentParent = toolkit.createComposite(detailsContentsComposite);
+ contentParent.setLayout(new FillLayout());
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ contentParent.setLayoutData(gd);
ITaskNodeProvider nodeProvider = (ITaskNodeProvider) ((IEditorPart) page)
.getAdapter(ITaskNodeProvider.class);
if (nodeProvider != null) {
nodeProvider.setTaskType((TaskType) finalModel);
}
- createTaskPage((IEditorPart) page, parent);
- pageBook.showPage(id);
- parent.setData(page);
+ createTaskPage((IEditorPart) page, contentParent);
+ detailsContentsComposite.layout(false);
+ contentParent.setData(page);
+ detailsControlMap.put(id, contentParent);
} catch (Throwable e) {
e.printStackTrace();
- pageBook.removePage(id);
- pageBook.showPage(emptyKey);
+ detailsControlMap.remove(id);
+ showEmptyPage();
}
} else {
- Control control = createTaskPanel(parent, toolkit, id);
+ for (int i = 0; i < childrens.length; i++) {
+ Control child = childrens[i];
+ child.setVisible(false);
+ child.setBounds(new Rectangle(0, 0, 0, 0));
+ if(child.getLayoutData() instanceof GridData){
+ ((GridData)child.getLayoutData()).exclude = true;
+ }
+ }
+ Control control = createTaskPanel(detailsContentsComposite, toolkit, id);
if (control != null) {
- pageBook.showPage(id);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ control.setLayoutData(gd);
+ detailsContentsComposite.layout(false);
+ detailsControlMap.put(id, control);
} else {
- pageBook.removePage(id);
- pageBook.showPage(emptyKey);
+ detailsControlMap.remove(id);
+ showEmptyPage();
+// pageBook.removePage(id);
+// pageBook.showPage(emptyKey);
}
}
} else {
@@ -966,17 +1025,115 @@
if (nodeProvider != null) {
nodeProvider.setTaskType((TaskType) finalModel);
}
- pageBook.showPage(id);
+ Control[] childrens = detailsContentsComposite.getChildren();
+ for (int i = 0; i < childrens.length; i++) {
+ Control child = childrens[i];
+ GridData gd = new GridData();
+ gd.exclude = true;
+ child.setLayoutData(gd);
+ child.setVisible(false);
+ child.setBounds(new Rectangle(0, 0, 0, 0));
+ }
+ detailsContentsComposite.setLayout(new GridLayout());
+
+ Control contentParent = (Control)detailsControlMap.get(id);
+ contentParent.setVisible(true);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ contentParent.setLayoutData(gd);
+ detailsContentsComposite.layout(false);
}
}
} else {
- // pageBook.showEmptyPage();
+ showEmptyPage();
}
}
});
updateGlobalActions();
}
+
+// protected void showTaskControl(Object model) {
+// if (pageBook == null)
+// return;
+// if (model == null){
+// pageBook.showEmptyPage();
+// }
+// final Object finalModel = model;
+// pageBook.setLayout(new FillLayout());
+// pageBook.setAlwaysShowScrollBars(false);
+// pageBook.getShell().getDisplay().syncExec(new Runnable() {
+//
+// /*
+// * (non-Javadoc)
+// *
+// * @see java.lang.Runnable#run()
+// */
+// public void run() {
+// FormToolkit toolkit = ((AbstractSmooksFormEditor) smooksModelProvider).getToolkit();
+// if (finalModel instanceof TaskType) {
+// String id = ((TaskType) finalModel).getId();
+// if (!isSingltonEditor(id)) {
+// String idref = generateTaskSpecailID((TaskType) finalModel);
+// if (idref != null) {
+// // idref = id + "_" + idref;
+// if (getRegisteTaskPage(idref) == null) {
+// IEditorPart editor = createEditorPart(finalModel);
+// registeTaskDetailsPage(editor, idref);
+// }
+// id = idref;
+// } else {
+// id = id + "_unknown"; //$NON-NLS-1$
+// }
+// }
+// if (id != null) {
+// if (!pageBook.hasPage(id)) {
+// Composite parent = pageBook.createPage(id);
+// Object page = getRegisteTaskPage(id);
+// if (page != null && page instanceof IEditorPart) {
+// try {
+// parent.setLayout(new FillLayout());
+//
+// ITaskNodeProvider nodeProvider = (ITaskNodeProvider) ((IEditorPart) page)
+// .getAdapter(ITaskNodeProvider.class);
+// if (nodeProvider != null) {
+// nodeProvider.setTaskType((TaskType) finalModel);
+// }
+// createTaskPage((IEditorPart) page, parent);
+// pageBook.showPage(id);
+// parent.setData(page);
+//
+// } catch (Throwable e) {
+// e.printStackTrace();
+// pageBook.removePage(id);
+// pageBook.showPage(emptyKey);
+// }
+// } else {
+// Control control = createTaskPanel(parent, toolkit, id);
+// if (control != null) {
+// pageBook.showPage(id);
+// } else {
+// pageBook.removePage(id);
+// pageBook.showPage(emptyKey);
+// }
+// }
+// } else {
+// Object page = getRegisteTaskPage(id);
+// ITaskNodeProvider nodeProvider = (ITaskNodeProvider) ((IEditorPart) page)
+// .getAdapter(ITaskNodeProvider.class);
+// if (nodeProvider != null) {
+// nodeProvider.setTaskType((TaskType) finalModel);
+// }
+// pageBook.showPage(id);
+// }
+// }
+// } else {
+// // pageBook.showEmptyPage();
+// }
+// }
+//
+// });
+// updateGlobalActions();
+// }
protected IEditorSite createSite(IEditorPart editor) {
return new SmooksTaskDetailsEditorSite(this.getEditor(), editor, this);
@@ -1014,16 +1171,22 @@
}
registedTaskPages.clear();
- if (pageBook != null) {
- List<TaskTypeDescriptor> tasks = TaskTypeManager.getAllTaskList();
- for (Iterator<?> iterator = tasks.iterator(); iterator.hasNext();) {
- TaskTypeDescriptor taskTypeDescriptor = (TaskTypeDescriptor) iterator.next();
- pageBook.removePage(taskTypeDescriptor.getId(), true);
+ if (detailsContentsComposite != null) {
+ Control[] controls = detailsContentsComposite.getChildren();
+ for (int i = 0; i < controls.length; i++) {
+ Control c = controls[i];
+ c.dispose();
}
- for (Iterator<String> iterator = smooksModelIdMap.values().iterator(); iterator.hasNext();) {
- String id = (String) iterator.next();
- pageBook.removePage(id, true);
- }
+ detailsControlMap.clear();
+// List<TaskTypeDescriptor> tasks = TaskTypeManager.getAllTaskList();
+// for (Iterator<?> iterator = tasks.iterator(); iterator.hasNext();) {
+// TaskTypeDescriptor taskTypeDescriptor = (TaskTypeDescriptor) iterator.next();
+// pageBook.removePage(taskTypeDescriptor.getId(), true);
+// }
+// for (Iterator<String> iterator = smooksModelIdMap.values().iterator(); iterator.hasNext();) {
+// String id = (String) iterator.next();
+// pageBook.removePage(id, true);
+// }
}
List<TaskTypeDescriptor> tasks = TaskTypeManager.getAllTaskList();
@@ -1034,49 +1197,9 @@
this.registeTaskDetailsPage(part, taskTypeDescriptor.getId());
}
}
-
- // registedTaskPages.clear();
- // Collection<Object> editors = registedTaskPages.values();
- // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();)
- // {
- // Object object = (Object) iterator.next();
- // if (object instanceof ISmooksGraphChangeListener) {
- // ((ISourceSynchronizeListener) object).sourceChange(model);
- // }
- // }
}
- // public void graphChanged(SmooksGraphicsExtType extType) {
- // Collection<Object> editors = registedTaskPages.values();
- // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
- // Object object = (Object) iterator.next();
- // if (object instanceof ISmooksGraphChangeListener) {
- // ((ISmooksGraphChangeListener) object).graphChanged(extType);
- // }
- // }
- // }
- // public void graphPropertyChange(EStructuralFeature featre, Object value)
- // {
- // Collection<Object> editors = registedTaskPages.values();
- // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
- // Object object = (Object) iterator.next();
- // if (object instanceof ISmooksGraphChangeListener) {
- // ((ISmooksGraphChangeListener) object).graphPropertyChange(featre, value);
- // }
- // }
- // }
-
- // public void inputTypeChanged(SmooksGraphicsExtType extType) {
- // Collection<Object> editors = registedTaskPages.values();
- // for (Iterator<?> iterator = editors.iterator(); iterator.hasNext();) {
- // Object object = (Object) iterator.next();
- // if (object instanceof ISmooksGraphChangeListener) {
- // ((ISmooksGraphChangeListener) object).inputTypeChanged(extType);
- // }
- // }
- // }
-
public void propertyChanged(Object source, int propId) {
this.firePropertyChange(propId);
if (propId == PROP_DIRTY) {
@@ -1266,7 +1389,7 @@
private void disposeTaskDetails(Object deleteTask) {
final Object finalModel = deleteTask;
- pageBook.getShell().getDisplay().syncExec(new Runnable() {
+ detailsContentsComposite.getShell().getDisplay().syncExec(new Runnable() {
/*
* (non-Javadoc)
@@ -1284,12 +1407,19 @@
id = id + "_unknown"; //$NON-NLS-1$
}
if (id != null) {
- if (pageBook.hasPage(id)) {
- pageBook.removePage(id);
+ if(detailsControlMap.containsKey(id)){
+ ((Control)detailsControlMap.get(id)).dispose();
+ detailsControlMap.remove(id);
Object registPage = getRegisteTaskPage(id);
removeTaskDetailsPage((IEditorPart) registPage, id);
} else {
}
+// if (pageBook.hasPage(id)) {
+// pageBook.removePage(id);
+// Object registPage = getRegisteTaskPage(id);
+// removeTaskDetailsPage((IEditorPart) registPage, id);
+// } else {
+// }
}
}
} else {
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/autolayout/JavaMappingAutoLayout.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/autolayout/JavaMappingAutoLayout.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/autolayout/JavaMappingAutoLayout.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -64,7 +64,7 @@
input_y = cha;
}
inputNode.y = input_y;
- java_x = inputNode.x + inputNode.width + INPUT_JAVA_WIDTH;
+ java_x = inputNode.x ;
}
for (Iterator<?> iterator = javaNodes.iterator(); iterator.hasNext();) {
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputSourceContainerEditPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputSourceContainerEditPart.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputSourceContainerEditPart.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,91 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.jboss.tools.smooks.gef.common.RootModel;
+import org.jboss.tools.smooks.gef.tree.editpolicy.RootPanelXYLayoutEditPolicy;
+import org.jboss.tools.smooks.gef.tree.editpolicy.SmooksRootEditPartLayoutEditPolicy;
+import org.jboss.tools.smooks.graphical.figures.ContainerFigure;
+import org.jboss.tools.smooks.graphical.figures.SourceContainerFigure;
+
+/**
+ * @author Dart
+ *
+ */
+public class InputSourceContainerEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener{
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure fi = new SourceContainerFigure();
+ fi.setBounds(new Rectangle(10,50,400,300));
+ return fi;
+ }
+
+ @Override
+ public IFigure getContentPane() {
+ return ((ContainerFigure)getFigure()).getContentsPane();
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
+ */
+ @Override
+ public void activate() {
+ ((RootModel)getModel()).addPropertyChangeListener(this);
+ super.activate();
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#deactivate()
+ */
+ @Override
+ public void deactivate() {
+ super.deactivate();
+ ((RootModel)getModel()).removePropertyChangeListener(this);
+ }
+
+ @Override
+ public DragTracker getDragTracker(Request request) {
+ return new RightClickSelectMarqueeDragTraker();
+// return super.getDragTracker(request);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
+ */
+ @Override
+ protected void createEditPolicies() {
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new RootPanelXYLayoutEditPolicy());
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new SmooksRootEditPartLayoutEditPolicy());
+ }
+
+ protected List<?> getModelChildren(){
+ RootModel list = (RootModel) getModel();
+ return list.getChildren();
+ }
+
+
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if(evt.getPropertyName().equals(RootModel.ADD_CHILDREN) || evt.getPropertyName().equals(RootModel.REMOVE_CHILDREN)){
+ this.refreshChildren();
+ }
+ }
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/InputSourceContainerEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/OutputContainerEditPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/OutputContainerEditPart.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/OutputContainerEditPart.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,94 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.editors.editparts;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.jboss.tools.smooks.gef.common.RootModel;
+import org.jboss.tools.smooks.gef.tree.editpolicy.RootPanelXYLayoutEditPolicy;
+import org.jboss.tools.smooks.gef.tree.editpolicy.SmooksRootEditPartLayoutEditPolicy;
+import org.jboss.tools.smooks.graphical.figures.ContainerFigure;
+import org.jboss.tools.smooks.graphical.figures.TargetContainerFigure;
+
+/**
+ * @author Dart
+ *
+ */
+public class OutputContainerEditPart extends AbstractGraphicalEditPart implements PropertyChangeListener{
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure fi = new TargetContainerFigure();
+ fi.setBounds(new Rectangle(500,50,400,300));
+ return fi;
+ }
+
+ @Override
+ public IFigure getContentPane() {
+ return ((ContainerFigure)getFigure()).getContentsPane();
+ }
+
+
+
+ @Override
+ public DragTracker getDragTracker(Request request) {
+ return new RightClickSelectMarqueeDragTraker();
+// return super.getDragTracker(request);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#activate()
+ */
+ @Override
+ public void activate() {
+ ((RootModel)getModel()).addPropertyChangeListener(this);
+ super.activate();
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#deactivate()
+ */
+ @Override
+ public void deactivate() {
+ super.deactivate();
+ ((RootModel)getModel()).removePropertyChangeListener(this);
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
+ */
+ @Override
+ protected void createEditPolicies() {
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new RootPanelXYLayoutEditPolicy());
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new SmooksRootEditPartLayoutEditPolicy());
+ }
+
+ protected List<?> getModelChildren(){
+ RootModel list = (RootModel) getModel();
+ return list.getChildren();
+ }
+
+
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ if(evt.getPropertyName().equals(RootModel.ADD_CHILDREN) || evt.getPropertyName().equals(RootModel.REMOVE_CHILDREN)){
+ this.refreshChildren();
+ }
+ }
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/OutputContainerEditPart.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -90,15 +90,25 @@
public static AbstractSmooksGraphicalModel findSmooksGraphModel(RootModel root, Object object) {
if (root != null && object != null) {
- List<?> children = root.getChildren();
+
+ List<?> rc = root.getChildren();
+ List<AbstractSmooksGraphicalModel> children = new ArrayList();
+ for (Iterator iterator = rc.iterator(); iterator.hasNext();) {
+ Object object2 = (Object) iterator.next();
+ if(object2 instanceof RootModel){
+ children.addAll( ((RootModel)object2).getChildren());
+ }
+ }
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
AbstractSmooksGraphicalModel child = (AbstractSmooksGraphicalModel) iterator.next();
-// if (child instanceof InputDataContianerModel) {
-// continue;
-// }
- AbstractSmooksGraphicalModel model = findGraphicalModel(child, object);
- if (model != null) {
- return model;
+ if(child instanceof RootModel){
+ AbstractSmooksGraphicalModel result = findSmooksGraphModel((RootModel)child, object);
+ if(result != null) return result;
+ }else{
+ AbstractSmooksGraphicalModel model = findGraphicalModel(child, object);
+ if (model != null) {
+ return model;
+ }
}
}
}
@@ -144,7 +154,12 @@
break;
}
}
- List<AbstractSmooksGraphicalModel> children = graphRoot.getChildren();
+ List<AbstractSmooksGraphicalModel> containers = graphRoot.getChildren();
+ List<AbstractSmooksGraphicalModel> children = new ArrayList<AbstractSmooksGraphicalModel>();
+ for (Iterator<?> iterator = containers.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ children.addAll(abstractSmooksGraphicalModel.getChildren());
+ }
if (model != null) {
AbstractSmooksGraphicalModel parentGraph = null;
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
Modified: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2010-06-07 02:12:01 UTC (rev 22593)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksRootEditPart.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.graphical.editors.editparts;
import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.ui.IEditorPart;
@@ -34,7 +35,14 @@
*/
@Override
protected void createEditPolicies() {
- this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new SmooksRootEditPartLayoutEditPolicy());
+ this.installEditPolicy(EditPolicy.LAYOUT_ROLE, new SmooksRootEditPartLayoutEditPolicy(){
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ return null;
+ }
+
+ });
}
protected IEditorPart getEditorPart() {
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputSourceContainerModel.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputSourceContainerModel.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputSourceContainerModel.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,11 @@
+package org.jboss.tools.smooks.graphical.editors.model;
+
+import org.jboss.tools.smooks.gef.common.RootModel;
+
+public class InputSourceContainerModel extends RootModel{
+
+ public InputSourceContainerModel() {
+ super();
+ }
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/InputSourceContainerModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/OutputTargetModel.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/OutputTargetModel.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/OutputTargetModel.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,18 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.editors.model;
+
+import org.jboss.tools.smooks.gef.common.RootModel;
+
+/**
+ * @author Dart
+ *
+ */
+public class OutputTargetModel extends RootModel{
+
+ public OutputTargetModel() {
+ super();
+ }
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/OutputTargetModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerBorder.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerBorder.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerBorder.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,54 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.figures;
+
+import org.eclipse.draw2d.AbstractBorder;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
+
+/**
+ * @author Dart
+ *
+ */
+public class ContainerBorder extends AbstractBorder {
+ protected static Insets insets = new Insets(2,2,2,2);
+ /* (non-Javadoc)
+ * @see org.eclipse.draw2d.Border#getInsets(org.eclipse.draw2d.IFigure)
+ */
+ public Insets getInsets(IFigure figure) {
+ return insets;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.draw2d.Border#paint(org.eclipse.draw2d.IFigure, org.eclipse.draw2d.Graphics, org.eclipse.draw2d.geometry.Insets)
+ */
+ public void paint(IFigure figure, Graphics g, Insets insets) {
+ Rectangle r = figure.getBounds().getCropped(insets);
+
+ g.setForegroundColor(GraphicsConstants.TB_BG_CORLOR);
+ g.setBackgroundColor(GraphicsConstants.TB_BG_CORLOR);
+
+ //Draw the sides of the border
+ g.fillRectangle(r.x, r.y + 2, r.width, 6);
+ g.fillRectangle(r.x, r.bottom() - 8, r.width, 6);
+ g.fillRectangle(r.x, r.y + 2, 6, r.height - 4);
+ g.fillRectangle(r.right() - 6, r.y + 2, 6, r.height - 4);
+
+// //Outline the border
+// g.setForegroundColor(ColorConstants.red);
+// g.drawLine(r.x, r.y + 2, r.right() - 1, r.y + 2);
+// g.drawLine(r.x, r.bottom() - 3, r.right() - 1, r.bottom() - 3);
+// g.drawLine(r.x, r.y + 2, r.x, r.bottom() - 3);
+// g.drawLine(r.right() - 1, r.bottom() - 3, r.right() - 1, r.y + 2);
+//
+// r.crop(new Insets(1, 1, 0, 0));
+// r.expand(1, 1);
+// r.crop(getInsets(figure));
+ }
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerBorder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerFigure.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerFigure.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerFigure.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,59 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.figures;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FreeformLayer;
+import org.eclipse.draw2d.FreeformLayout;
+import org.eclipse.draw2d.FreeformViewport;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ScrollPane;
+import org.eclipse.draw2d.StackLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * @author Dart
+ *
+ */
+public class ContainerFigure extends Figure {
+
+ private FreeformLayer pane;
+
+
+
+ public ContainerFigure() {
+ super();
+ this.setBorder(new ContainerBorder());
+ ScrollPane scrollpane = new ScrollPane();
+ pane = new FreeformLayer();
+ pane.setLayoutManager(new FreeformLayout());
+ setLayoutManager(new StackLayout());
+ add(scrollpane);
+ scrollpane.setViewport(new FreeformViewport());
+ scrollpane.setContents(pane);
+
+ setBackgroundColor(ColorConstants.listBackground);
+ setOpaque(true);
+ }
+
+ public IFigure getContentsPane(){
+ return pane;
+ }
+
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return new Dimension(400,500);
+ }
+
+ protected void paintFigure(Graphics graphics) {
+ Rectangle rect = getBounds().getCopy();
+ rect.crop(new Insets(2,0,2,0));
+ graphics.fillRectangle(rect);
+ }
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/ContainerFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/FillLayout.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/FillLayout.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/FillLayout.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,66 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.figures;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Dart
+ *
+ */
+public class FillLayout extends AbstractLayout {
+
+ private Control canvas;
+
+ public FillLayout(Control canvas) {
+ this.canvas = canvas;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.draw2d.AbstractLayout#calculatePreferredSize(org.eclipse.
+ * draw2d.IFigure, int, int)
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
+ return container.getPreferredSize(wHint, hHint);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.draw2d.LayoutManager#layout(org.eclipse.draw2d.IFigure)
+ */
+ public void layout(IFigure container) {
+ List<?> children = container.getChildren();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ IFigure child = (IFigure) iterator.next();
+
+ Rectangle rect = container.getBounds();// getClientArea(Rectangle.SINGLETON);
+ if (canvas != null) {
+ rect = new Rectangle(canvas.getBounds().x, canvas.getBounds().y, canvas.getBounds().width, canvas.getBounds().height);
+ }
+ int cw = rect.width / 3 ;
+ int ch = rect.height - 60 ;
+ cw = Math.min(cw, 800);
+ ch = Math.min(ch, 800);
+ int x = 30;
+ int y = 30;
+ if (child instanceof TargetContainerFigure) {
+ x = cw*2 - 30;
+ }
+ child.setBounds(new Rectangle(x, y, cw, ch));
+ }
+ }
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/FillLayout.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/SourceContainerFigure.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/SourceContainerFigure.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/SourceContainerFigure.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.figures;
+
+/**
+ * @author Dart
+ *
+ */
+public class SourceContainerFigure extends ContainerFigure {
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/SourceContainerFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/TargetContainerFigure.java
===================================================================
--- workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/TargetContainerFigure.java (rev 0)
+++ workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/TargetContainerFigure.java 2010-06-07 07:46:49 UTC (rev 22594)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.graphical.figures;
+
+/**
+ * @author Dart
+ *
+ */
+public class TargetContainerFigure extends ContainerFigure {
+
+}
Property changes on: workspace/smooks-dmb/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/figures/TargetContainerFigure.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 7 months
JBoss Tools SVN: r22593 - trunk/jmx/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2010-06-06 22:12:01 -0400 (Sun, 06 Jun 2010)
New Revision: 22593
Modified:
trunk/jmx/docs/reference/en-US/introduction.xml
trunk/jmx/docs/reference/en-US/tasks.xml
Log:
updated to correct build errors
Modified: trunk/jmx/docs/reference/en-US/introduction.xml
===================================================================
--- trunk/jmx/docs/reference/en-US/introduction.xml 2010-06-07 02:09:45 UTC (rev 22592)
+++ trunk/jmx/docs/reference/en-US/introduction.xml 2010-06-07 02:12:01 UTC (rev 22593)
@@ -31,8 +31,10 @@
<para>
The JMX technology defines standard connectors (known as JMX connectors) that enable you to access JMX agents from remote management applications. JMX connectors using different protocols provide the same management interface. Consequently, a management application can manage resources transparently, regardless of the communication protocol used. JMX agents can also be used by systems or applications that are not compliant with the JMX specification, as long as those systems or applications support JMX agents.
</para>
+<para>
<ulink
url="http://java.sun.com/docs/books/tutorial/jmx/overview/index.html">Read more about JMX</ulink>.
+</para>
</section>
<section>
Modified: trunk/jmx/docs/reference/en-US/tasks.xml
===================================================================
--- trunk/jmx/docs/reference/en-US/tasks.xml 2010-06-07 02:09:45 UTC (rev 22592)
+++ trunk/jmx/docs/reference/en-US/tasks.xml 2010-06-07 02:12:01 UTC (rev 22593)
@@ -41,7 +41,7 @@
a sample Java application and run the <property>sayHello()</property> method remotely from inside of the <property>MBean Explorer</property>.</para>
<orderedlist>
-http://java.sun.com/docs/books/tutorial/jmx/examples/jmx_examples.zip
+<!-- http://java.sun.com/docs/books/tutorial/jmx/examples/jmx_examples.zip -->
<listitem><para>Save the bundle of JMX API sample classes, <ulink url="http://java.sun.com/docs/books/tutorial/jmx/examples/jmx_examples.zip">jmx_examples.zip</ulink>, to your working directory</para></listitem>
<listitem><para>Unzip the bundle of sample classes.</para></listitem>
14 years, 7 months