JBoss Tools SVN: r23631 - branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 06:05:28 -0400 (Wed, 21 Jul 2010)
New Revision: 23631
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
Log:
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 10:02:54 UTC (rev 23630)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 10:05:28 UTC (rev 23631)
@@ -8,7 +8,8 @@
org.eclipse.core.runtime,
org.eclipse.jface.text,
org.eclipse.core.resources,
- org.eclipse.ui.editors
+ org.eclipse.ui.editors,
+ org.eclipse.ui.forms
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
15 years, 9 months
JBoss Tools SVN: r23630 - in branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration: editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 06:02:54 -0400 (Wed, 21 Jul 2010)
New Revision: 23630
Added:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
Removed:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/GraphicsConstants.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksInputType.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksModelUtils.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksUIUtils.java
Log:
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/GraphicsConstants.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/GraphicsConstants.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/GraphicsConstants.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,115 +0,0 @@
-package org.jboss.tools.smooks.configuration;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.IFormColors;
-
-public final class GraphicsConstants {
-
- public static Color BORDER_CORLOR;
-
- public static Color TB_BG_CORLOR;
-
- public static Color FONT_COLOR ;
-
- static {
- FormColors toolkit = new FormColors(Display.getDefault());
- BORDER_CORLOR = toolkit.getBorderColor();
- TB_BG_CORLOR = toolkit.getColor(IFormColors.TB_BG);
- FONT_COLOR = toolkit.getColor(IFormColors.TITLE);
-// toolkit.dispose();
- }
-
- public static final String IMAGE_JAVA_AMPPING_TASK = "icons/full/obj32/java_mapping_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_DRAG_LINK = "icons/full/obj16/drag_link.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_ADD_TASK_BUTTON = "icons/full/obj16/add_task_button.png"; //$NON-NLS-1$
-
- public static final String IMAGE_LINK16 = "icons/full/obj16/connection16.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_LINK24 = "icons/full/obj16/connection24.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_APPLY_XSL_TASK = "icons/full/obj32/xsl_task.png"; //$NON-NLS-1$
-
- public static final String IMAGE_APPLY_FREEMARKER_TASK = "icons/full/obj32/freemarker_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_INPUT_TASK = "icons/full/obj32/input_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_ATTRIBUTE = "icons/full/obj16/att_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_VALIDATED_TAG = "icons/full/obj16/validated_tag.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PROPERTY_SHEET_PAGE = "icons/full/prop_ps.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_OBJECT = "icons/full/obj16/class_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PACKAGE_OBJECT = "icons/full/obj16/package_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_CHOICE = "icons/full/obj16/xsl_choice.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_TEMPLATE_APPLY = "icons/full/obj16/xsl_template_apply.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_FOREACH = "icons/full/obj16/xsl_foreach.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_SORT = "icons/full/obj16/xsl_sort.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_IF = "icons/full/obj16/xsl_if.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_STYLESHEET = "icons/full/obj16/xsl_stylesheet.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_TEMPLATE = "icons/full/obj16/xsl_template.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_OVR_ERROR = "icons/full/ovr16/error_co.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_OVR_WARING = "icons/full/ovr16/warning_co.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_INTERFACE = "icons/full/obj16/int_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_COLLECTION = "icons/full/obj16/javalistmodel.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_BEAN = "icons/full/obj16/java_bean.png"; //$NON-NLS-1$
-
- public static final String IMAGE_INPUT_DATA_HEADER = "icons/full/obj16/input_data_header.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_ARRAY = "icons/full/obj16/javaarraymodel.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CHECKBOX_CHECK = "icons/full/obj16/checkbox_checked.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CHECKBOX_UNCHECK = "icons/full/obj16/checkbox_uncheck.gif"; //$NON-NLS-1$
-
- public static final String JAVA_PROPERTY_ICON_PATH = IMAGE_JAVA_ATTRIBUTE;
-
- public static final String JAVA_PROPERTY_ICON = JAVA_PROPERTY_ICON_PATH;
-
- public static final String IMAGE_PATH_ERROR = "icons/full/obj16/error_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PATH_WARNING = "icons/full/obj16/warning_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PATH_BLANK = "icons/full/obj16/blank.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_WARNING = IMAGE_PATH_WARNING;
-
- public static final String IMAGE_ERROR = IMAGE_PATH_ERROR;
-
- public static final String IMAGE_EMPTY = IMAGE_PATH_BLANK;
-
- public static final String IMAGE_XML_ELEMENT = "icons/full/obj16/element_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XML_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_MAPPING_LINE = "icons/full/obj16/mapping_line.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_BINDING_LINE = "icons/full/obj16/binding_line.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_UNKNOWN_OBJ = "icons/full/obj16/unknown_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_FILE = "icons/full/obj16/jcu_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CSV_FILE = "icons/full/obj16/csvfile.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XML_FILE = "icons/full/obj16/XMLFile.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSD_FILE = "icons/full/obj16/XSDFile.gif"; //$NON-NLS-1$
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/ProcessNodeType.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.configuration;
-
-/**
- * Configuration process node type enumeration.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public enum ProcessNodeType {
- INPUT_CSV,
- INPUT_EDI,
- INPUT_JSON,
-
- BASE,
- CORE,
- CALC,
- DATASOURCE,
- FIXED_LENGTH,
- JAVA_BINDING,
- PERSISTENCE,
- ROUTING,
- RULES,
- SCRIPTING,
- TEMPLATING,
- VALIDATION,
-}
\ No newline at end of file
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeDependency.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,215 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.configuration;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.milyn.Smooks;
-import org.milyn.SmooksException;
-import org.milyn.container.ExecutionContext;
-import org.milyn.delivery.sax.SAXElement;
-import org.milyn.delivery.sax.SAXVisitBefore;
-
-/**
- * Smooks runtime dependency.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class RuntimeDependency {
-
- /**
- * Smooks runtime versions.
- */
- public static enum SmooksVersion {
- v1_0,
- v1_1,
- v1_2,
- v1_3,
- }
-
- /**
- * The Maven Artfact ID of the Smooks dependency.
- */
- private String artifactId;
- /**
- * The configuration namespace URI for the config..
- */
- private URI namespaceURI;
- /**
- * If the namepsaceURI is unsupported by the editor, this property can contain a change-to/upgrade/downgrade namepsace.
- */
- private URI changeToNS;
- /**
- * Whether or not the configuration is supported by the Editor. Note that this property being 'false' is not the
- * same as saying the config is not supported by the Smooks Runtime (see the 'runtimeVersions' property).
- */
- private boolean supportedByEditor;
- /**
- * The list of Smooks Runtimes that can support this configuration. Note this does not mean
- * the editor can support the configuration (see the 'supportedByEditor' property).
- */
- private List<SmooksVersion> runtimeVersions;
-
- private static final String GROUP_ID = "org.milyn"; //$NON-NLS-1$
- private static final String META_INF = "META-INF"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_CORE = "milyn-smooks-core"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_CSV = "milyn-smooks-csv"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_EDI = "milyn-smooks-edi"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_JSON = "milyn-smooks-json"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_TEMPLATING = "milyn-smooks-templating"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_JAVABEAN = "milyn-smooks-javabean"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_FIXED_LENGTH = "milyn-smooks-fixed-length"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_CALC = "milyn-smooks-calc"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_PERSISTENCE = "milyn-smooks-persistence"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_ROUTING = "milyn-smooks-routing"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_RULES = "milyn-smooks-rules"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_SCRIPTING = "milyn-smooks-scripting"; //$NON-NLS-1$
- private static final String MILYN_SMOOKS_VALIDATION = "milyn-smooks-validation"; //$NON-NLS-1$
-
- private RuntimeDependency(String artifactId, URI namespaceURI, URI changeToNS, boolean supportedByEditor, List<SmooksVersion> runtimeVersions) {
- this.artifactId = artifactId;
- this.namespaceURI = namespaceURI;
- this.changeToNS = changeToNS;
- this.supportedByEditor = supportedByEditor;
- }
-
- public String getGroupId() {
- return GROUP_ID;
- }
- public String getArtifactId() {
- return artifactId;
- }
- public URI getNamespaceURI() {
- return namespaceURI;
- }
- public URI getChangeToNS() {
- return changeToNS;
- }
- public boolean isSupportedByEditor() {
- return supportedByEditor;
- }
- public boolean isSupportedBySmooksVersion(SmooksVersion smooksVersion) {
- return runtimeVersions.contains(smooksVersion);
- }
- public boolean isOnProjectClasspath(ClassLoader projectClassloader) {
- String resourcePath = META_INF + namespaceURI.getPath();
- return (projectClassloader.getResource(resourcePath) != null);
- }
-
- public static void addDependencyChecklist(Smooks metadataExtractor) {
- // Add the supported feature dependency details...
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.BASE, "smooks-1.1.xsd", null, true, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CSV, ProcessNodeType.INPUT_CSV, "smooks/csv-1.2.xsd", null, true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_EDI, ProcessNodeType.INPUT_EDI, "smooks/edi-1.2.xsd", null, true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_JSON, ProcessNodeType.INPUT_JSON, "smooks/json-1.2.xsd", null, true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_TEMPLATING, ProcessNodeType.TEMPLATING, "smooks/freemarker-1.1.xsd", null, true, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/freemarker"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_JAVABEAN, ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.2.xsd", null, true, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/bean"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // Add the unsupported feature dependency details...
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.BASE, "smooks-1.0.xsd", "smooks-1.1.xsd", false, SmooksVersion.v1_0, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CSV, ProcessNodeType.INPUT_CSV, "smooks/csv-1.1.xsd", "smooks/csv-1.2.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CSV, ProcessNodeType.INPUT_CSV, "smooks/csv-1.3.xsd", "smooks/csv-1.2.xsd", false, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_EDI, ProcessNodeType.INPUT_EDI, "smooks/edi-1.1.xsd", "smooks/edi-1.2.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_JSON, ProcessNodeType.INPUT_JSON, "smooks/json-1.1.xsd", "smooks/json-1.2.xsd", false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_FIXED_LENGTH, ProcessNodeType.FIXED_LENGTH, "smooks/fixed-length-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/reader"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/direct"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.DATASOURCE, "smooks/datasource-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/JNDI"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/direct"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.DATASOURCE, "smooks/datasource-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/JNDI"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.CORE, "smooks/core-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/filterSettings"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.CORE, "smooks/core-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/namespaces"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CORE, ProcessNodeType.CORE, "smooks/core-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/terminate"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_TEMPLATING, ProcessNodeType.TEMPLATING, "smooks/xsl-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/xsl"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_JAVABEAN, ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/binding"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_JAVABEAN, ProcessNodeType.JAVA_BINDING, "smooks/javabean-1.3.xsd", null, false, SmooksVersion.v1_3), "/smooks-resource-list/bean"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_CALC, ProcessNodeType.CALC, "smooks/calc-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/counter"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/inserter"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/updater"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/deleter"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/deleter"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/flusher"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_PERSISTENCE, ProcessNodeType.PERSISTENCE, "smooks/persistence-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/locator"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/executor"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/db-routing-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/resultSetRowSelector"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/file-routing-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/outputStream"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/io-routing-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/jms-routing-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_ROUTING, ProcessNodeType.ROUTING, "smooks/jms-routing-1.2.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/router"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_RULES, ProcessNodeType.RULES, "smooks/rules-1.0.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/ruleBases"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_SCRIPTING, ProcessNodeType.SCRIPTING, "smooks/groovy-1.1.xsd", null, false, SmooksVersion.v1_1, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/groovy"); //$NON-NLS-1$ //$NON-NLS-2$
- metadataExtractor.addVisitor(new RuntimeDependencyTracker(MILYN_SMOOKS_VALIDATION, ProcessNodeType.VALIDATION, "smooks/validation-1.0.xsd", null, false, SmooksVersion.v1_2, SmooksVersion.v1_3), "/smooks-resource-list/rule"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static class RuntimeDependencyTracker implements SAXVisitBefore {
-
- private String artifactId;
- private ProcessNodeType nodeType;
- private URI namespaceURI;
- private URI changeToNS;
- /**
- * Whether or not the configuration is supported by the Editor. Note that this property being 'false' is not the
- * same as saying the config is not supported by the Smooks Runtime (see the 'runtimeVersions' property).
- */
- private boolean supportedByEditor;
- /**
- * The list of Smooks Runtimes that can support this configuration. Note this does not mean
- * the editor can support the configuration (see the 'supportedByEditor' property).
- */
- private List<SmooksVersion> runtimeVersions = new ArrayList<SmooksVersion>();
-
- public RuntimeDependencyTracker(String artifactId, ProcessNodeType nodeType, String xsd, String changeToXSD, boolean supportedByEditor, SmooksVersion... runtimeVersions) {
- this.artifactId = artifactId;
- this.nodeType = nodeType;
- this.namespaceURI = URI.create("http://www.milyn.org/xsd/" + xsd); //$NON-NLS-1$
- if(changeToXSD != null) {
- this.changeToNS = URI.create("http://www.milyn.org/xsd/" + changeToXSD); //$NON-NLS-1$
- }
- this.supportedByEditor = supportedByEditor;
- if(runtimeVersions != null) {
- this.runtimeVersions.addAll(Arrays.asList(runtimeVersions));
- }
- }
-
- public void visitBefore(SAXElement configElement, ExecutionContext execContext) throws SmooksException, IOException {
- RuntimeMetadata metadata = (RuntimeMetadata) execContext.getAttribute(RuntimeMetadata.class);
- Set<URI> alreadyProcessed = (Set<URI>) execContext.getAttribute(RuntimeDependencyTracker.class);
-
- metadata.getNodeTypes().add(nodeType);
-
- if(alreadyProcessed == null) {
- alreadyProcessed = new HashSet<URI>();
- execContext.setAttribute(RuntimeDependencyTracker.class, alreadyProcessed);
- }
-
- // If the config namespace hasn't already been added, we need to add it...
- String configNS = configElement.getName().getNamespaceURI();
- if(configNS.equals(namespaceURI.toString()) && !alreadyProcessed.contains(namespaceURI)) {
- metadata.getDependencies().add(new RuntimeDependency(artifactId, namespaceURI, changeToNS, supportedByEditor, runtimeVersions));
- alreadyProcessed.add(namespaceURI);
- }
- }
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,250 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.configuration;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.eclipse.core.resources.IResource;
-import org.milyn.Smooks;
-import org.milyn.SmooksException;
-import org.milyn.container.ExecutionContext;
-import org.milyn.delivery.sax.SAXElement;
-import org.milyn.delivery.sax.SAXVisitAfter;
-import org.milyn.delivery.sax.SAXVisitBefore;
-
-/**
- * Smooks configuration runtime metadata.
- * <p/>
- * Verifies the specified config is a Smooks configuration and extracts metadata
- * from the config e.g. input file, dependencies.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class RuntimeMetadata {
-
- private Smooks metadataExtractor;
- private boolean isSmooksConfig;
- private boolean isValidSmooksConfig;
- private File configFile;
- private String inputType;
- private File inputFile;
- private Set<ProcessNodeType> processNodeTypes = new HashSet<ProcessNodeType>();
- private List<RuntimeDependency> dependencies = new ArrayList<RuntimeDependency>();
-
- public RuntimeMetadata() {
- metadataExtractor = new Smooks();
- metadataExtractor.addVisitor(new SmooksConfigAsserter(), "/smooks-resource-list", //$NON-NLS-1$
- "http://www.milyn.org/xsd/smooks-1.1.xsd"); //$NON-NLS-1$
- metadataExtractor.addVisitor(new InputParamExtractor(), "/smooks-resource-list/params/param", //$NON-NLS-1$
- "http://www.milyn.org/xsd/smooks-1.1.xsd"); //$NON-NLS-1$
-
- // Build dependency map...
- RuntimeDependency.addDependencyChecklist(metadataExtractor);
- }
-
- public boolean isSmooksConfig() {
- return isSmooksConfig;
- }
-
- public boolean isValidSmooksConfig() {
- return isValidSmooksConfig;
- }
-
- public String getErrorMessage() {
- if (isValidSmooksConfig) {
- throw new IllegalStateException(
- Messages.RuntimeMetadata_Error_Invalid_GetErrorMessage_Call);
- }
-
- if (configFile == null) {
- return Messages.RuntimeMetadata_Error_SmooksFile_Does_Not_Exist;
- } else if (!configFile.exists()) {
- return Messages.RuntimeMetadata_Error_SmooksFile_Not_Found;
- } else if (!configFile.isFile()) {
- return Messages.RuntimeMetadata_Error_SmooksFile_Not_Readable;
- } else if (!isSmooksConfig) {
- return Messages.RuntimeMetadata_Error_SmooksFile_Not_Valid;
- } else if (inputFile == null) {
- return Messages.RuntimeMetadata_Error_Input_Task_No_Input_File;
- } else if (!inputFile.exists()) {
- return Messages.RuntimeMetadata_Error_Input_Task_Input_File_Not_Found;
- } else if (!inputFile.isFile()) {
- return Messages.RuntimeMetadata_Error_Input_Task_Input_File_Cannot_Be_Read;
- }
-
- return ""; //$NON-NLS-1$
- }
-
- public File getConfigFile() {
- return configFile;
- }
-
- public String getInputType() {
- return inputType;
- }
-
- public File getInputFile() {
- return inputFile;
- }
-
- public List<RuntimeDependency> getDependencies() {
- return dependencies;
- }
-
- public Set<ProcessNodeType> getNodeTypes() {
- return processNodeTypes;
- }
-
- public String getNodeTypesString() {
- StringBuilder builder = new StringBuilder();
- for (ProcessNodeType nodeType : processNodeTypes) {
- if (builder.length() > 0) {
- builder.append(',');
- }
- builder.append(nodeType.toString());
- }
- return builder.toString();
- }
-
- public void setSmooksConfig(IResource smooksConfig) {
- reset();
-
- if (smooksConfig != null) {
- setSmooksConfig(new File(smooksConfig.getRawLocation().toOSString().trim()));
- }
- }
-
- public void setSmooksConfig(File file) {
- reset();
-
- if (file != null) {
- configFile = file;
- if (configFile.exists() && configFile.isFile()) {
- try {
- digestSmooksConfig(new FileInputStream(configFile));
- } catch (Exception e) {
- // Not a valid Smooks config file
- }
- }
- }
- }
-
- public void setSmooksConfig(File file, InputStream inputStream) {
- if (inputStream == null) {
- setSmooksConfig(file);
- } else {
- configFile = file;
- if (configFile.exists() && configFile.isFile()) {
- digestSmooksConfig(inputStream);
- }
- }
- }
-
- private void digestSmooksConfig(InputStream inputStream) {
- ExecutionContext execContext = metadataExtractor.createExecutionContext();
- Properties inputParams = new Properties();
-
- try {
- // Filter the config and capture the input params...
- execContext.setAttribute(InputParamExtractor.class, inputParams);
- execContext.setAttribute(RuntimeMetadata.class, this);
-
- metadataExtractor.filterSource(execContext, new StreamSource(inputStream));
-
- inputType = inputParams.getProperty(SmooksModelUtils.INPUT_TYPE);
- if (inputType != null) {
- String inputPath = inputParams.getProperty(inputType);
- if (inputPath != null) {
- String resolvedFilePath;
- try {
- resolvedFilePath = SmooksUIUtils.parseFilePath(inputPath.trim());
- } catch (Exception e) {
- // It's not a valid config...
- inputFile = new File(inputPath.trim());
- return;
- }
-
- inputFile = new File(resolvedFilePath);
- if (inputFile.exists() && inputFile.isFile()) {
- isValidSmooksConfig = true;
- }
- }
- }
- } catch (Exception e) {
- // Not a valid Smooks config file
- }
- }
-
-
- private void reset() {
- isSmooksConfig = false;
- isValidSmooksConfig = false;
- configFile = null;
- inputType = null;
- inputFile = null;
- processNodeTypes.clear();
- }
-
- private static class SmooksConfigAsserter implements SAXVisitBefore {
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException,
- IOException {
- RuntimeMetadata metadata = (RuntimeMetadata) execContext.getAttribute(RuntimeMetadata.class);
- metadata.isSmooksConfig = true;
- }
- }
-
- private static class InputParamExtractor implements SAXVisitBefore, SAXVisitAfter {
-
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws SmooksException,
- IOException {
- paramElement.accumulateText();
- }
-
- public void visitAfter(SAXElement paramElement, ExecutionContext execContext) throws SmooksException,
- IOException {
- Properties inputParams = (Properties) execContext.getAttribute(InputParamExtractor.class);
-
- if (inputParams != null) {
- String paramName = paramElement.getAttribute("name"); //$NON-NLS-1$
-
- if (paramName != null) {
- if (paramName.equals(SmooksModelUtils.INPUT_TYPE)) {
- inputParams.setProperty(SmooksModelUtils.INPUT_TYPE, paramElement.getTextContent());
- } else {
- String paramType = paramElement.getAttribute("type"); //$NON-NLS-1$
- if (paramType != null && paramType.equals(SmooksModelUtils.INPUT_ACTIVE_TYPE)) {
- inputParams.setProperty(paramName, paramElement.getTextContent());
- }
- }
- }
- }
- }
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksConstants.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration;
-
-/**
- * @author Dart Peng (dpeng(a)redhat.com)
- * Date Apr 1, 2009
- */
-public class SmooksConstants {
- public static final String SMOOKS_EXTENTION_NAME = "xml"; //$NON-NLS-1$
-
- public static final String SMOOKS_GRAPHICSEXT_EXTENTION_NAME = "ext"; //$NON-NLS-1$
-
- public static final String SMOOKS_EXTENTION_NAME_WITHDOT = "." + SMOOKS_EXTENTION_NAME; //$NON-NLS-1$
-
- public static final String SMOOKS_GRAPHICSEXT_EXTENTION_NAME_WITHDOT = "." + SMOOKS_GRAPHICSEXT_EXTENTION_NAME; //$NON-NLS-1$
-
-// public static final String VERSION_1_1 = "1.1"; //$NON-NLS-1$
-
- public static final String VERSION_1_2 = "1.2"; //$NON-NLS-1$
-
- public static final String[] SMOOKS_VERSIONS = new String[]{VERSION_1_2};
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksInputType.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksInputType.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksInputType.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.configuration;
-
-/**
- * Smooks Input Type Enumeration.
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksInputType {
-
- public static final String INPUT_TYPE_JAVA = "input.java"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_CUSTOM = "input.custom"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_JSON = "input.json"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_CSV = "input.csv"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_XML = "input.xml"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_XSD = "input.xsd"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_EDI = "input.edi"; //$NON-NLS-1$
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksModelUtils.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksModelUtils.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksModelUtils.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.configuration;
-
-/**
- * @author Dart Peng
- *
- */
-
-public class SmooksModelUtils {
-
- public static final String KEY_TEMPLATE_TYPE = "messageType"; //$NON-NLS-1$
-
- public static final String FREEMARKER_TEMPLATE_TYPE_CSV = "CSV"; //$NON-NLS-1$
-
- public static final String FREEMARKER_TEMPLATE_TYPE_XML = "XML"; //$NON-NLS-1$
-
- public static final String KEY_CSV_FIELDS = "csvFields"; //$NON-NLS-1$
-
- public static final String KEY_INCLUDE_FIELD_NAMES = "includeFieldNames"; //$NON-NLS-1$
-
- public static final String KEY_TASK_ID_REF = "idref"; //$NON-NLS-1$
-
- public static final String KEY_OBJECT_ID = "id"; //$NON-NLS-1$
-
- public static final String KEY_XML_FILE_TYPE = "modelSrcType"; //$NON-NLS-1$
-
- public static final String KEY_XML_FILE_PATH = "modelSrc"; //$NON-NLS-1$
-
- public static final String KEY_XML_ROOT_NAME = "rootElementName"; //$NON-NLS-1$
-
- public static final String KEY_XML_FILE_TYPE_XSD = "XSD"; //$NON-NLS-1$
-
- public static final String KEY_XML_FILE_TYPE_XML = "XML"; //$NON-NLS-1$
-
- public static final String KEY_CSV_SEPERATOR = "seperator"; //$NON-NLS-1$
-
- public static final String KEY_CSV_QUOTE = "quote"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_JAVA = SmooksInputType.INPUT_TYPE_JAVA;
-
- public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_CUSTOME = SmooksInputType.INPUT_TYPE_CUSTOM;
-
- public static final String INPUT_TYPE_JSON_1_1 = SmooksInputType.INPUT_TYPE_JSON;
-
- public static final String INPUT_TYPE_CSV = SmooksInputType.INPUT_TYPE_CSV;
-
- public static final String INPUT_ACTIVE_TYPE = "input.type.actived"; //$NON-NLS-1$
-
- public static final String INPUT_DEACTIVE_TYPE = "input.type.deactived"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_CSV_1_2 = SmooksInputType.INPUT_TYPE_CSV;
-
- public static final String PARAM_NAME_CLASS = "class"; //$NON-NLS-1$
-
- public static final String PARAM_NAME_PATH = "path"; //$NON-NLS-1$
-
- public static final String PARAM_NAME_ACTIVED = "actived"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_XML = SmooksInputType.INPUT_TYPE_XML;
-
- public static final String INPUT_TYPE_XSD = SmooksInputType.INPUT_TYPE_XSD;
-
- public static final String TYPE_XSL = "xsl"; //$NON-NLS-1$
-
- public static final String[] TEMPLATE_TYPES = new String[] { "xsl", "ftl" }; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String BEAN_CLASS = "beanClass"; //$NON-NLS-1$
-
- public static final String BEAN_ID = "beanId"; //$NON-NLS-1$
-
- public static final String BINDINGS = "bindings"; //$NON-NLS-1$
-
- public static final String INPUT_TYPE_EDI_1_1 = SmooksInputType.INPUT_TYPE_EDI;
-
- public static final String INPUT_TYPE_EDI_1_2 = SmooksInputType.INPUT_TYPE_EDI;
-
- public static final String INPUT_TYPE_JSON_1_2 = SmooksInputType.INPUT_TYPE_JSON;
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksUIUtils.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksUIUtils.java 2010-07-21 09:51:36 UTC (rev 23629)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/SmooksUIUtils.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-
-/**
- *
- * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
- */
-public class SmooksUIUtils {
-
- public static String[] SMOOKS_PLATFORM_1_1_CONFLICT_NAMESPACES = new String[] {};
-
- public static final String FILE_PRIX = "File:/"; //$NON-NLS-1$
-
- public static final String WORKSPACE_PRIX = "Workspace:/"; //$NON-NLS-1$
-
- public static final String RESOURCE = "Resource:/"; //$NON-NLS-1$
-
- public static final String XSL_NAMESPACE = " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "; //$NON-NLS-1$
-
- public static int VALUE_TYPE_VALUE = 1;
-
- public static int VALUE_TYPE_TEXT = 2;
-
- public static int VALUE_TYPE_COMMENT = 3;
-
- public static int VALUE_TYPE_CDATA = 0;
-
- public static final int SELECTOR_EXPAND_MAX_LEVEL = 5;
-
- public static final String[] SELECTOR_SPERATORS = new String[] { " ", "/" }; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static String parseFilePath(String path) throws InvocationTargetException {
- if (path == null)
- return null;
- if (new File(path).exists()) {
- return path;
- }
- int index = path.indexOf(FILE_PRIX);
- if (index != -1) {
- path = path.substring(index + FILE_PRIX.length(), path.length());
- } else {
- index = path.indexOf(WORKSPACE_PRIX);
- if (index != -1) {
- path = path.substring(index + WORKSPACE_PRIX.length(), path.length());
- Path wpath = new Path(path);
- IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(wpath);
- if (file.exists()) {
- path = file.getLocation().toOSString();
- } else {
- throw new InvocationTargetException(new Exception("File : " + path + " isn't exsit")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- } else {
- throw new InvocationTargetException(new Exception("This path is un-support" + path + ".")); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- return path;
- }
-}
Added: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java (rev 0)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java 2010-07-21 10:02:54 UTC (rev 23630)
@@ -0,0 +1,115 @@
+package org.jboss.tools.smooks.configuration.editors;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
+
+public final class GraphicsConstants {
+
+ public static Color BORDER_CORLOR;
+
+ public static Color TB_BG_CORLOR;
+
+ public static Color FONT_COLOR ;
+
+ static {
+ FormColors toolkit = new FormColors(Display.getDefault());
+ BORDER_CORLOR = toolkit.getBorderColor();
+ TB_BG_CORLOR = toolkit.getColor(IFormColors.TB_BG);
+ FONT_COLOR = toolkit.getColor(IFormColors.TITLE);
+// toolkit.dispose();
+ }
+
+ public static final String IMAGE_JAVA_AMPPING_TASK = "icons/full/obj32/java_mapping_task.jpg"; //$NON-NLS-1$
+
+ public static final String IMAGE_DRAG_LINK = "icons/full/obj16/drag_link.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_ADD_TASK_BUTTON = "icons/full/obj16/add_task_button.png"; //$NON-NLS-1$
+
+ public static final String IMAGE_LINK16 = "icons/full/obj16/connection16.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_LINK24 = "icons/full/obj16/connection24.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_APPLY_XSL_TASK = "icons/full/obj32/xsl_task.png"; //$NON-NLS-1$
+
+ public static final String IMAGE_APPLY_FREEMARKER_TASK = "icons/full/obj32/freemarker_task.jpg"; //$NON-NLS-1$
+
+ public static final String IMAGE_INPUT_TASK = "icons/full/obj32/input_task.jpg"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_ATTRIBUTE = "icons/full/obj16/att_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_VALIDATED_TAG = "icons/full/obj16/validated_tag.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_PROPERTY_SHEET_PAGE = "icons/full/prop_ps.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_OBJECT = "icons/full/obj16/class_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_PACKAGE_OBJECT = "icons/full/obj16/package_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_CHOICE = "icons/full/obj16/xsl_choice.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_TEMPLATE_APPLY = "icons/full/obj16/xsl_template_apply.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_FOREACH = "icons/full/obj16/xsl_foreach.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_SORT = "icons/full/obj16/xsl_sort.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_IF = "icons/full/obj16/xsl_if.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_STYLESHEET = "icons/full/obj16/xsl_stylesheet.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSL_TEMPLATE = "icons/full/obj16/xsl_template.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_OVR_ERROR = "icons/full/ovr16/error_co.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_OVR_WARING = "icons/full/ovr16/warning_co.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_INTERFACE = "icons/full/obj16/int_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_COLLECTION = "icons/full/obj16/javalistmodel.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_BEAN = "icons/full/obj16/java_bean.png"; //$NON-NLS-1$
+
+ public static final String IMAGE_INPUT_DATA_HEADER = "icons/full/obj16/input_data_header.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_ARRAY = "icons/full/obj16/javaarraymodel.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_CHECKBOX_CHECK = "icons/full/obj16/checkbox_checked.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_CHECKBOX_UNCHECK = "icons/full/obj16/checkbox_uncheck.gif"; //$NON-NLS-1$
+
+ public static final String JAVA_PROPERTY_ICON_PATH = IMAGE_JAVA_ATTRIBUTE;
+
+ public static final String JAVA_PROPERTY_ICON = JAVA_PROPERTY_ICON_PATH;
+
+ public static final String IMAGE_PATH_ERROR = "icons/full/obj16/error_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_PATH_WARNING = "icons/full/obj16/warning_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_PATH_BLANK = "icons/full/obj16/blank.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_WARNING = IMAGE_PATH_WARNING;
+
+ public static final String IMAGE_ERROR = IMAGE_PATH_ERROR;
+
+ public static final String IMAGE_EMPTY = IMAGE_PATH_BLANK;
+
+ public static final String IMAGE_XML_ELEMENT = "icons/full/obj16/element_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XML_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_MAPPING_LINE = "icons/full/obj16/mapping_line.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_BINDING_LINE = "icons/full/obj16/binding_line.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_UNKNOWN_OBJ = "icons/full/obj16/unknown_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_JAVA_FILE = "icons/full/obj16/jcu_obj.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_CSV_FILE = "icons/full/obj16/csvfile.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XML_FILE = "icons/full/obj16/XMLFile.gif"; //$NON-NLS-1$
+
+ public static final String IMAGE_XSD_FILE = "icons/full/obj16/XSDFile.gif"; //$NON-NLS-1$
+}
Property changes on: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months
JBoss Tools SVN: r23629 - branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 05:51:36 -0400 (Wed, 21 Jul 2010)
New Revision: 23629
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
Log:
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 09:46:58 UTC (rev 23628)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 09:51:36 UTC (rev 23629)
@@ -14,12 +14,3 @@
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Bundle-ClassPath: .
-Export-Package: org.jboss.tools.smooks.configuration,
- org.jboss.tools.smooks.configuration.editors.uitls,
- org.jboss.tools.smooks.configuration.editors.xml,
- org.jboss.tools.smooks.editor,
- org.jboss.tools.smooks.gef.tree.figures,
- org.jboss.tools.smooks.graphical.editors,
- org.jboss.tools.smooks.graphical.editors.process,
- org.jboss.tools.smooks.launch,
- org.jboss.tools.smooks.launch.serialize
15 years, 9 months
JBoss Tools SVN: r23628 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: resources/tck/tests/jbt/validation/annotations/stereotype and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 05:46:58 -0400 (Wed, 21 Jul 2010)
New Revision: 23628
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java
Modified:
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-6642
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java 2010-07-21 09:46:58 UTC (rev 23628)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.annotations.stereotype.broken;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Target( { TYPE, METHOD, FIELD })
+@ApplicationScoped
+@Named
+@interface FishStereotype_MissingRetention {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java 2010-07-21 09:46:58 UTC (rev 23628)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.annotations.stereotype.broken;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Retention(RUNTIME)
+@ApplicationScoped
+@Named
+@interface FishStereotype_MissingTarget {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java 2010-07-21 09:46:58 UTC (rev 23628)
@@ -0,0 +1,21 @@
+package org.jboss.jsr299.tck.tests.jbt.validation.annotations.stereotype.broken;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Stereotype;
+import javax.inject.Named;
+
+@Stereotype
+@Target( { TYPE, FIELD })
+@Retention(RUNTIME)
+@ApplicationScoped
+@Named
+@interface FishStereotype_WrongTarget {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-07-21 09:45:59 UTC (rev 23627)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/ValidationTest.java 2010-07-21 09:46:58 UTC (rev 23628)
@@ -1406,6 +1406,21 @@
assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE.substring(0, 56) + ".*", 32);
}
+ public void testStereotypeWithMissingTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
+ }
+
+ public void testStereotypeWithMissingRetention() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_MissingRetention.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, 19);
+ }
+
+ public void testStereotypeWithWrongTarget() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/validation/annotations/stereotype/broken/FishStereotype_WrongTarget.java");
+ assertMarkerIsCreated(file, CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, 15);
+ }
+
/**
* 10.4.3. Conditional observer methods
* - bean with scope @Dependent has an observer method declared notifyObserver=IF_EXISTS
15 years, 9 months
JBoss Tools SVN: r23627 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 05:45:59 -0400 (Wed, 21 Jul 2010)
New Revision: 23627
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/CDIPreferencesMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6642
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-07-21 09:45:52 UTC (rev 23626)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIConfigurationBlock.java 2010-07-21 09:45:59 UTC (rev 23627)
@@ -57,6 +57,8 @@
{CDIPreferences.MISSING_NONBINDING_IN_INTERCEPTOR_BINDING_TYPE_MEMBER, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingNonbindingInInterceptorBindingTypeMember_label},
{CDIPreferences.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInQualifierType_label},
{CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInQualifierType_label},
+ {CDIPreferences.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInStereotypeType_label},
+ {CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, CDIPreferencesMessages.CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInStereotypeType_label},
},
CDICorePlugin.PLUGIN_ID
);
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-07-21 09:45:52 UTC (rev 23626)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.java 2010-07-21 09:45:59 UTC (rev 23627)
@@ -57,6 +57,8 @@
public static String CDIValidatorConfigurationBlock_pb_missingNonbindingInInterceptorBindingTypeMember_label;
public static String CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInQualifierType_label;
public static String CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInQualifierType_label;
+ public static String CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInStereotypeType_label;
+ public static String CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInStereotypeType_label;
// Scope
public static String CDIValidatorConfigurationBlock_section_scope;
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-07-21 09:45:52 UTC (rev 23626)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/preferences/CDIPreferencesMessages.properties 2010-07-21 09:45:59 UTC (rev 23627)
@@ -44,8 +44,10 @@
CDIValidatorConfigurationBlock_pb_stereotypeIsAnnotatedTyped_label=Stereotype has @Typed:
CDIValidatorConfigurationBlock_pb_missingNonbindingInQualifierTypeMember_label=Missing @Nonbinding in qualifier type member:
CDIValidatorConfigurationBlock_pb_missingNonbindingInInterceptorBindingTypeMember_label=Missing @Nonbinding in interceptor binding type member:
-CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInQualifierType_label=Missing @Target({METHOD, FIELD, PARAMETER, TYPE}) annutation in qualifier annotation type
-CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInQualifierType_label=Missing @Retention(RUNTIME) annutation in qualifier annotation type
+CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInQualifierType_label=Missing or incorrect @Target annotation in qualifier:
+CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInQualifierType_label=Missing @Retention(RUNTIME) annotation in qualifier:
+CDIValidatorConfigurationBlock_pb_missingTargetAnnotationInStereotypeType_label=Missing or incorrect @Target annotation in stereotype:
+CDIValidatorConfigurationBlock_pb_missingRetentionAnnotationInStereotypeType_label=Missing @Retention(RUNTIME) annotation in stereotype:
##Scope
CDIValidatorConfigurationBlock_section_scope=Scope
15 years, 9 months
JBoss Tools SVN: r23626 - in branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-07-21 05:45:52 -0400 (Wed, 21 Jul 2010)
New Revision: 23626
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/plugin.xml
Log:
Pelling back all dependecies etc
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 09:45:17 UTC (rev 23625)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2010-07-21 09:45:52 UTC (rev 23626)
@@ -8,33 +8,7 @@
org.eclipse.core.runtime,
org.eclipse.jface.text,
org.eclipse.core.resources,
- org.eclipse.ui.editors,
- org.eclipse.ui.ide,
- org.eclipse.ui.forms,
- org.eclipse.wst.sse.core,
- org.eclipse.wst.sse.ui,
- org.eclipse.jdt.core,
- org.eclipse.jdt.ui,
- org.eclipse.wst.validation,
- org.eclipse.xsd,
- org.eclipse.wst.wsdl,
- org.apache.xerces,
- javax.wsdl,
- org.jboss.tools.smooks.runtime,
- org.jboss.tools.smooks.templating,
- org.eclipse.gef,
- org.eclipse.jdt.launching,
- org.eclipse.core.filesystem,
- org.eclipse.ui.views.properties.tabbed,
- org.eclipse.wst.xsl.core,
- org.eclipse.zest.core,
- org.eclipse.zest.layouts,
- org.eclipse.debug.core,
- org.eclipse.debug.ui,
- org.eclipse.jdt.debug.ui,
- org.eclipse.jdt.junit,
- org.eclipse.ui.console,
- org.jboss.tools.smooks.model;bundle-version="1.1.0"
+ org.eclipse.ui.editors
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/plugin.xml 2010-07-21 09:45:17 UTC (rev 23625)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/plugin.xml 2010-07-21 09:45:52 UTC (rev 23626)
@@ -2,250 +2,7 @@
<?eclipse version="3.4"?>
<plugin>
- <extension
- point="org.eclipse.ui.editors">
- <editor
- class="org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor"
- contributorClass="org.jboss.tools.smooks.configuration.editors.SmooksMultiPageEditorContributor"
- icon="icons/smooks-sm.gif"
- id="org.jboss.tools.smooks.configuration.editors.MultiPageEditor"
- name="Smooks Configuration Editor">
- <contentTypeBinding
- contentTypeId="org.jboss.tools.smooks.ui.smooks.contentType">
- </contentTypeBinding>
- </editor>
-
- </extension>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
- name="Smooks"
- id="org.jboss.tools.smooks.configuration">
- </category>
- <wizard
- name="Smooks Configuration File"
- icon="icons/smooks-sm.gif"
- category="org.jboss.tools.smooks.configuration"
- class="org.jboss.tools.smooks.configuration.wizards.SmooksConfigurationFileNewWizard"
- id="org.jboss.tools.smooks.configuration.wizards.NewConfigurationFileWizard">
- </wizard>
- </extension>
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
- <content-type
- base-type="org.eclipse.core.runtime.xml"
- describer="org.jboss.tools.smooks.configuration.editors.SmooksConfigfileContentDescriber"
- file-extensions="xml"
- id="org.jboss.tools.smooks.ui.smooks.contentType"
- name="Smooks Configuration File"
- priority="low">
- </content-type>
-
- </extension>
- <extension
- point="org.eclipse.ui.decorators">
- <decorator
- adaptable="false"
- class="org.jboss.tools.smooks.configuration.validate.ValidateResultLabelDecorator"
- id="org.jboss.tools.smooks.ui.configurationPage.decorator"
- label="Smooks Configuration Page Viewer Decorator"
- lightweight="true"
- state="false">
- <description>
- Decorate smooks configuration page viewer
- </description>
- <enablement>
- <or>
- <objectClass
- name="org.eclipse.emf.edit.provider.IWrapperItemProvider">
- </objectClass>
- <objectClass
- name="org.jboss.tools.smooks.model.common.AbstractAnyType">
- </objectClass>
- <objectClass
- name="org.eclipse.emf.ecore.util.FeatureMap$Entry">
- </objectClass>
- <objectClass
- name="org.eclipse.emf.ecore.EObject">
- </objectClass>
- </or>
- </enablement>
- </decorator>
- </extension>
- <extension
- id="problem"
- name="Smooks Problem"
- point="org.eclipse.core.resources.markers">
- <persistent
- value="true">
- </persistent>
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <attribute
- name="uri">
- </attribute>
- </extension>
- <extension
- id="org.jboss.tools.smooks.configuration.validator"
- name="Smooks File Validator"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.jboss.tools.smooks.configuration.validate.SmooksModelValidator"
- manual="true"
- version="1">
- <include>
- <rules>
- <contentType
- exactMatch="true"
- id="org.jboss.tools.smooks.ui.smooks.contentType">
- </contentType>
- </rules>
- </include>
- </validator>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections
- contributorId="org.jboss.tools.smooks.configuration.editors.MultiPageEditor">
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.SmooksPropertySection"
- filter="org.jboss.tools.smooks.editor.propertySections.SmooksPropertySectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.properties"
- tab="org.jboss.tools.smooks.ui.propertySection.propertiesTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.ValidationSection"
- filter="org.jboss.tools.smooks.editor.propertySections.ValidationSectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.validation"
- tab="org.jboss.tools.smooks.ui.propertySection.validationTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.RuleBaseSection"
- filter="org.jboss.tools.smooks.editor.propertySections.RuleBaseSectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.ruleBases"
- tab="org.jboss.tools.smooks.ui.propertySection.ruleBasesTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.ValueDecodeParamSection"
- filter="org.jboss.tools.smooks.editor.propertySections.ValueDecodeParamSectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.decodeParam"
- tab="org.jboss.tools.smooks.ui.propertySection.decodeParamTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.CSVRecordSection"
- filter="org.jboss.tools.smooks.editor.propertySections.CSVRecordSectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.csvrecord"
- tab="org.jboss.tools.smooks.ui.propertySection.csvrecordTab">
- </propertySection>
- <propertySection
- class="org.jboss.tools.smooks.editor.propertySections.JavaMappingPathSection"
- filter="org.jboss.tools.smooks.editor.propertySections.JavaMappingPathSectionFilter"
- id="org.jboss.tools.smooks.ui.propertySection.mappingPath"
- tab="org.jboss.tools.smooks.ui.propertySection.mappingPathTab">
- </propertySection>
- </propertySections>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
- <propertyTabs
- contributorId="org.jboss.tools.smooks.configuration.editors.MultiPageEditor">
- <propertyTab
- afterTab="org.jboss.tools.smooks.ui.propertySection.decodeParamTab"
- category="properties"
- id="org.jboss.tools.smooks.ui.propertySection.propertiesTab"
- label="Properties">
- </propertyTab>
- <propertyTab
- afterTab="org.jboss.tools.smooks.ui.propertySection.ruleBasesTab"
- category="validation"
- id="org.jboss.tools.smooks.ui.propertySection.validationTab"
- label="Validation">
- </propertyTab>
- <propertyTab
- category="validation"
- id="org.jboss.tools.smooks.ui.propertySection.ruleBasesTab"
- label="Rule Bases">
- </propertyTab>
- <propertyTab
- afterTab="org.jboss.tools.smooks.ui.propertySection.csvrecordTab"
- category="properties"
- id="org.jboss.tools.smooks.ui.propertySection.decodeParamTab"
- label="Decode">
- </propertyTab>
- <propertyTab
- category="properties"
- id="org.jboss.tools.smooks.ui.propertySection.csvrecordTab"
- label="CSV Record Properties">
- </propertyTab>
- <propertyTab
- afterTab="org.jboss.tools.smooks.ui.propertySection.decodeParamTab"
- category="properties"
- id="org.jboss.tools.smooks.ui.propertySection.mappingPathTab"
- label="Mapping Path">
- </propertyTab>
- </propertyTabs>
- </extension>
- <extension
- point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
- <propertyContributor
- contributorId="org.jboss.tools.smooks.configuration.editors.MultiPageEditor">
- <propertyCategory
- category="properties"></propertyCategory>
- <propertyCategory
- category="validation">
- </propertyCategory>
- </propertyContributor>
- </extension>
- <extension
- point="org.eclipse.debug.core.launchConfigurationTypes">
- <launchConfigurationType
- name="Smooks Configuration"
- delegate="org.jboss.tools.smooks.launch.SmooksLaunchConfigurationDelegate"
- modes="run"
- id="org.jboss.tools.smooks.ui.smooksLauncher">
- </launchConfigurationType>
- </extension>
- <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
- <launchConfigurationTypeImage
- icon="icons/smooks-sm.gif"
- configTypeID="org.jboss.tools.smooks.ui.smooksLauncher"
- id="org.jboss.tools.smooks.ui.launchConfigurationTypeImage.smooksLauncher">
- </launchConfigurationTypeImage>
- </extension>
- <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
- <launchConfigurationTabGroup
- type="org.jboss.tools.smooks.ui.smooksLauncher"
- class="org.jboss.tools.smooks.launch.SmooksLaunchTabGroup"
- id="org.jboss.tools.smooks.ui.launchConfigurationTabGroup.smooksLauncher">
- </launchConfigurationTabGroup>
- </extension>
- <extension
- point="org.eclipse.debug.ui.launchShortcuts">
- <shortcut
- class="org.jboss.tools.smooks.launch.SmooksLaunchShortcut"
- icon="icons/smooks-sm.gif"
- id="org.jboss.tools.smooks.ui.launch.shortcut"
- label="%launch.shortcut.text"
- modes="run">
- <configurationType
- id="org.jboss.tools.smooks.ui.smooksLauncher">
- </configurationType>
- <contextualLaunch>
- <enablement>
- <with variable="selection">
- <count value="1"/>
- <iterate>
- <test property="org.eclipse.debug.ui.matchesPattern" value="*.xml"/>
- </iterate>
- </with>
- </enablement>
- </contextualLaunch>
- </shortcut>
-
- </extension>
</plugin>
15 years, 9 months
JBoss Tools SVN: r23625 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-21 05:45:17 -0400 (Wed, 21 Jul 2010)
New Revision: 23625
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/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/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-6642
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-07-21 09:12:07 UTC (rev 23624)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/preferences/CDIPreferences.java 2010-07-21 09:45:17 UTC (rev 23625)
@@ -80,7 +80,10 @@
public static final String MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE = INSTANCE.createSeverityOption("missingTargetAnnotationInQualifierType"); //$NON-NLS-1$
public static final String MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE = INSTANCE.createSeverityOption("missingRetentionAnnotationInQualifierType"); //$NON-NLS-1$
-
+
+ public static final String MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE = INSTANCE.createSeverityOption("missingTargetAnnotationInStereotypeType"); //$NON-NLS-1$
+ public static final String MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE = INSTANCE.createSeverityOption("missingRetentionAnnotationInStereotypeType"); //$NON-NLS-1$
+
//Scope group
// - bean class or producer method or field specifies multiple scope type annotations (2.4.3)
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-07-21 09:12:07 UTC (rev 23624)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-07-21 09:45:17 UTC (rev 23625)
@@ -1789,8 +1789,95 @@
addError(CDIValidationMessages.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, CDIPreferences.STEREOTYPE_DECLARES_MORE_THAN_ONE_SCOPE, scope, stereotype.getResource());
}
}
+
+ try {
+ validateStereotypeAnnotationTypeAnnotations(stereotype, resource);
+ } catch (JavaModelException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
}
+ private void validateStereotypeAnnotationTypeAnnotations(IStereotype stereotype, IResource resource) throws JavaModelException {
+ /*
+ * Stereotype annotation type should be annotated with @Target with correct targets [JSR-299 §2.7.1]
+ * Stereotype annotation type should be annotated with @Retention(RUNTIME)
+ */
+ IAnnotationDeclaration target = stereotype.getAnnotationDeclaration(CDIConstants.TARGET_ANNOTATION_TYPE_NAME);
+ if(target == null) {
+ addError(CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, CDIPreferences.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, CDIUtil.convertToSourceReference(stereotype.getSourceType().getNameRange()), resource);
+ } else {
+ boolean ok = false;
+ Set<String> vs = getTargetAnnotationValues(target);
+ boolean hasType = vs.contains("TYPE");
+ boolean hasMethod = vs.contains("METHOD");
+ boolean hasField = vs.contains("FIELD");
+ if(vs.size() == 3) {
+ ok = hasType && hasMethod && hasField;
+ } else if(vs.size() == 2) {
+ ok = hasMethod && hasField;
+ } else if(vs.size() == 1) {
+ ok = hasType || hasMethod || hasField;
+ }
+ if(!ok) {
+ addError(CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, CDIPreferences.MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE, target, resource);
+ }
+ }
+
+ /*
+ * Stereotype annotation type should be annotated with @Retention(RUNTIME)
+ */
+ validateRetentionAnnotation(stereotype, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE, resource);
+ }
+
+ void validateRetentionAnnotation(ICDIAnnotation type, String message, String preference, IResource resource) throws JavaModelException {
+ IAnnotationDeclaration retention = type.getAnnotationDeclaration(CDIConstants.RETENTION_ANNOTATION_TYPE_NAME);
+ if(retention == null) {
+ addError(message, preference, CDIUtil.convertToSourceReference(type.getSourceType().getNameRange()), resource);
+ } else {
+ IMemberValuePair[] ps = retention.getDeclaration().getMemberValuePairs();
+ boolean ok = false;
+ for (IMemberValuePair p: ps) {
+ if(!"value".equals(p.getMemberName())) continue;
+ Object o = p.getValue();
+ if(o != null) {
+ ok = true;
+ String s = o.toString();
+ int i = s.lastIndexOf('.');
+ if(i >= 0) s = s.substring(i + 1);
+ if(!"RUNTIME".equals(s)) ok = false;
+ }
+ }
+ if(!ok) {
+ addError(message, preference, retention, resource);
+ }
+ }
+ }
+
+ Set<String> getTargetAnnotationValues(IAnnotationDeclaration target) throws JavaModelException {
+ Set<String> result = new HashSet<String>();
+ IMemberValuePair[] ps = target.getDeclaration().getMemberValuePairs();
+ for (IMemberValuePair p: ps) {
+ if(!"value".equals(p.getMemberName())) continue;
+ Object o = p.getValue();
+ if(o instanceof Object[]) {
+ Object[] os = (Object[])o;
+ for (Object q: os) {
+ String s = q.toString();
+ int i = s.lastIndexOf('.');
+ if(i >= 0) s = s.substring(i + 1);
+ result.add(s);
+ }
+ } else if(o != null) {
+ String s = o.toString();
+ int i = s.lastIndexOf('.');
+ if(i >= 0) s = s.substring(i + 1);
+ result.add(s);
+ }
+ }
+ return result;
+ }
+
+
/**
* Validates a qualifier.
*
@@ -1830,25 +1917,10 @@
if(target == null) {
addError(CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferences.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE, CDIUtil.convertToSourceReference(qualifier.getSourceType().getNameRange()), resource);
} else {
- IMemberValuePair[] ps = target.getDeclaration().getMemberValuePairs();
- boolean ok = false;
- for (IMemberValuePair p: ps) {
- if(!"value".equals(p.getMemberName())) continue;
- Object o = p.getValue();
- if(o instanceof Object[]) {
- ok = true;
- Object[] os = (Object[])o;
- Set<String> vs = new HashSet<String>();
- for (Object q: os) {
- String s = q.toString();
- int i = s.lastIndexOf('.');
- if(i >= 0) s = s.substring(i + 1);
- vs.add(s);
- }
- for (String s: new String[]{"TYPE", "METHOD", "FIELD", "PARAMETER"}) {
- if(!vs.contains(s)) ok = false;
- }
- }
+ Set<String> vs = getTargetAnnotationValues(target);
+ boolean ok = vs.size() == 4;
+ if(ok) for (String s: new String[]{"TYPE", "METHOD", "FIELD", "PARAMETER"}) {
+ if(!vs.contains(s)) ok = false;
}
if(!ok) {
addError(CDIValidationMessages.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferences.MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE, target, resource);
@@ -1858,27 +1930,7 @@
/*
* Qualifier annotation type should be annotated with @Retention(RUNTIME)
*/
- IAnnotationDeclaration retention = qualifier.getAnnotationDeclaration(CDIConstants.RETENTION_ANNOTATION_TYPE_NAME);
- if(retention == null) {
- addError(CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, CDIUtil.convertToSourceReference(qualifier.getSourceType().getNameRange()), resource);
- } else {
- IMemberValuePair[] ps = retention.getDeclaration().getMemberValuePairs();
- boolean ok = false;
- for (IMemberValuePair p: ps) {
- if(!"value".equals(p.getMemberName())) continue;
- Object o = p.getValue();
- if(o != null) {
- ok = true;
- String s = o.toString();
- int i = s.lastIndexOf('.');
- if(i >= 0) s = s.substring(i + 1);
- if(!"RUNTIME".equals(s)) ok = false;
- }
- }
- if(!ok) {
- addError(CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, retention, resource);
- }
- }
+ validateRetentionAnnotation(qualifier, CDIValidationMessages.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, CDIPreferences.MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE, resource);
}
private void validateInterceptorBinding(IInterceptorBinding binding) {
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-07-21 09:12:07 UTC (rev 23624)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2010-07-21 09:45:17 UTC (rev 23625)
@@ -47,6 +47,8 @@
public static String MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER;
public static String MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE;
public static String MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE;
+ public static String MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE;
+ public static String MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE;
public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS;
public static String MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS;
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-07-21 09:12:07 UTC (rev 23624)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2010-07-21 09:45:17 UTC (rev 23625)
@@ -24,8 +24,10 @@
MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_QUALIFIER_TYPE_MEMBER=Array-valued member of a qualifier type should be annotated @Nonbinding [JSR-299 �5.2.5]
MISSING_NONBINDING_FOR_ANNOTATION_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER=Annotation-valued member of an interceptor binding type should be annotated @Nonbinding [JSR-299 �9.5.2]
MISSING_NONBINDING_FOR_ARRAY_VALUE_IN_INTERCEPTOR_BINDING_TYPE_MEMBER=Array-valued member of an interceptor binding type should be annotated @Nonbinding [JSR-299 �9.5.2]
-MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE=Qualifier annotation type should be annotated with @Target('{'METHOD, FIELD, PARAMETER, TYPE'}')
-MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE=Qualifier annotation type should be annotated with @Retention(RUNTIME)
+MISSING_TARGET_ANNOTATION_IN_QUALIFIER_TYPE=Qualifier annotation type should be annotated with @Target('{'METHOD, FIELD, PARAMETER, TYPE'}') [JSR-299 �2.3.2]
+MISSING_RETENTION_ANNOTATION_IN_QUALIFIER_TYPE=Qualifier annotation type should be annotated with @Retention(RUNTIME) [JSR-299 �2.3.2]
+MISSING_TARGET_ANNOTATION_IN_STEREOTYPE_TYPE=Stereotype annotation type should be annotated with @Target with correct targets [JSR-299 �2.7.1]
+MISSING_RETENTION_ANNOTATION_IN_STEREOTYPE_TYPE=Stereotype annotation type should be annotated with @Retention(RUNTIME) [JSR-299 �2.7.1]
MULTIPLE_SCOPE_TYPE_ANNOTATIONS=Bean class or producer method or field specifies multiple scope type annotations
MULTIPLE_SCOPE_TYPE_ANNOTATIONS_IN_BEAN_CLASS=Bean class specifies multiple scope type annotations
15 years, 9 months
JBoss Tools SVN: r23624 - branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 05:12:07 -0400 (Wed, 21 Jul 2010)
New Revision: 23624
Removed:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactory.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/IGraphicalEditorPart.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ITaskNodeProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/Messages.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ProcessGraphContentProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksTaskDetailsEditorSite.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/messages.properties
Log:
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactory.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactory.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/GraphicalModelFactory.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-
-/**
- * @author Dart
- *
- */
-public interface GraphicalModelFactory {
- public Object createGraphicalModel(Object model, ISmooksModelProvider provider);
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/IGraphicalEditorPart.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/IGraphicalEditorPart.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/IGraphicalEditorPart.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-
-/**
- * @author Dart
- *
- */
-public interface IGraphicalEditorPart {
- String getID();
-
-// boolean canLink(AbstractSmooksGraphicalModel graphModel);
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-/**
- * @author Dart
- *
- */
-public interface ISmooksEditorInitListener {
- void initFailed(int messageType , String message);
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ITaskNodeProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ITaskNodeProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ITaskNodeProvider.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import org.jboss.tools.smooks.graphical.editors.process.TaskType;
-
-/**
- * @author Dart
- *
- */
-public interface ITaskNodeProvider {
-
- public TaskType getTaskType();
-
- public void setTaskType(TaskType taskType);
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/Messages.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/Messages.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/Messages.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,46 +0,0 @@
-package org.jboss.tools.smooks.graphical.editors;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.graphical.editors.messages"; //$NON-NLS-1$
- public static String SmooksFreemarkerTemplateGraphicalEditor_Warning_CSV_Fields_Empty;
- public static String SmooksFreemarkerTemplateGraphicalEditor_Warning_Must_Link_CSV_Record;
- public static String SmooksFreemarkerTemplateGraphicalEditor_Warning_Must_Link_to_Collection;
- public static String SmooksFreemarkerTemplateGraphicalEditor_Warning_Quote_Empty;
- public static String SmooksFreemarkerTemplateGraphicalEditor_Warning_Separator_Empty;
- public static String SmooksGraphicalEditorMenuContextProvider_Add_Menu_Text;
- public static String SmooksGraphicalEditorPaletteRootCreator_General_Palette_Drawer;
- public static String SmooksGraphicalEditorPaletteRootCreator_Link_Tool_Text;
- public static String SmooksGraphicalEditorPaletteRootCreator_Link_Tool_Tooltip;
- public static String SmooksJavaMappingGraphicalEditor_BeanIdEmptyErrormessage;
- public static String SmooksJavaMappingGraphicalEditor_NodeMustLinkWithJavaBean;
- public static String SmooksJavaMappingGraphicalEditor_NodeMustLinkWithSource;
- public static String SmooksJavaMappingGraphicalEditor_NullLabel;
- public static String SmooksJavaMappingGraphicalEditor_WarningMessage1;
- public static String SmooksProcessGraphicalEditor_4;
- public static String SmooksProcessGraphicalEditor_AddTaskActionText;
- public static String SmooksProcessGraphicalEditor_FormText;
- public static String SmooksProcessGraphicalEditor_TaskConfigurationSectionTitle;
- public static String SmooksProcessGraphicalEditor_TasksMapSectionTitle;
- public static String SmooksXSLTemplateGraphicalEditor_Group_Name;
- public static String TaskTypeManager_ApplyTemplateTaskLabel;
- public static String TaskTypeManager_ApplyXSLTemplateTaskLabel;
- public static String TaskTypeManager_Input;
- public static String TaskTypeManager_InputTaskLabel;
- public static String TaskTypeManager_JavaMappingTaskLabel;
- public static String XSLLabelProvider_Text_Null_Value;
- public static String SmooksProcessGraphicalEditor_Empty_Input_File;
- public static String SmooksProcessGraphicalEditor_Java_Mapping_Not_Found;
- public static String SmooksProcessGraphicalEditor_No_Input_File_Active;
- public static String SmooksProcessGraphicalEditor_No_Input_Specified;
- public static String SmooksProcessGraphicalEditor_No_Input_Task_Found;
- public static String SmooksProcessGraphicalEditor_ValidationError_MultipleTemplate;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ProcessGraphContentProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ProcessGraphContentProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ProcessGraphContentProvider.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.zest.core.viewers.IGraphEntityContentProvider;
-import org.jboss.tools.smooks.graphical.editors.process.ProcessType;
-import org.jboss.tools.smooks.graphical.editors.process.TaskType;
-
-/**
- * @author Dart
- *
- */
-public class ProcessGraphContentProvider implements IGraphEntityContentProvider {
-
- private void collectTasks(List<Object> list, TaskType task) {
- list.add(task);
- List<?> tasks = task.getTask();
- for (Iterator<?> iterator = tasks.iterator(); iterator.hasNext();) {
- TaskType t = (TaskType) iterator.next();
- collectTasks(list, t);
- }
- }
-
- private void collectObjects(List<Object> list, ProcessType process) {
- List<?> tasks = process.getTask();
- for (Iterator<?> iterator = tasks.iterator(); iterator.hasNext();) {
- TaskType t = (TaskType) iterator.next();
- collectTasks(list, t);
- }
- }
-
- public Object[] getElements(Object arg0) {
- List<Object> list = new ArrayList<Object>();
- if (arg0 instanceof ProcessType) {
- collectObjects(list, (ProcessType) arg0);
- }
- return list.toArray();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
- * .viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.zest.core.viewers.IGraphEntityContentProvider#getConnectedTo
- * (java.lang.Object)
- */
- public Object[] getConnectedTo(Object arg0) {
- if (arg0 instanceof TaskType) {
- return ((TaskType) arg0).getTask().toArray();
- }
- return new Object[] {};
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,123 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.forms.IMessage;
-
-/**
- * @author Dart
- *
- */
-public class SmooksMessage implements IMessage {
-
- private int messageType;
-
- private Control control;
-
- private Object data;
-
- private Object key;
-
- private String prefix = "-"; //$NON-NLS-1$
-
- private String message;
-
- public SmooksMessage(int messageType , String message){
- this.setMessage(message);
- this.setMessageType(messageType);
- }
-
- /**
- * @return the messageType
- */
- public int getMessageType() {
- return messageType;
- }
-
- /**
- * @param messageType the messageType to set
- */
- public void setMessageType(int messageType) {
- this.messageType = messageType;
- }
-
- /**
- * @return the control
- */
- public Control getControl() {
- return control;
- }
-
- /**
- * @param control the control to set
- */
- public void setControl(Control control) {
- this.control = control;
- }
-
- /**
- * @return the data
- */
- public Object getData() {
- return data;
- }
-
- /**
- * @param data the data to set
- */
- public void setData(Object data) {
- this.data = data;
- }
-
- /**
- * @return the key
- */
- public Object getKey() {
- return key;
- }
-
- /**
- * @param key the key to set
- */
- public void setKey(Object key) {
- this.key = key;
- }
-
- /**
- * @return the prefix
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * @param prefix the prefix to set
- */
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-
- /**
- * @return the message
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * @param message the message to set
- */
- public void setMessage(String message) {
- this.message = message;
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,555 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.graphical.editors;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorActionBarContributor;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.IMessage;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.zest.core.viewers.GraphViewer;
-import org.eclipse.zest.core.widgets.CGraphNode;
-import org.eclipse.zest.core.widgets.Graph;
-import org.eclipse.zest.core.widgets.GraphItem;
-import org.eclipse.zest.core.widgets.ZestStyles;
-import org.eclipse.zest.layouts.LayoutStyles;
-import org.eclipse.zest.layouts.algorithms.HorizontalTreeLayoutAlgorithm;
-import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
-import org.jboss.tools.smooks.graphical.actions.AbstractProcessGraphAction;
-import org.jboss.tools.smooks.graphical.actions.AddNextTaskNodeAction;
-import org.jboss.tools.smooks.graphical.actions.DeleteTaskNodeAction;
-import org.jboss.tools.smooks.graphical.editors.Messages;
-import org.jboss.tools.smooks.graphical.editors.ProcessGraphContentProvider;
-import org.jboss.tools.smooks.graphical.editors.SmooksMessage;
-import org.jboss.tools.smooks.graphical.editors.TaskTypeManager;
-import org.jboss.tools.smooks.graphical.editors.TaskTypeManager.TaskTypeDescriptor;
-import org.jboss.tools.smooks.graphical.editors.process.IProcessProvider;
-import org.jboss.tools.smooks.graphical.editors.process.ProcessFactory;
-import org.jboss.tools.smooks.graphical.editors.process.ProcessGraphicalViewerLabelProvider;
-import org.jboss.tools.smooks.graphical.editors.process.ProcessTaskAnalyzer;
-import org.jboss.tools.smooks.graphical.editors.process.ProcessType;
-import org.jboss.tools.smooks.graphical.editors.process.TaskNodeFigure;
-
-/**
- * @author Dart
- *
- */
-public class SmooksProcessGraphicalEditor extends FormPage implements IProcessProvider , PropertyChangeListener{
-
- private boolean processMapActived = false;
-
- private int currentMessageType = IMessageProvider.NONE;
-
- private String currentMessage = null;
-
- private boolean processChanged = false;
-
- private boolean lockProcessChangeEvent = false;
-
- private List<IAction> processPanelActions = new ArrayList<IAction>();
-
- public static final int EXECUTE_COMMAND = 0;
-
- public static final int REDO_COMMAND = 1;
-
- public static final int UNDO_COMMAND = 2;
-
- private Object emptyKey = new Object();
-
- private ISmooksModelProvider smooksModelProvider = null;
-
- private GraphViewer processGraphViewer;
-
-// private ScrolledPageBook pageBook;
-
- private Map<String, Object> registedTaskPages = new HashMap<String, Object>();
-
- private MenuManager manager;
-
- protected boolean needupdatewhenshow = true;
-
- 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;
- }
-
- public SmooksProcessGraphicalEditor(String id, String title, ISmooksModelProvider provider) {
- super(id, title);
- this.smooksModelProvider = provider;
- this.getManagedForm();
- }
-
- protected void createFormContent(IManagedForm managedForm) {
- super.createFormContent(managedForm);
- final ScrolledForm form = managedForm.getForm();
- FormToolkit toolkit = managedForm.getToolkit();
- toolkit.decorateFormHeading(form.getForm());
- form.getBody().setLayout(new FillLayout());
- form.setText(Messages.SmooksProcessGraphicalEditor_FormText);
-
- Composite mainComposite = toolkit.createComposite(form.getBody());
-
- GridLayout mgl = new GridLayout();
- mgl.marginHeight = 13;
- mgl.horizontalSpacing = 20;
- mainComposite.setLayout(mgl);
-
- SashForm sashForm = new SashForm(mainComposite, SWT.VERTICAL);
- sashForm.SASH_WIDTH = 1;
- GridData gd = new GridData(GridData.FILL_BOTH);
- sashForm.setLayoutData(gd);
-
- createProcessGraphicalSection(toolkit, sashForm);
-
- createTaskDetailsSection(toolkit, sashForm);
-
- sashForm.setWeights(new int[] { 2, 8 });
-
-// validateEnd(null);
- }
-
- protected void createTaskDetailsSection(FormToolkit toolkit, Composite parent) {
- Composite taskDetailsComposite = toolkit.createComposite(parent);
- FillLayout taskDetailsFillLayout = new FillLayout();
- taskDetailsFillLayout.marginWidth = 0;
- taskDetailsFillLayout.marginHeight = 5;
- taskDetailsComposite.setLayout(taskDetailsFillLayout);
-
- Section section = toolkit.createSection(taskDetailsComposite, Section.TITLE_BAR);
- section.setText(Messages.SmooksProcessGraphicalEditor_TaskConfigurationSectionTitle);
- 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);
- }
-
-
- protected void createProcessGraphicalSection(FormToolkit toolkit, Composite parent) {
- Section processGraphSection = toolkit.createSection(parent, Section.TITLE_BAR);
- processGraphSection.setText(Messages.SmooksProcessGraphicalEditor_TasksMapSectionTitle);
-
- Composite processGraphComposite = toolkit.createComposite(processGraphSection);
-
- GridLayout processGraphGridLayoutLayout = new GridLayout();
- // processGraphFillLayout.marginWidth = 1;
- // processGraphFillLayout.marginHeight = 1;
- processGraphComposite.setLayout(processGraphGridLayoutLayout);
-
- processGraphSection.setClient(processGraphComposite);
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-
- // Composite toolBarComposite =
- // toolkit.createComposite(processGraphComposite);
- // FillLayout l = new FillLayout();
- // l.marginHeight = 1;
- // l.marginWidth = 1;
- // toolBarComposite.setLayout(l);
-
- // toolBarComposite.setLayoutData(gd);
- //
- // toolBarComposite.setBackground(toolkit.getColors().getBorderColor());
- //
- // createProcessToolBar(toolBarComposite, toolkit);
-
- Composite graphMainComposite = toolkit.createComposite(processGraphComposite);
- FillLayout l1 = new FillLayout();
- l1.marginHeight = 1;
- l1.marginWidth = 1;
- graphMainComposite.setLayout(l1);
- gd = new GridData(GridData.FILL_BOTH);
- graphMainComposite.setLayoutData(gd);
- graphMainComposite.setBackground(toolkit.getColors().getBorderColor());
-
- createProcessGraphicalPanel(graphMainComposite);
-
- hookProcessGraphicalViewer();
- configProcessGraphicalViewer();
- initProcessGraphicalViewer();
- }
-
- protected void initProcessGraphicalViewer() {
- boolean disableProcessViewer = false;
- if (process == null) {
- process = ProcessFactory.eINSTANCE.createProcessType();
- process.addPropertyChangeListener(this);
- }
- ProcessTaskAnalyzer analyzer = new ProcessTaskAnalyzer();
- lockProcessChangeEvent = true;
- analyzer.analyzeTaskNode(process, smooksModelProvider.getSmooksModel());
- lockProcessChangeEvent = false;
- if (getProcessGraphViewer() != null) {
- getProcessGraphViewer().setInput(process);
- }
- if (disableProcessViewer) {
- getProcessGraphViewer().getControl().setBackground(
- getManagedForm().getToolkit().getColors().getBorderColor());
- getProcessGraphViewer().setInput(null);
- getProcessGraphViewer().getControl().setEnabled(false);
- }
- }
-
- public GraphViewer getProcessGraphViewer() {
- return processGraphViewer;
- }
-
- protected void initProcessGraphicalPanelActions(IMenuManager manager) {
-
- // AddTaskNodeAction addInputTaskAction = new
- // AddInputTaskAction(smooksModelProvider);
- // manager.add(addInputTaskAction);
- // processPanelActions.add(addInputTaskAction);
-
- MenuManager addNextTaskMenuManager = new MenuManager(Messages.SmooksProcessGraphicalEditor_AddTaskActionText);
- manager.add(addNextTaskMenuManager);
-
- generateNextTaskActions(addNextTaskMenuManager);
-
- // MenuManager addPreTaskMenuManager = new
- // MenuManager("Add Previous Task");
- // manager.add(addPreTaskMenuManager);
- //
- // fillPreTaskMenu(addPreTaskMenuManager);
-
- DeleteTaskNodeAction deleteAction = new DeleteTaskNodeAction(this, smooksModelProvider, this);
- manager.add(deleteAction);
-
- this.processPanelActions.add(deleteAction);
-
- }
-
- private void generateNextTaskActions(MenuManager addNextTaskMenuManager) {
- List<TaskTypeDescriptor> list = TaskTypeManager.getAllTaskList();
- for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
- TaskTypeDescriptor taskTypeDescriptor = (TaskTypeDescriptor) iterator.next();
- AddNextTaskNodeAction addNextInputAction = new AddNextTaskNodeAction(taskTypeDescriptor.getId(),
- taskTypeDescriptor.getLabel(), smooksModelProvider, this);
- this.processPanelActions.add(addNextInputAction);
- addNextTaskMenuManager.add(addNextInputAction);
- }
- }
-
-
- protected void configProcessGraphicalViewer() {
- manager = new MenuManager();
-
- initProcessGraphicalPanelActions(manager);
-
- Menu menu = manager.createContextMenu(getProcessGraphViewer().getControl());
- getProcessGraphViewer().getControl().setMenu(menu);
- manager.addMenuListener(new IMenuListener() {
-
- public void menuAboutToShow(IMenuManager manager) {
- try {
- manager.removeAll();
- if (needupdatewhenshow) {
- updateProcessActions(processGraphViewer.getSelection());
- fillProcessMenu(manager);
- } else {
- for (Iterator<?> iterator = processPanelActions.iterator(); iterator.hasNext();) {
- IAction action = (IAction) iterator.next();
- if (action.isEnabled() && !(action instanceof DeleteTaskNodeAction)) {
- manager.add(action);
- }
- }
- }
- needupdatewhenshow = true;
- } catch (Exception e) {
- e.printStackTrace();
- }
- needupdatewhenshow = true;
- }
- });
- }
-
- public void updateProcessActions(ISelection selection) {
- try{
- for (Iterator<?> iterator = processPanelActions.iterator(); iterator.hasNext();) {
- IAction a = (IAction) iterator.next();
- if (a instanceof AbstractProcessGraphAction) {
- ((AbstractProcessGraphAction) a).selectionChanged(new SelectionChangedEvent(processGraphViewer,
- selection));
- }
- }
- manager.update();
- }catch(Throwable t){
- t.printStackTrace();
- }
- }
-
- public void fillProcessMenu(IMenuManager manager) {
- MenuManager addNextTaskMenuManager = new MenuManager(Messages.SmooksProcessGraphicalEditor_AddTaskActionText);
- manager.add(addNextTaskMenuManager);
-
- for (Iterator<?> iterator = processPanelActions.iterator(); iterator.hasNext();) {
- IAction action = (IAction) iterator.next();
- if (action instanceof DeleteTaskNodeAction) {
- manager.add(action);
- } else {
- addNextTaskMenuManager.add(action);
- }
- }
- }
-
-
-
- protected void hookProcessGraphicalViewer() {
- getProcessGraphViewer().addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
- Object firstElement = selection.getFirstElement();
- if (firstElement == null) {
- unhighlightGraphNodes();
- }
- Graph graph = getProcessGraphViewer().getGraphControl();
- List<?> nodes = graph.getNodes();
- GraphItem item = null;
- for (Iterator<?> iterator = nodes.iterator(); iterator.hasNext();) {
- GraphItem graphItem = (GraphItem) iterator.next();
- if (graphItem.getData() == firstElement) {
- item = graphItem;
- break;
- }
- }
- if (item != null) {
- unhighlightGraphNodes();
- highlightGraphNode(item);
- }
-// showTaskControl(firstElement);
-// SmooksProcessGraphicalEditor.this.selectionChanged(event);
- updateGlobalActions();
- }
- });
- // when focus change , update the actions in the Eclipse menu via
- // EditorContributor
- getProcessGraphViewer().getControl().addFocusListener(new FocusListener() {
-
- public void focusLost(FocusEvent e) {
- processMapActived = false;
- updateGlobalActions();
- }
-
- public void focusGained(FocusEvent e) {
- processMapActived = true;
- updateGlobalActions();
- }
- });
- }
-
- private void updateGlobalActions() {
- IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
- if (contributor != null && contributor instanceof MultiPageEditorActionBarContributor) {
- // clean all actions
- ((MultiPageEditorActionBarContributor) contributor).setActivePage(null);
- // re-active the page and add all actions
- ((MultiPageEditorActionBarContributor) contributor).setActivePage(SmooksProcessGraphicalEditor.this);
- }
- }
-
- public void propertyChange(PropertyChangeEvent evt) {
- if (lockProcessChangeEvent)
- return;
- String name = evt.getPropertyName();
- Object newtask = evt.getNewValue();
- Object oldtask = evt.getOldValue();
- if (ProcessType.PRO_ADD_CHILD.equals(name) || ProcessType.PRO_REMOVE_CHILD.equals(name)) {
- if (getProcessGraphViewer() != null) {
- getProcessGraphViewer().refresh();
- getProcessGraphViewer().applyLayout();
- }
- processChanged = true;
- getManagedForm().dirtyStateChanged();
- }
-
-// if (ProcessType.PRO_ADD_CHILD.equals(name)) {
-// this.showTaskControl(newtask);
-// }
-// if (ProcessType.PRO_REMOVE_CHILD.equals(name)) {
-// this.showTaskControl(null);
-// disposeTaskDetails(oldtask);
-// }
-// validateEnd(null);
- }
-
- protected void unhighlightGraphNodes() {
-
- Graph graph = this.getProcessGraphViewer().getGraphControl();
- List<?> elements = graph.getNodes();
- for (Iterator<?> iterator = elements.iterator(); iterator.hasNext();) {
- GraphItem graphItem = (GraphItem) iterator.next();
- unhighlightGraphNode(graphItem);
- }
- }
-
- protected void unhighlightGraphNode(GraphItem item) {
- if (item instanceof CGraphNode) {
- IFigure figure = ((CGraphNode) item).getFigure();
- if (figure instanceof TaskNodeFigure) {
- ((TaskNodeFigure) figure).unhighlightLabel();
- }
- }
- }
-
- protected void highlightGraphNode(GraphItem item) {
- if (item instanceof CGraphNode) {
- IFigure figure = ((CGraphNode) item).getFigure();
- if (figure instanceof TaskNodeFigure) {
- ((TaskNodeFigure) figure).highlightLabel(org.eclipse.draw2d.ColorConstants.darkBlue);
- }
- }
- }
-
- protected void createProcessGraphicalPanel(Composite parent) {
- processGraphViewer = new GraphViewer(parent, SWT.NONE);
- processGraphViewer.getControl().dispose();
- processGraphViewer.setControl(new Graph(parent, SWT.NONE) {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.zest.core.widgets.Graph#dispose()
- */
- @Override
- public void dispose() {
- try {
- super.dispose();
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
- });
- // GridData gd = new GridData(GridData.FILL_BOTH);
- // processGraphViewer.getControl().setLayoutData(gd);
- // processGraphViewer.setNodeStyle(ZestStyles.NODES_FISHEYE);
- processGraphViewer.setContentProvider(new ProcessGraphContentProvider());
- processGraphViewer.setLabelProvider(new ProcessGraphicalViewerLabelProvider(this));
- processGraphViewer.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
- HorizontalTreeLayoutAlgorithm layoutAlgorithm = new HorizontalTreeLayoutAlgorithm(
- LayoutStyles.NO_LAYOUT_NODE_RESIZING);
- processGraphViewer.setLayoutAlgorithm(layoutAlgorithm, true);
- if (parent instanceof Section) {
- ((Section) parent).setClient(processGraphViewer.getControl());
- }
- }
-
-
- public void createPartControl(Composite parent) {
- super.createPartControl(parent);
- updateHeaderFormMessage();
- }
-
- protected void updateHeaderFormMessage() {
- if (this.getManagedForm() != null) {
- getManagedForm().getMessageManager().removeAllMessages();
- getManagedForm().getMessageManager().update();
- getProcessGraphViewer().getControl().setEnabled(true);
- getProcessGraphViewer().getControl().setBackground(
- getManagedForm().getToolkit().getColors().getBackground());
- }
- if (currentMessageType != IMessageProvider.NONE && currentMessage != null) {
- if (this.getProcessGraphViewer() != null) {
- getProcessGraphViewer().getControl().setBackground(GraphicsConstants.BORDER_CORLOR);
- getProcessGraphViewer().getControl().setEnabled(false);
- getProcessGraphViewer().setInput(new Object());
-// showTaskControl(null);
- }
- if (this.getManagedForm() != null) {
-
- String[] messages = currentMessage.split("\n"); //$NON-NLS-1$
- List<IMessage> messageList = new ArrayList<IMessage>();
- for (int i = 0; i < messages.length; i++) {
- String message = messages[i];
- if (message != null)
- message.trim();
- if (message.length() == 0) {
- continue;
- }
- messageList.add(new SmooksMessage(currentMessageType, message));
- }
- String mainMessage = null;
- if (messageList.isEmpty()) {
- mainMessage = currentMessage;
- } else {
- mainMessage = messageList.get(0).getMessage();
- }
-
- this.getManagedForm().getForm().getForm().setMessage(mainMessage, currentMessageType,
- messageList.toArray(new IMessage[] {}));
-
- }
- }
- }
-
- /**
- * @return the needupdatewhenshow
- */
- public boolean isNeedupdatewhenshow() {
- return needupdatewhenshow;
- }
-
- /**
- * @param needupdatewhenshow
- * the needupdatewhenshow to set
- */
- public void setNeedupdatewhenshow(boolean needupdatewhenshow) {
- this.needupdatewhenshow = needupdatewhenshow;
- }
-
- public ProcessType getProcess() {
- return this.process;
- }
-
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksTaskDetailsEditorSite.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksTaskDetailsEditorSite.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksTaskDetailsEditorSite.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.part.MultiPageEditorSite;
-
-/**
- * @author Dart
- *
- */
-public class SmooksTaskDetailsEditorSite extends MultiPageEditorSite {
-
- private FormPage parentEditor = null;
-
- public SmooksTaskDetailsEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor,
- FormPage parentEditor) {
- super(multiPageEditor, editor);
- this.parentEditor = parentEditor;
- }
-
- /**
- * @return the parentEditor
- */
- public FormPage getParentEditor() {
- return parentEditor;
- }
-
- /**
- * @param parentEditor the parentEditor to set
- */
- public void setParentEditor(FormPage parentEditor) {
- this.parentEditor = parentEditor;
- }
-
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/TaskTypeManager.java 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.graphical.editors;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
-import org.jboss.tools.smooks.graphical.editors.process.TaskType;
-import org.jboss.tools.smooks.graphical.editors.process.TemplateAppyTaskNode;
-//import org.jboss.tools.smooks.model.freemarker.Freemarker;
-//import org.jboss.tools.smooks.model.javabean12.BeanType;
-//import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
-//import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
-
-/**
- * @author Dart
- *
- */
-public class TaskTypeManager {
-
- public static final String TASK_ID_INPUT = "input"; //$NON-NLS-1$
-
- public static final String TASK_ID_JAVA_MAPPING = "java_mapping"; //$NON-NLS-1$
-
- public static final String TASK_ID_XSL_TEMPLATE = "xsl_template"; //$NON-NLS-1$
-
- public static final String TASK_ID_FREEMARKER_CSV_TEMPLATE = "freemarker_csv_template"; //$NON-NLS-1$
-
- public static final String TASK_ID_FREEMARKER_XML_TEMPLATE = "freemarker_xml_template"; //$NON-NLS-1$
-
- private static List<TaskTypeDescriptor> allTaskList = null;
-
- public static String[] getChildTaskIDs(String parentId) {
- if (parentId == null)
- return null;
- if (parentId.equals(TaskTypeManager.TASK_ID_INPUT)) {
- return new String[] { TaskTypeManager.TASK_ID_JAVA_MAPPING };
- }
- if (parentId.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING)) {
- return new String[] { TaskTypeManager.TASK_ID_FREEMARKER_CSV_TEMPLATE };
- }
- return null;
- }
-
- /**
- * @return the allTaskList
- */
- public static List<TaskTypeDescriptor> getAllTaskList() {
- if (allTaskList == null) {
- allTaskList = new ArrayList<TaskTypeDescriptor>();
-
- // init
- allTaskList.add(new TaskTypeDescriptor(TASK_ID_INPUT, Messages.TaskTypeManager_Input,
- GraphicsConstants.IMAGE_INPUT_TASK));
- allTaskList.add(new TaskTypeDescriptor(TASK_ID_JAVA_MAPPING, Messages.TaskTypeManager_JavaMappingTaskLabel,
- GraphicsConstants.IMAGE_JAVA_AMPPING_TASK));
- allTaskList.add(new TaskTypeDescriptor(TASK_ID_FREEMARKER_CSV_TEMPLATE,
- Messages.TaskTypeManager_ApplyTemplateTaskLabel, GraphicsConstants.IMAGE_APPLY_FREEMARKER_TASK));
- }
- return allTaskList;
- }
-
- public static List<Object> getAssociatedSmooksElementsType(TaskType taskType) {
- return null;
- }
-
-// public static List<Object> getAssociatedSmooksElementsType(String taskID) {
-// List<Object> elementsType = new ArrayList<Object>();
-// if (taskID == null)
-// return null;
-// if (TASK_ID_JAVA_MAPPING.equals(taskID)) {
-// elementsType.add(BeanType.class);
-// }
-// if (TASK_ID_FREEMARKER_CSV_TEMPLATE.equals(taskID)) {
-// elementsType.add(Freemarker.class);
-// }
-// return elementsType;
-// }
-
- public static String getTaskLabel(TaskType task) {
- if (task != null) {
- String taskId = task.getId();
- if (taskId != null) {
- if (taskId.equals(TASK_ID_FREEMARKER_CSV_TEMPLATE)) {
- String messageType = ""; //$NON-NLS-1$
- if (task instanceof TemplateAppyTaskNode) {
- messageType = ((TemplateAppyTaskNode) task).getType();
- }
- if (messageType == null)
- messageType = ""; //$NON-NLS-1$
- if (messageType.length() > 0){
- return Messages.TaskTypeManager_ApplyTemplateTaskLabel + " (" + messageType +")"; //$NON-NLS-1$ //$NON-NLS-2$
- }else{
- return Messages.TaskTypeManager_ApplyTemplateTaskLabel;
- }
- }
- if (taskId.equals(TASK_ID_INPUT)) {
- return Messages.TaskTypeManager_InputTaskLabel;
- }
- if (taskId.equals(TASK_ID_JAVA_MAPPING)) {
- return Messages.TaskTypeManager_JavaMappingTaskLabel;
- }
- if (taskId.equals(TASK_ID_XSL_TEMPLATE)) {
- return Messages.TaskTypeManager_ApplyXSLTemplateTaskLabel;
- }
- }
- }
- return ""; //$NON-NLS-1$
- }
-
-// /**
-// *
-// * @param taskID
-// * @param smooksResourceList
-// * @return
-// */
-// public static List<Object> getAssociatedSmooksElements(TaskType taskType, SmooksResourceListType smooksResourceList) {
-// List<Object> elementTypes = getAssociatedSmooksElementsType(taskType.getId());
-// List<AbstractResourceConfig> resourceConfigList = smooksResourceList.getAbstractResourceConfig();
-// List<Object> associatedElements = new ArrayList<Object>();
-// for (Iterator<?> iterator = resourceConfigList.iterator(); iterator.hasNext();) {
-// AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig) iterator.next();
-// if (isSameType(abstractResourceConfig, elementTypes) && canRemove(abstractResourceConfig, taskType)) {
-// associatedElements.add(abstractResourceConfig);
-// }
-// }
-// return associatedElements;
-// }
-//
-// private static boolean canRemove(AbstractResourceConfig abstractResourceConfig, TaskType taskType) {
-// if (abstractResourceConfig instanceof Freemarker) {
-// return taskType.inTheTask(abstractResourceConfig);
-// }
-// return true;
-// }
-
- private static boolean isSameType(Object element, List<Object> elementTypes) {
- for (Iterator<?> iterator = elementTypes.iterator(); iterator.hasNext();) {
- Class<?> object = (Class<?>) iterator.next();
- if (object.isInstance(element)) {
- return true;
- }
- }
- return false;
- }
-
- public static final class TaskTypeDescriptor {
-
- private String id;
-
- private String label;
-
- private String imagePath;
-
- public TaskTypeDescriptor(String id, String label, String imagePath) {
- this.id = id;
- this.label = label;
- this.imagePath = imagePath;
- }
-
- /**
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- /**
- * @param id
- * the id to set
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * @return the label
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * @param label
- * the label to set
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * @return the imagePath
- */
- public String getImagePath() {
- return imagePath;
- }
-
- /**
- * @param imagePath
- * the imagePath to set
- */
- public void setImagePath(String imagePath) {
- this.imagePath = imagePath;
- }
-
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/messages.properties
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/messages.properties 2010-07-21 09:11:28 UTC (rev 23623)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/messages.properties 2010-07-21 09:12:07 UTC (rev 23624)
@@ -1,32 +0,0 @@
-SmooksFreemarkerTemplateGraphicalEditor_Warning_CSV_Fields_Empty=CSV fields can't be empty
-SmooksFreemarkerTemplateGraphicalEditor_Warning_Must_Link_CSV_Record=Must link CSV-Record before linking this node.
-SmooksFreemarkerTemplateGraphicalEditor_Warning_Must_Link_to_Collection=Must be linked with collection java class node
-SmooksFreemarkerTemplateGraphicalEditor_Warning_Quote_Empty=Quote character can't be empty
-SmooksFreemarkerTemplateGraphicalEditor_Warning_Separator_Empty=Separator character can't be empty
-SmooksGraphicalEditorMenuContextProvider_Add_Menu_Text=Add
-SmooksGraphicalEditorPaletteRootCreator_General_Palette_Drawer=General
-SmooksGraphicalEditorPaletteRootCreator_Link_Tool_Text=Link
-SmooksGraphicalEditorPaletteRootCreator_Link_Tool_Tooltip=Connect node
-SmooksJavaMappingGraphicalEditor_BeanIdEmptyErrormessage=The Bean ID shouldn't be empty
-SmooksJavaMappingGraphicalEditor_NodeMustLinkWithJavaBean=The node must link to another Java Bean
-SmooksJavaMappingGraphicalEditor_NodeMustLinkWithSource=The node must be linked with input source
-SmooksJavaMappingGraphicalEditor_NullLabel=<NULL>
-SmooksJavaMappingGraphicalEditor_WarningMessage1=Decoder should be '
-SmooksProcessGraphicalEditor_4=No java mapping has been specified in the Java Mapping task.
-SmooksProcessGraphicalEditor_ValidationError_MultipleTemplate=Doesn't support multiple template task.
-SmooksProcessGraphicalEditor_AddTaskActionText=Add Task
-SmooksProcessGraphicalEditor_FormText=Smooks Processing
-SmooksProcessGraphicalEditor_TaskConfigurationSectionTitle=Selected Task Details
-SmooksProcessGraphicalEditor_TasksMapSectionTitle=Processing Tasks
-SmooksXSLTemplateGraphicalEditor_Group_Name=XSL Template
-TaskTypeManager_ApplyTemplateTaskLabel=Apply Template
-TaskTypeManager_ApplyXSLTemplateTaskLabel=Apply XSL Template
-TaskTypeManager_Input=Input
-TaskTypeManager_InputTaskLabel=Input Task
-TaskTypeManager_JavaMappingTaskLabel=Java Mapping
-XSLLabelProvider_Text_Null_Value=\ (Null Value)
-SmooksProcessGraphicalEditor_Empty_Input_File=Sample input file is empty.
-SmooksProcessGraphicalEditor_Java_Mapping_Not_Found=Mapping to Java classes is missing or incorrect.
-SmooksProcessGraphicalEditor_No_Input_File_Active=No sample input file is specified.
-SmooksProcessGraphicalEditor_No_Input_Specified=No Input configuration has been specified.
-SmooksProcessGraphicalEditor_No_Input_Task_Found=No Input task was found.
15 years, 9 months
JBoss Tools SVN: r23623 - in branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: configuration/editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2010-07-21 05:11:28 -0400 (Wed, 21 Jul 2010)
New Revision: 23623
Removed:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ClassPathFileProcessor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataContentProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataLabelProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CurrentProjecViewerFilter.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ExtentionInputContentProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFieldMarker.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFilePathProcessor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IXMLStructuredObject.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Messages.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigfileContentDescriber.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiPageEditorContributor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksToolsStartup.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksXMLEditor.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/Messages.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchTabGroup.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/messages.properties
Log:
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- *
- */
-public class AttributeFieldEditPart {
-
- private Object attribute;
-
- private IFieldMarker fieldMarker;
-
- private Control contentControl;
-
- /**
- * @return the fieldMarker
- */
- public IFieldMarker getFieldMarker() {
- return fieldMarker;
- }
-
- /**
- * @param fieldMarker the fieldMarker to set
- */
- public void setFieldMarker(IFieldMarker fieldMarker) {
- this.fieldMarker = fieldMarker;
- }
-
- /**
- * @return the contentControl
- */
- public Control getContentControl() {
- return contentControl;
- }
-
- /**
- * @param contentControl the contentControl to set
- */
- public void setContentControl(Control contentControl) {
- this.contentControl = contentControl;
- }
-
- /**
- * @return the attribute
- */
- public Object getAttribute() {
- return attribute;
- }
-
- /**
- * @param attribute the attribute to set
- */
- public void setAttribute(Object attribute) {
- this.attribute = attribute;
- }
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ClassPathFileProcessor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ClassPathFileProcessor.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ClassPathFileProcessor.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,72 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-
-/**
- * @author DartPeng
- *
- */
-public class ClassPathFileProcessor implements IFilePathProcessor {
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.configuration.editors.IFilePathProcessor#
- * processFileSystemPath(java.lang.String)
- */
- public String processFileSystemPath(String filePath) {
- return filePath;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.configuration.editors.IFilePathProcessor#
- * processWorkBenchPath(org.eclipse.core.resources.IFile)
- */
- public String processWorkBenchPath(IFile file) {
- IProject project = file.getProject();
- IJavaProject javaProject = JavaCore.create(project);
- String path = null;
- if (javaProject != null) {
- try {
- IClasspathEntry[] classpathEntries = javaProject.getRawClasspath();
- for (int i = 0; i < classpathEntries.length; i++) {
- IClasspathEntry entry = classpathEntries[i];
-// if(entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){
- IPath sourcePath = entry.getPath();
- if(sourcePath.isPrefixOf(file.getFullPath())){
- IPath filePath = file.getFullPath();
- String sp = sourcePath.toPortableString();
- String fp = filePath.toPortableString();
- path = fp.substring(sp.length(), fp.length());
- break;
- }
-// }
- }
- } catch (JavaModelException e) {
-// e.printStackTrace();
- // ignore
- }
- }
- if(path == null){
- path = file.getFullPath().removeFirstSegments(1).toPortableString();
- }
- if(path.charAt(0) == '\\' || path.charAt(0) == '/' ){
-
- }else{
- path = "/" + path; //$NON-NLS-1$
- }
- return path;
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Codegenerator.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,118 +0,0 @@
-package org.jboss.tools.smooks.configuration.editors;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-
-public class Codegenerator {
- String basePath = "/home/DartPeng/Work/eclipse/smooks-configuration-workspace/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/temp/"; //$NON-NLS-1$
- String tempContents = ""; //$NON-NLS-1$
-
- public Codegenerator() {
- try {
- FileReader reader = new FileReader(
- new File(
- "/home/DartPeng/Work/eclipse/smooks-configuration-workspace/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt")); //$NON-NLS-1$
- BufferedReader r = new BufferedReader(reader);
- String line = r.readLine();
- while (line != null) {
- tempContents += line;
- line = r.readLine();
- if (line != null) {
- tempContents += "\n"; //$NON-NLS-1$
- }
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- public static void main(String[] args) {
-// Codegenerator g = new Codegenerator();
-// try {
-// g.generateCodes(DatasourcePackage.eINSTANCE);
-// } catch (IllegalArgumentException e) {
-// e.printStackTrace();
-// } catch (IllegalAccessException e) {
-// e.printStackTrace();
-// } catch (IOException e) {
-// e.printStackTrace();
-// }
- }
-
- public void generateCodes(EPackage epackage) throws IllegalArgumentException,
- IllegalAccessException, IOException {
- Field[] fields = epackage.getClass().getDeclaredFields();
- for (int i = 0; i < fields.length; i++) {
- Field f = fields[i];
- f.setAccessible(true);
- Class<?> clazz = f.getType();
- if (clazz == EClass.class) {
- EClass eClass = (EClass) f.get(epackage);
- if (eClass.isAbstract() || eClass.isInterface()) {
- continue;
- }
- File file = new File(basePath + eClass.getName() + "UICreator.java"); //$NON-NLS-1$
- System.out.println("map.put(" + eClass.getName() + "Impl.class, new " //$NON-NLS-1$ //$NON-NLS-2$
- + eClass.getName() + "UICreator());"); //$NON-NLS-1$
- if (!file.exists()) {
- file.createNewFile();
- FileWriter writer = new FileWriter(file);
- writer.write(generateContents(eClass, epackage));
- writer.close();
- }
- }
- }
- }
-
- private String generateContents(EClass eClass, EPackage ePackage) {
- if (tempContents != null) {
- String className = eClass.getName() + "UICreator"; //$NON-NLS-1$
- String t = tempContents;
- if (t.indexOf("${className}") != -1) { //$NON-NLS-1$
- String s = t.substring(0, t.indexOf("${className}")); //$NON-NLS-1$
- String es = t.substring(t.indexOf("${className}") + "${className}".length(), t //$NON-NLS-1$ //$NON-NLS-2$
- .length());
- t = s + className + es;
- }
- String epName = ePackage.getClass().getSimpleName();
- if (epName.endsWith("Impl")) { //$NON-NLS-1$
- epName = epName.substring(0, epName.indexOf("Impl")); //$NON-NLS-1$
- }
-
- String allepName = epName + ".eINSTANCE.get" + eClass.getName(); //$NON-NLS-1$
- List<EAttribute> alist = eClass.getEAllAttributes();
- String attributeMethod = ""; //$NON-NLS-1$
- for (Iterator<?> iterator = alist.iterator(); iterator.hasNext();) {
- EAttribute attribute = (EAttribute) iterator.next();
- String atn = attribute.getName();
- String firstC = new String(new char[] { atn.toCharArray()[0] });
- firstC = firstC.toUpperCase();
- atn = firstC + atn.substring(1, atn.length());
- String n = allepName + "_" + atn + "()"; //$NON-NLS-1$ //$NON-NLS-2$
- String cn = "if(feature == " + n + "){}\n"; //$NON-NLS-1$ //$NON-NLS-2$
- attributeMethod += cn;
- }
- int index2 = t.indexOf("${attributeMethod}"); //$NON-NLS-1$
- if (index2 != -1) {
- String am1 = t.substring(0, index2);
- String am2 = t.substring(index2 + "${attributeMethod}".length(), t.length()); //$NON-NLS-1$
- t = am1 + attributeMethod + am2;
- }
- return t;
- }
- return ""; //$NON-NLS-1$
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataContentProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataContentProvider.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataContentProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.jboss.tools.smooks.configuration.editors.wizard.IViewerInitor;
-import org.jboss.tools.smooks.configuration.editors.wizard.ViewerInitorStore;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- * <p>
- * Apr 12, 2009
- */
-public class CompoundStructuredDataContentProvider implements ITreeContentProvider {
-
- private List<ITreeContentProvider> contentProviderList = new ArrayList<ITreeContentProvider>();
-
- public CompoundStructuredDataContentProvider() {
- Collection<IViewerInitor> lists = ViewerInitorStore.getInstance().getViewerInitorCollection();
- for (Iterator<IViewerInitor> iterator = lists.iterator(); iterator.hasNext();) {
- IViewerInitor viewerInitor = (IViewerInitor) iterator.next();
- contentProviderList.add(viewerInitor.getTreeContentProvider());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.
- * Object)
- */
- public Object[] getChildren(Object parentElement) {
- for (Iterator<?> iterator = contentProviderList.iterator(); iterator.hasNext();) {
- ITreeContentProvider provider = (ITreeContentProvider) iterator.next();
- Object[] objs = provider.getChildren(parentElement);
- if (objs == null || objs.length == 0) {
- continue;
- }
- return objs;
- }
- return new Object[] {};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object
- * )
- */
- public Object getParent(Object element) {
- for (Iterator<?> iterator = contentProviderList.iterator(); iterator.hasNext();) {
- ITreeContentProvider provider = (ITreeContentProvider) iterator.next();
- Object parent = provider.getParent(element);
- if (parent == null) {
- continue;
- }
- return parent;
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.
- * Object)
- */
- public boolean hasChildren(Object element) {
- for (Iterator<?> iterator = contentProviderList.iterator(); iterator.hasNext();) {
- ITreeContentProvider provider = (ITreeContentProvider) iterator.next();
- boolean parent = provider.hasChildren(element);
- if (!parent) {
- continue;
- }
- return parent;
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
- * .lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>){
- return ((List<?>)inputElement).toArray();
- }
- for (Iterator<?> iterator = contentProviderList.iterator(); iterator.hasNext();) {
- ITreeContentProvider provider = (ITreeContentProvider) iterator.next();
- Object[] objs = provider.getElements(inputElement);
- if (objs == null || objs.length == 0) {
- continue;
- }
- return objs;
- }
- return new Object[] {};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- for (Iterator<?> iterator = contentProviderList.iterator(); iterator.hasNext();) {
- ITreeContentProvider provider = (ITreeContentProvider) iterator.next();
- provider.dispose();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
- * .viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataLabelProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataLabelProvider.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CompoundStructuredDataLabelProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.smooks.configuration.editors.wizard.IViewerInitor;
-import org.jboss.tools.smooks.configuration.editors.wizard.ViewerInitorStore;
-
-/**
- * @author Dart (dpeng(a)redhat.com)<p>
- * Apr 12, 2009
- */
-public class CompoundStructuredDataLabelProvider extends LabelProvider {
- private List<ILabelProvider> labelProviderList = new ArrayList<ILabelProvider>();
-
- public CompoundStructuredDataLabelProvider() {
- Collection<IViewerInitor> lists = ViewerInitorStore.getInstance().getViewerInitorCollection();
- for (Iterator<IViewerInitor> iterator = lists.iterator(); iterator.hasNext();) {
- IViewerInitor viewerInitor = (IViewerInitor) iterator.next();
- labelProviderList.add(viewerInitor.getLabelProvider());
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage(Object element) {
- for (Iterator<?> iterator = labelProviderList.iterator(); iterator.hasNext();) {
- ILabelProvider provider = (ILabelProvider) iterator.next();
- Image img = provider.getImage(element);
- if (img == null) {
- continue;
- }
- return img;
- }
- return super.getImage(element);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object element) {
- for (Iterator<?> iterator = labelProviderList.iterator(); iterator.hasNext();) {
- ILabelProvider provider = (ILabelProvider) iterator.next();
- String text = provider.getText(element);
- if (text == null || text.length() == 0) {
- continue;
- }
- return text;
- }
- return super.getText(element);
- }
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CurrentProjecViewerFilter.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CurrentProjecViewerFilter.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/CurrentProjecViewerFilter.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,56 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-
-/**
- * @author DartPeng
- *
- */
-public class CurrentProjecViewerFilter extends ViewerFilter {
-
- private IResource referenceResource;
-
- public CurrentProjecViewerFilter(IResource referenceResource) {
- this.referenceResource = referenceResource;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers
- * .Viewer, java.lang.Object, java.lang.Object)
- */
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- IProject project = null;
- if (referenceResource != null) {
- project = referenceResource.getProject();
- }
- if (project == null) {
- return true;
- }
- IResource resource = null;
- if (element instanceof IResource) {
- resource = (IResource)element;
- } else {
- if (element instanceof IAdaptable) {
- resource = (IResource) ((IAdaptable) element).getAdapter(IResource.class);
- }
- }
- if (resource != null) {
- if(project == resource.getProject()){
- return true;
- }
- }
- return false;
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ExtentionInputContentProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ExtentionInputContentProvider.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/ExtentionInputContentProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- * <p>
- * Apr 12, 2009
- */
-public class ExtentionInputContentProvider implements IStructuredContentProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java
- * .lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof List<?>) {
- return ((List<?>) inputElement).toArray();
- // return
- // ((SmooksGraphicsExtType)inputElement).getInput().toArray();
- }
- return new Object[] {};
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface
- * .viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-import org.eclipse.jface.window.DefaultToolTip;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.IFormColors;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- *
- */
-public class FieldMarkerComposite extends Canvas implements IFieldMarker, PaintListener {
-
- private Image errorImage = null;
-
- private Image waringImage = null;
-
- // private Image informationImage = null;
-
- private int type = TYPE_NONE;
-
- private DefaultToolTip toolTip = null;
-
- public FieldMarkerComposite(Composite parent, int style) {
- super(parent, style);
- this.setBackground(new Color(null,255,255,255));
- errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry()
- .get(GraphicsConstants.IMAGE_OVR_ERROR);
- waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
- GraphicsConstants.IMAGE_OVR_WARING);
- this.addPaintListener(this);
- toolTip = new DefaultToolTip(this) {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.window.DefaultToolTip#createToolTipContentArea
- * (org.eclipse.swt.widgets.Event,
- * org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Composite createToolTipContentArea(Event event, Composite parent) {
- return super.createToolTipContentArea(event, parent);
- }
-
- public Point getLocation(Point tipSize, Event event) {
- Point point = super.getLocation(tipSize, event);
- point.y = ((Control) getToolTipArea(null)).toDisplay(0, 0).y - 24;
- point.x = ((Control) getToolTipArea(null)).toDisplay(0, 0).x;
- return point;
- }
-
- };
- ((DefaultToolTip) toolTip).setBackgroundColor(new Color(null, 255, 255, 255));
- FormColors colors = new FormColors(getDisplay());
- ((DefaultToolTip) toolTip).setForegroundColor(colors.getColor(IFormColors.TITLE));
- toolTip.setStyle(SWT.NONE);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.configuration.editors.IFieldMarker#setMarkerType()
- */
- public void setMarkerType(int type) {
- this.type = type;
- if (this.isDisposed())
- return;
- this.redraw();
- }
-
- public int getMarkerType() {
- return type;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.jboss.tools.smooks.configuration.editors.IFieldMarker#setMessage()
- */
- public void setMessage(String message) {
- toolTip.setText(message);
- }
-
- public String getMessage() {
- return getToolTipText();
- }
-
- public void clean() {
- setMarkerType(TYPE_NONE);
- if(isDisposed()) return;
- this.setToolTipText(null);
- this.redraw();
- }
-
- public void paintControl(PaintEvent e) {
- GC gc = e.gc;
- gc.fillRectangle(getBounds());
- if (type == IFieldMarker.TYPE_ERROR) {
- gc.drawImage(errorImage, 0, 0);
- }
- if (type == IFieldMarker.TYPE_WARINING) {
- gc.drawImage(waringImage, 0, 0);
- }
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/GraphicsConstants.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,115 +0,0 @@
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.IFormColors;
-
-public final class GraphicsConstants {
-
- public static Color BORDER_CORLOR;
-
- public static Color TB_BG_CORLOR;
-
- public static Color FONT_COLOR ;
-
- static {
- FormColors toolkit = new FormColors(Display.getDefault());
- BORDER_CORLOR = toolkit.getBorderColor();
- TB_BG_CORLOR = toolkit.getColor(IFormColors.TB_BG);
- FONT_COLOR = toolkit.getColor(IFormColors.TITLE);
-// toolkit.dispose();
- }
-
- public static final String IMAGE_JAVA_AMPPING_TASK = "icons/full/obj32/java_mapping_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_DRAG_LINK = "icons/full/obj16/drag_link.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_ADD_TASK_BUTTON = "icons/full/obj16/add_task_button.png"; //$NON-NLS-1$
-
- public static final String IMAGE_LINK16 = "icons/full/obj16/connection16.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_LINK24 = "icons/full/obj16/connection24.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_APPLY_XSL_TASK = "icons/full/obj32/xsl_task.png"; //$NON-NLS-1$
-
- public static final String IMAGE_APPLY_FREEMARKER_TASK = "icons/full/obj32/freemarker_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_INPUT_TASK = "icons/full/obj32/input_task.jpg"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_ATTRIBUTE = "icons/full/obj16/att_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_VALIDATED_TAG = "icons/full/obj16/validated_tag.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PROPERTY_SHEET_PAGE = "icons/full/prop_ps.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_OBJECT = "icons/full/obj16/class_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PACKAGE_OBJECT = "icons/full/obj16/package_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_CHOICE = "icons/full/obj16/xsl_choice.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_TEMPLATE_APPLY = "icons/full/obj16/xsl_template_apply.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_FOREACH = "icons/full/obj16/xsl_foreach.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_SORT = "icons/full/obj16/xsl_sort.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_IF = "icons/full/obj16/xsl_if.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_STYLESHEET = "icons/full/obj16/xsl_stylesheet.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSL_TEMPLATE = "icons/full/obj16/xsl_template.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_OVR_ERROR = "icons/full/ovr16/error_co.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_OVR_WARING = "icons/full/ovr16/warning_co.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_INTERFACE = "icons/full/obj16/int_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_COLLECTION = "icons/full/obj16/javalistmodel.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_BEAN = "icons/full/obj16/java_bean.png"; //$NON-NLS-1$
-
- public static final String IMAGE_INPUT_DATA_HEADER = "icons/full/obj16/input_data_header.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_ARRAY = "icons/full/obj16/javaarraymodel.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CHECKBOX_CHECK = "icons/full/obj16/checkbox_checked.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CHECKBOX_UNCHECK = "icons/full/obj16/checkbox_uncheck.gif"; //$NON-NLS-1$
-
- public static final String JAVA_PROPERTY_ICON_PATH = IMAGE_JAVA_ATTRIBUTE;
-
- public static final String JAVA_PROPERTY_ICON = JAVA_PROPERTY_ICON_PATH;
-
- public static final String IMAGE_PATH_ERROR = "icons/full/obj16/error_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PATH_WARNING = "icons/full/obj16/warning_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_PATH_BLANK = "icons/full/obj16/blank.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_WARNING = IMAGE_PATH_WARNING;
-
- public static final String IMAGE_ERROR = IMAGE_PATH_ERROR;
-
- public static final String IMAGE_EMPTY = IMAGE_PATH_BLANK;
-
- public static final String IMAGE_XML_ELEMENT = "icons/full/obj16/element_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XML_ATTRIBUTE = "icons/full/obj16/attribute_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_MAPPING_LINE = "icons/full/obj16/mapping_line.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_BINDING_LINE = "icons/full/obj16/binding_line.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_UNKNOWN_OBJ = "icons/full/obj16/unknown_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_JAVA_FILE = "icons/full/obj16/jcu_obj.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_CSV_FILE = "icons/full/obj16/csvfile.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XML_FILE = "icons/full/obj16/XMLFile.gif"; //$NON-NLS-1$
-
- public static final String IMAGE_XSD_FILE = "icons/full/obj16/XSDFile.gif"; //$NON-NLS-1$
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFieldMarker.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFieldMarker.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFieldMarker.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- *
- */
-public interface IFieldMarker {
-
- int TYPE_ERROR = 1;
-
- int TYPE_WARINING = 2;
-
- int TYPE_NONE = 0;
-
- void setMessage(String message);
-
- void setMarkerType(int type);
-
- int getMarkerType();
-
- String getMessage();
-
- void clean();
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFilePathProcessor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFilePathProcessor.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IFilePathProcessor.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,16 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.core.resources.IFile;
-
-/**
- * @author DartPeng
- *
- */
-public interface IFilePathProcessor {
- String processWorkBenchPath(IFile file);
-
- String processFileSystemPath(String filePath);
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IXMLStructuredObject.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IXMLStructuredObject.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IXMLStructuredObject.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,25 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import java.util.List;
-
-/**
- * @author Dart
- *
- */
-public interface IXMLStructuredObject {
-
- public String getNodeName();
-
- public List<IXMLStructuredObject> getChildren();
-
- public IXMLStructuredObject getParent();
-
- public Object getID();
-
- public boolean isRootNode();
-
- public boolean isAttribute();
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Messages.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Messages.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Messages.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,93 +0,0 @@
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.configuration.editors.messages"; //$NON-NLS-1$
- public static String ChildrenSelectionWizardPage_selectchilderror;
- public static String ChildrenSelectionWizardPage_wizardtitle;
- public static String FileSelectionWizard_WizardPageName;
- public static String FileSelectionWizard_WizardTitle;
- public static String FileSelectionWizardPage_PageDescription;
- public static String FileSelectionWizardPage_PageTitle;
- public static String ModelChildrenTablePanelCreator_DownButtonLable;
- public static String ModelChildrenTablePanelCreator_NewButtonLabel;
- public static String ModelChildrenTablePanelCreator_PropertiesButtonLabel;
- public static String ModelChildrenTablePanelCreator_RemoveButtonLabel;
- public static String ModelChildrenTablePanelCreator_UpButtonLabel;
- public static String NewOrModifySmooksElementDialog_CloseButtonLabel;
- public static String PropertyUICreator_browsebutton;
- public static String PropertyUICreator_namelabel;
- public static String PropertyUICreator_nslabel;
- public static String SelectorCreationDialog_AddInputLinkLabel;
- public static String SelectorCreationDialog_DialogTitle;
- public static String SelectorCreationDialog_FullPathPolicy;
- public static String SelectorCreationDialog_InputViewerlabel;
- public static String SelectorCreationDialog_OnlyNamePolicy;
- public static String SelectorCreationDialog_PolicyLabel;
- public static String SelectorCreationDialog_SperatorCharlabel;
- public static String SmooksActionBarContributor_33;
- public static String SmooksActionBarContributor_AddSmooksReasourceActionLabel;
- public static String SmooksActionBarContributor_AddSmooksResourceActionLabel;
- public static String SmooksActionBarContributor_CreateSiblingActionLabel;
- public static String SmooksActionBarContributor_NewSiblingActionLabel;
- public static String SmooksActionBarContributor_OpenProperyViewActionLabel;
- public static String SmooksActionBarContributor_RefreshViewActionLabel;
- public static String SmooksActionBarContributor_ValidateActionLabel;
- public static String SmooksConfigFileHandle_exception;
- public static String SmooksConfigurationOverviewPage_ConfigurationSectionTitle;
- public static String SmooksConfigurationOverviewPage_FilterSettingSectionTitle;
- public static String SmooksConfigurationOverviewPage_FilterTypeLabel;
- public static String SmooksConfigurationOverviewPage_SerializationLabel;
- public static String SmooksConfigurationOverviewPage_VersionLabel;
- public static String SmooksConfigurationReaderPage_AddInputButtonLabel;
- public static String SmooksConfigurationReaderPage_DeleteInputButtonLabel;
- public static String SmooksConfigurationReaderPage_EditReaderDes;
- public static String SmooksConfigurationReaderPage_InputSectionTitle;
- public static String SmooksConfigurationReaderPage_InputTableExtensionLabel;
- public static String SmooksConfigurationReaderPage_InputTablePathColumnLabel;
- public static String SmooksConfigurationReaderPage_InputTableTypeColumnText;
- public static String SmooksConfigurationReaderPage_NewReaderDes;
- public static String SmooksConfigurationReaderPage_NewReaderTitle;
- public static String SmooksConfigurationReaderPage_PageTitle;
- public static String SmooksConfigurationReaderPage_ReaderSectionTitle;
- public static String SmooksConfigurationResourceConfigPage_FormTitle;
- public static String SmooksConfigurationResourceConfigPage_SectionTitle;
- public static String SmooksMasterDetailBlock_AddButtonLabel;
- public static String SmooksMasterDetailBlock_DownButtonLabel;
- public static String SmooksMasterDetailBlock_RemoveButtonlabel;
- public static String SmooksMasterDetailBlock_UpButtonLabel;
- public static String SmooksMultiFormEditor_opetiontab_label;
- public static String SmooksMultiFormEditor_optinepage_name;
- public static String SmooksMultiFormEditor_processpage_name;
- public static String SmooksMultiFormEditor_processtabel_label;
- public static String SmooksReaderFormPage_AddButtonLabel;
- public static String SmooksReaderFormPage_CantFindTypeErrorTitle;
- public static String SmooksReaderFormPage_DeleteButtonLabel;
- public static String SmooksReaderFormPage_Error_Creating_Input_Model;
- public static String SmooksReaderFormPage_Input_Error;
- public static String SmooksReaderFormPage_InputConfigurationSectionDes;
- public static String SmooksReaderFormPage_InputConfigurationSectionTitle;
- public static String SmooksReaderFormPage_InputDataSectionDes;
- public static String SmooksReaderFormPage_InputDataSectionTitle;
- public static String SmooksReaderFormPage_InputSectionTitle;
- public static String SmooksReaderFormPage_InputTypeLabel;
- public static String SmooksReaderFormPage_InputTypeSectionTitle;
- public static String SmooksReaderFormPage_JavaReaderComboText;
- public static String SmooksReaderFormPage_NoInputComboText;
- public static String SmooksReaderFormPage_OpenFileErrorTitle;
- public static String SmooksReaderFormPage_PathColumnText;
- public static String SmooksReaderFormPage_RefreshLinkLabel;
- public static String SmooksReaderFormPage_TypeColumnText;
- public static String SmooksReaderFormPage_Warning_Specify_Input_Type;
- public static String SmooksReaderFormPage_Warning_Specify_Sample_Data;
- public static String SmooksReaderFormPage_XMLReaderComboText;
- public static String SmooksReaderFormPage_XSDReaderComboText;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,35 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-
-/**
- * @author Dart
- *
- */
-public class SelectorAttributes {
- public static final String ONLY_NAME = "only_name"; //$NON-NLS-1$
-
- public static final String FULL_PATH = "full_path"; //$NON-NLS-1$
-
- public static final String IGNORE_ROOT = "ignore_root"; //$NON-NLS-1$
-
- public static final String INCLUDE_PARENT = "include_parent"; //$NON-NLS-1$
- private String selectorSperator = "/"; //$NON-NLS-1$
- private String selectorPolicy = SelectorAttributes.FULL_PATH;
- public String getSelectorSperator() {
- return selectorSperator;
- }
- public void setSelectorSperator(String selectorSperator) {
- this.selectorSperator = selectorSperator;
- }
- public String getSelectorPolicy() {
- return selectorPolicy;
- }
- public void setSelectorPolicy(String selectorPolicy) {
- this.selectorPolicy = selectorPolicy;
- }
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigFileHandle.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXNotRecognizedException;
-import org.xml.sax.SAXNotSupportedException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * @author Dart dpeng(a)redhat.com
- *
- */
-public class SmooksConfigFileHandle extends DefaultHandler {
- private boolean correctContentFile = false;
-
- // private static final String SMOOKS_RESOURCE_LIST = "smooks-resource-list"; //$NON-NLS-1$
-
- private String[] smooksSpportURI = null;
-
- private SAXParserFactory fFactory;
-
- public SmooksConfigFileHandle() {
- super();
- smooksSpportURI = createSupportURI();
- }
-
- protected String[] createSupportURI() {
- return new String[] { "http://www.milyn.org/xsd/smooks-1.1.xsd",
- "http://www.milyn.org/xsd/smooks-1.0.xsd", "http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd" }; //$NON-NLS-1$
- }
-
- private final SAXParser createParser(SAXParserFactory parserFactory) throws ParserConfigurationException,
- SAXException, SAXNotRecognizedException, SAXNotSupportedException {
- // Initialize the parser.
- final SAXParser parser = parserFactory.newSAXParser();
- final XMLReader reader = parser.getXMLReader();
- // disable DTD validation
- try {
- reader.setFeature("http://xml.org/sax/features/validation", false); //$NON-NLS-1$
- reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
- } catch (SAXNotRecognizedException e) {
- } catch (SAXNotSupportedException e) {
- }
- return parser;
- }
-
- private SAXParserFactory getFactory() {
- synchronized (this) {
- if (fFactory != null) {
- return fFactory;
- }
- fFactory = SAXParserFactory.newInstance();
- fFactory.setNamespaceAware(true);
- }
- return fFactory;
- }
-
- public boolean parseContents(InputSource contents) throws ParserConfigurationException, IOException {
- try {
- fFactory = getFactory();
- if (fFactory == null) {
- return false;
- }
- final SAXParser parser = createParser(fFactory);
- contents.setSystemId("/"); //$NON-NLS-1$
- parser.parse(contents, this);
- } catch (SAXException e) {
- // stop parsing
- }
- return true;
- }
-
- /*
- * Resolve external entity definitions to an empty string. This is to speed
- * up processing of files with external DTDs. Not resolving the contents of
- * the DTD is ok, as only the System ID of the DTD declaration is used.
- *
- * @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String,
- * java.lang.String)
- */
- public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
- return new InputSource(new StringReader("")); //$NON-NLS-1$
- }
-
- @Override
- public void startPrefixMapping(String prefix, String uri) throws SAXException {
- super.startPrefixMapping(prefix, uri);
- if (containtSmooksURI(uri)) {
- setCorrectContentFile(true);
- throw new SAXException(Messages.SmooksConfigFileHandle_exception);
- }
- }
-
- private boolean unSupportUIR(String uri) {
- // if (EdiPackage.eNS_URI.equals(uri)) {
- // return true;
- // }
- return false;
- }
-
- private boolean containtSmooksURI(String uri) {
- for (int i = 0; i < smooksSpportURI.length; i++) {
- if (uri != null) {
- if (uri.trim().equalsIgnoreCase(smooksSpportURI[i])) {
- return true;
- }
- }
- }
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.xml.sax.ContentHandler#startElement(java.lang.String,
- * java.lang.String, java.lang.String, org.xml.sax.Attributes)
- */
- public final void startElement(final String uri, final String elementName, final String qualifiedName,
- final Attributes attributes) throws SAXException {
- if (isCorrectContentFile()) {
- throw new SAXException(Messages.SmooksConfigFileHandle_exception);
- }
- if (containtSmooksURI(uri)) {
- setCorrectContentFile(true);
- throw new SAXException(Messages.SmooksConfigFileHandle_exception);
- }
- }
-
- public boolean isCorrectContentFile() {
- return correctContentFile;
- }
-
- public void setCorrectContentFile(boolean correctContentFile) {
- this.correctContentFile = correctContentFile;
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigfileContentDescriber.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigfileContentDescriber.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigfileContentDescriber.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-import org.xml.sax.InputSource;
-
-/**
- * @author Dart (dpeng(a)redhat.com) note : Many codes comes from
- * org.eclipse.core.internal.content.XMLConentDescriber
- */
-public class SmooksConfigfileContentDescriber implements ITextContentDescriber, IExecutableExtension {
-
- private static final QualifiedName[] SUPPORTED_OPTIONS = new QualifiedName[] { IContentDescription.CHARSET,
- IContentDescription.BYTE_ORDER_MARK };
-
- private static final String ENCODING = "encoding="; //$NON-NLS-1$
-
- private static final String XML_PREFIX = "<?xml "; //$NON-NLS-1$
-
- /**
- *
- */
- public SmooksConfigfileContentDescriber() {
- // TODO Auto-generated constructor stub
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
- throws CoreException {
-
- }
-
- public int describeXMLFile(InputStream input, IContentDescription description) throws IOException {
- byte[] bom = getByteOrderMark(input);
- String xmlDeclEncoding = "UTF-8"; //$NON-NLS-1$
- input.reset();
- if (bom != null) {
- if (bom == IContentDescription.BOM_UTF_16BE)
- xmlDeclEncoding = "UTF-16BE"; //$NON-NLS-1$
- else if (bom == IContentDescription.BOM_UTF_16LE)
- xmlDeclEncoding = "UTF-16LE"; //$NON-NLS-1$
- // skip BOM to make comparison simpler
- input.skip(bom.length);
- // set the BOM in the description if requested
- if (description != null && description.isRequested(IContentDescription.BYTE_ORDER_MARK))
- description.setProperty(IContentDescription.BYTE_ORDER_MARK, bom);
- }
- byte[] xmlPrefixBytes = XML_PREFIX.getBytes(xmlDeclEncoding);
- byte[] prefix = new byte[xmlPrefixBytes.length];
- if (input.read(prefix) < prefix.length)
- // there is not enough info to say anything
- return INDETERMINATE;
- for (int i = 0; i < prefix.length; i++)
- if (prefix[i] != xmlPrefixBytes[i])
- // we don't have a XMLDecl... there is not enough info to say
- // anything
- return INDETERMINATE;
- if (description == null)
- return VALID;
- // describe charset if requested
- if (description.isRequested(IContentDescription.CHARSET)) {
- String fullXMLDecl = readFullXMLDecl(input, xmlDeclEncoding);
- if (fullXMLDecl != null) {
- String charset = getCharset(fullXMLDecl);
- if (charset != null && !"UTF-8".equalsIgnoreCase(charset)) //$NON-NLS-1$
- // only set property if value is not default (avoid using a
- // non-default content description)
- description.setProperty(IContentDescription.CHARSET, getCharset(fullXMLDecl));
- }
- }
- return VALID;
- }
-
- public int describeXMLType(Reader input, IContentDescription description) throws IOException {
- BufferedReader reader = new BufferedReader(input);
- String line = reader.readLine();
- // end of stream
- if (line == null)
- return INDETERMINATE;
- // XMLDecl should be the first string (no blanks allowed)
- if (!line.startsWith(XML_PREFIX))
- return INDETERMINATE;
- if (description == null)
- return VALID;
- // describe charset if requested
- if ((description.isRequested(IContentDescription.CHARSET)))
- description.setProperty(IContentDescription.CHARSET, getCharset(line));
- return VALID;
- }
-
- public int describe(InputStream input, IContentDescription description) throws IOException {
- if (this.describeXMLFile(input, description) == INVALID) {
- return INVALID;
- }
- input.reset();
- return checkCriteria(new InputSource(input));
- }
-
- private String readFullXMLDecl(InputStream input, String unicodeEncoding) throws IOException {
- byte[] xmlDecl = new byte[100];
- int c = 0;
- // looks for XMLDecl ending char (?)
- int read = 0;
- while (read < xmlDecl.length && (c = input.read()) != -1 && c != '?')
- xmlDecl[read++] = (byte) c;
- return c == '?' ? new String(xmlDecl, 0, read, unicodeEncoding) : null;
- }
-
- public int describe(Reader input, IContentDescription description) throws IOException {
- if (this.describeXMLType(input, description) == INVALID) {
- return INVALID;
- }
- input.reset();
- return checkCriteria(new InputSource(input));
- }
-
- protected SmooksConfigFileHandle createHandle(){
- return new SmooksConfigFileHandle();
- }
-
- /**
- * To check the namespaces of the file
- *
- * @param contents
- * @return
- * @throws IOException
- */
- private int checkCriteria(InputSource contents) throws IOException {
- SmooksConfigFileHandle handle = createHandle();
- try {
- if (!handle.parseContents(contents)) {
- return INDETERMINATE;
- }
- } catch (ParserConfigurationException e) {
- return INDETERMINATE;
- }
- if (handle.isCorrectContentFile()) {
- return VALID;
- }
- return INDETERMINATE;
- }
-
- private String getCharset(String firstLine) {
- int encodingPos = firstLine.indexOf(ENCODING);
- if (encodingPos == -1)
- return null;
- char quoteChar = '"';
- int firstQuote = firstLine.indexOf(quoteChar, encodingPos);
- if (firstQuote == -1) {
- quoteChar = '\'';
- firstQuote = firstLine.indexOf(quoteChar, encodingPos);
- }
- if (firstQuote == -1 || firstLine.length() == firstQuote - 1)
- return null;
- int secondQuote = firstLine.indexOf(quoteChar, firstQuote + 1);
- if (secondQuote == -1)
- return null;
- return firstLine.substring(firstQuote + 1, secondQuote);
- }
-
- public QualifiedName[] getSupportedOptions() {
- return SUPPORTED_OPTIONS;
- }
-
- byte[] getByteOrderMark(InputStream input) throws IOException {
- int first = input.read();
- if (first == 0xEF) {
- // look for the UTF-8 Byte Order Mark (BOM)
- int second = input.read();
- int third = input.read();
- if (second == 0xBB && third == 0xBF)
- return IContentDescription.BOM_UTF_8;
- } else if (first == 0xFE) {
- // look for the UTF-16 BOM
- if (input.read() == 0xFF)
- return IContentDescription.BOM_UTF_16BE;
- } else if (first == 0xFF) {
- if (input.read() == 0xFE)
- return IContentDescription.BOM_UTF_16LE;
- }
- return null;
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,54 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.ui.PartInitException;
-import org.jboss.tools.smooks.dbm.editor.SmooksConfigurationFormPage;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-import org.jboss.tools.smooks.graphical.editors.SmooksProcessGraphicalEditor;
-
-/**
- * @author Dart
- *
- */
-public class SmooksMultiFormEditor extends AbstractSmooksFormEditor {
-
- private SmooksConfigurationFormPage optionsPage;
-
- @Override
- protected void addPages() {
-
- addProcessGraphicalEditor();
-
- optionsPage = createSmooksConfigurationOverviewPage();
- addSourceSynchronizeListener(optionsPage);
- addSmooksEditorInitListener(optionsPage);
- try {
- int index = this.addPage(optionsPage);
- setPageText(index, Messages.SmooksMultiFormEditor_opetiontab_label);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
-
- super.addPages();
- }
-
- private SmooksConfigurationFormPage createSmooksConfigurationOverviewPage() {
- return new SmooksConfigurationFormPage(this,
- "options_page", Messages.SmooksMultiFormEditor_optinepage_name, this); //$NON-NLS-1$
- }
- private void addProcessGraphicalEditor() {
- SmooksProcessGraphicalEditor processPage = new SmooksProcessGraphicalEditor(this,
- "process", Messages.SmooksMultiFormEditor_processpage_name, this); //$NON-NLS-1$
-// addSourceSynchronizeListener(processPage);
-// addValidateListener(processPage);
-// addSmooksEditorInitListener(processPage);
- try {
- int index = this.addPage(processPage);
- setPageText(index, Messages.SmooksMultiFormEditor_processtabel_label);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiPageEditorContributor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiPageEditorContributor.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiPageEditorContributor.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,77 +0,0 @@
-package org.jboss.tools.smooks.configuration.editors;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-import org.jboss.tools.smooks.graphical.actions.ISmooksActionProvider;
-
-/**
- * Manages the installation/deinstallation of global actions for multi-page editors.
- * Responsible for the redirection of global actions to the active editor.
- * Multi-page contributor replaces the contributors for the individual editors in the multi-page editor.
- */
-public class SmooksMultiPageEditorContributor extends MultiPageEditorActionBarContributor {
- private IEditorPart activeEditorPart;
- /**
- * Creates a multi-page contributor.
- */
- public SmooksMultiPageEditorContributor() {
- super();
- }
-
-
- protected IAction getAction(IEditorPart editor , String actionID){
- if(editor instanceof ISmooksActionProvider){
- return ((ISmooksActionProvider)editor).getAction(actionID);
- }
- return null;
- }
-
- /* (non-JavaDoc)
- * Method declared in AbstractMultiPageEditorActionBarContributor.
- */
-
- public void setActivePage(IEditorPart part) {
- if (activeEditorPart == part)
- return;
- activeEditorPart = part;
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
-
- IEditorPart editor = activeEditorPart;
-
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
- getAction(editor, ITextEditorActionConstants.DELETE));
- actionBars.setGlobalActionHandler(
- ActionFactory.UNDO.getId(),
- getAction(editor, ITextEditorActionConstants.UNDO));
- actionBars.setGlobalActionHandler(
- ActionFactory.REDO.getId(),
- getAction(editor, ITextEditorActionConstants.REDO));
- actionBars.updateActionBars();
- }
- }
-// private void createActions() {
-// sampleAction = new Action() {
-// public void run() {
-// MessageDialog.openInformation(null, "Configuration Plug-in", "Sample Action Executed"); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-// };
-// sampleAction.setText("Sample Action"); //$NON-NLS-1$
-// sampleAction.setToolTipText("Sample Action tool tip"); //$NON-NLS-1$
-// sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
-// getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
-// }
-// public void contributeToMenu(IMenuManager manager) {
-// IMenuManager menu = new MenuManager("Editor &Menu"); //$NON-NLS-1$
-// manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
-// menu.add(sampleAction);
-// }
-// public void contributeToToolBar(IToolBarManager manager) {
-// manager.add(new Separator());
-// manager.add(sampleAction);
-// }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.ui.forms.IDetailsPage;
-import org.eclipse.ui.forms.IDetailsPageProvider;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- * <p>
- * Apr 7, 2009
- */
-public class SmooksStuffDetailsPageProvider implements IDetailsPageProvider {
- private Map<Object, IDetailsPage> pages = new HashMap<Object, IDetailsPage>();
-
- public void registePage(Object key , IDetailsPage page){
- pages.put(key, page);
- }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.IDetailsPageProvider#getPage(java.lang.Object)
- */
- public IDetailsPage getPage(Object key) {
- return pages.get(key);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.forms.IDetailsPageProvider#getPageKey(java.lang.Object)
- */
- public Object getPageKey(Object object) {
- if(object instanceof EObject){
- return EObject.class;
- }
- return object.getClass();
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksToolsStartup.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksToolsStartup.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksToolsStartup.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors;
-
-import org.eclipse.ui.IStartup;
-
-/**
- * @author Dart (dpeng(a)redhat.com)<p>
- * Apr 12, 2009
- */
-public class SmooksToolsStartup implements IStartup {
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IStartup#earlyStartup()
- */
- public void earlyStartup() {
-// ResourcesPlugin.getWorkspace().addResourceChangeListener(new SmooksResourceChangeListener());
- }
-
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksXMLEditor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksXMLEditor.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksXMLEditor.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * @author Dart Peng (dpeng(a)redhat.com)
- * Date Apr 1, 2009
- */
-public class SmooksXMLEditor extends StructuredTextEditor {
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.sse.ui.StructuredTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
- */
- @Override
- public void doSetInput(IEditorInput input) throws CoreException {
- // TODO Auto-generated method stub
- super.doSetInput(input);
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/StructuredDataSelectionWizardDailog.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.smooks.configuration.editors;
-
-import java.util.Properties;
-
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard;
-
-/**
- * @author Dart Peng
- * @Date Aug 6, 2008
- */
-public class StructuredDataSelectionWizardDailog extends WizardDialog {
-
- private String type = null;
-
- private String path = null;
-
- private Properties properties = null;
-
- public StructuredDataSelectionWizardDailog(Shell parentShell, IWizard newWizard) {
- super(parentShell, newWizard);
- }
-
- public IStructuredDataSelectionWizard getCurrentCreationWizard() {
- IWizard w = getWizard();
- if (w != null && w instanceof IStructuredDataSelectionWizard) {
- return (IStructuredDataSelectionWizard) w;
- }
- return null;
- }
-
- // public SmooksMultiFormEditor getFormEditor() {
- // return formEditor;
- // }
- //
- // public void setFormEditor(SmooksMultiFormEditor formEditor) {
- // this.formEditor = formEditor;
- // }
-
- public int show() {
- int openResult = this.open();
- if (openResult == WizardDialog.OK) {
- IStructuredDataSelectionWizard wizard1 = this.getCurrentCreationWizard();
- type = wizard1.getInputDataTypeID();
- path = wizard1.getStructuredDataSourcePath();
- properties = wizard1.getProperties();
- }
- return openResult;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public Properties getProperties() {
- return properties;
- }
-
- public void setProperties(Properties properties) {
- this.properties = properties;
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/Template.txt 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.smooks.configuration.editors.uitls.temp;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
-import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.model.javabean.BindingsType;
-import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
-
-/**
- * @author Dart Peng (dpeng(a)redhat.com) Date Apr 10, 2009
- */
-public class ${className} extends PropertyUICreator {
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
- * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
- * org.eclipse.swt.widgets.Composite,
- * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
- * org.eclipse.emf.ecore.EAttribute)
- */
- public Composite createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature ,SmooksMultiFormEditor formEditor) {
- ${attributeMethod}
- return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
- }
-
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/messages.properties 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,79 +0,0 @@
-ChildrenSelectionWizardPage_selectchilderror=Please choose a child type
-ChildrenSelectionWizardPage_wizardtitle=Select a Child's Type
-FileSelectionWizard_WizardPageName=File Selection
-FileSelectionWizard_WizardTitle=File Selection
-FileSelectionWizardPage_PageDescription=Select the file from workspace or from file system.
-FileSelectionWizardPage_PageTitle=File Selection
-ModelChildrenTablePanelCreator_DownButtonLable=Down
-ModelChildrenTablePanelCreator_NewButtonLabel=New
-ModelChildrenTablePanelCreator_PropertiesButtonLabel=Properties..
-ModelChildrenTablePanelCreator_RemoveButtonLabel=Remove
-ModelChildrenTablePanelCreator_UpButtonLabel=Up
-NewOrModifySmooksElementDialog_CloseButtonLabel=Close
-PropertyUICreator_browsebutton=Browse
-PropertyUICreator_namelabel=Name
-PropertyUICreator_nslabel=Namespace
-SelectorCreationDialog_AddInputLinkLabel=Click to add Input Data
-SelectorCreationDialog_DialogTitle=Selector generate dialog
-SelectorCreationDialog_FullPathPolicy=Full Path
-SelectorCreationDialog_InputViewerlabel=Input Message:
-SelectorCreationDialog_OnlyNamePolicy=Only Name
-SelectorCreationDialog_PolicyLabel=Selector generate policy :
-SelectorCreationDialog_SperatorCharlabel=Sperator Char :
-SmooksActionBarContributor_33=
-SmooksActionBarContributor_AddSmooksReasourceActionLabel=Add Smooks Resource
-SmooksActionBarContributor_AddSmooksResourceActionLabel=Add Smooks Resource
-SmooksActionBarContributor_CreateSiblingActionLabel=Create Sibling
-SmooksActionBarContributor_NewSiblingActionLabel=New Sibling
-SmooksActionBarContributor_OpenProperyViewActionLabel=Show Properties
-SmooksActionBarContributor_RefreshViewActionLabel=Refresh Viewer
-SmooksActionBarContributor_ValidateActionLabel=Validate
-SmooksConfigFileHandle_exception=Stop parsing
-SmooksConfigurationOverviewPage_ConfigurationSectionTitle=Smooks configuration
-SmooksConfigurationOverviewPage_FilterSettingSectionTitle=Filter Settings
-SmooksConfigurationOverviewPage_FilterTypeLabel=Stream Filter Type:
-SmooksConfigurationOverviewPage_SerializationLabel=Default Serialization is On:
-SmooksConfigurationOverviewPage_VersionLabel=Smooks Platform Version :
-SmooksConfigurationReaderPage_AddInputButtonLabel=Add
-SmooksConfigurationReaderPage_DeleteInputButtonLabel=Delete
-SmooksConfigurationReaderPage_EditReaderDes=Edit the smooks readers
-SmooksConfigurationReaderPage_InputSectionTitle=Input Data
-SmooksConfigurationReaderPage_InputTableExtensionLabel=Extension Paramers
-SmooksConfigurationReaderPage_InputTablePathColumnLabel=Path
-SmooksConfigurationReaderPage_InputTableTypeColumnText=Type
-SmooksConfigurationReaderPage_NewReaderDes=create new smooks reader
-SmooksConfigurationReaderPage_NewReaderTitle=New Smooks Reader
-SmooksConfigurationReaderPage_PageTitle=Reader/Input
-SmooksConfigurationReaderPage_ReaderSectionTitle=Reader
-SmooksConfigurationResourceConfigPage_FormTitle=Message Filter
-SmooksConfigurationResourceConfigPage_SectionTitle=Message Filtering Resources
-SmooksMasterDetailBlock_AddButtonLabel=Add...
-SmooksMasterDetailBlock_DownButtonLabel=Down
-SmooksMasterDetailBlock_RemoveButtonlabel=Remove
-SmooksMasterDetailBlock_UpButtonLabel=Up
-SmooksMultiFormEditor_opetiontab_label=Options
-SmooksMultiFormEditor_optinepage_name=Options
-SmooksMultiFormEditor_processpage_name=Processing
-SmooksMultiFormEditor_processtabel_label=Process
-SmooksReaderFormPage_AddButtonLabel=Add
-SmooksReaderFormPage_CantFindTypeErrorTitle=Can't find type
-SmooksReaderFormPage_DeleteButtonLabel=Delete
-SmooksReaderFormPage_Error_Creating_Input_Model=Check Input Task configuration. Error creating Input Model from Sample Input Data. Error: "
-SmooksReaderFormPage_Input_Error=Input Error
-SmooksReaderFormPage_InputConfigurationSectionDes=Specify reader details
-SmooksReaderFormPage_InputConfigurationSectionTitle=Input Configuration
-SmooksReaderFormPage_InputDataSectionDes=Select a sample data file
-SmooksReaderFormPage_InputDataSectionTitle=Input Data
-SmooksReaderFormPage_InputSectionTitle=Input Model View
-SmooksReaderFormPage_InputTypeLabel=Input Type:
-SmooksReaderFormPage_InputTypeSectionTitle=Input Type
-SmooksReaderFormPage_JavaReaderComboText=Java
-SmooksReaderFormPage_NoInputComboText=No Input
-SmooksReaderFormPage_OpenFileErrorTitle=Open File
-SmooksReaderFormPage_PathColumnText=Path
-SmooksReaderFormPage_RefreshLinkLabel=Refresh
-SmooksReaderFormPage_TypeColumnText=Type
-SmooksReaderFormPage_Warning_Specify_Input_Type=Input type should be specified.
-SmooksReaderFormPage_Warning_Specify_Sample_Data=Specify sample data in the Input Data section.
-SmooksReaderFormPage_XMLReaderComboText=XML
-SmooksReaderFormPage_XSDReaderComboText=XSD/WSDL
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/ExceptionHandler.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,124 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
-*
- * Contributors:
- * IBM Corporation - initial API and implementation
- */
-package org.jboss.tools.smooks.launch;
-
-import java.io.StringWriter;
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-
-/**
- * The default exception handler shows an error dialog when one of its handle methods
- * is called. If the passed exception is a <code>CoreException</code> an error dialog
- * pops up showing the exception's status information. For a <code>InvocationTargetException</code>
- * a normal message dialog pops up showing the exception's message. Additionally the exception
- * is written to the platform log.
- *
- * TO DO: this class is duplicated from org.eclipse.jdt.ui
- */
-public class ExceptionHandler {
-
- private static ExceptionHandler fgInstance= new ExceptionHandler();
-
- /**
- * Handles the given <code>CoreException</code>. The workbench shell is used as a parent
- * for the dialog window.
- *
- * @param e the <code>CoreException</code> to be handled
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(CoreException e, String title, String message) {
- handle(e, SmooksConfigurationActivator.getActiveWorkbenchShell(), title, message);
- }
-
- /**
- * Handles the given <code>CoreException</code>.
- *
- * @param e the <code>CoreException</code> to be handled
- * @param parent the dialog window's parent shell or <code>null</code>
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(CoreException e, Shell parent, String title, String message) {
- fgInstance.perform(e, parent, title, message);
- }
-
- /**
- * Handles the given <code>InvocationTargetException</code>.
- *
- * @param e the <code>InvocationTargetException</code> to be handled
- * @param parent the dialog window's parent shell or <code>null</code>
- * @param title the dialog window's window title
- * @param message message to be displayed by the dialog window
- */
- public static void handle(InvocationTargetException e, Shell parent, String title, String message) {
- fgInstance.perform(e, parent, title, message);
- }
-
- //---- Hooks for subclasses to control exception handling ------------------------------------
-
- protected void perform(CoreException e, Shell shell, String title, String message) {
- SmooksConfigurationActivator.log(e);
- IStatus status= e.getStatus();
- if (status != null) {
- ErrorDialog.openError(shell, title, message, status);
- } else {
- displayMessageDialog(e.getMessage(), shell, title, message);
- }
- }
-
- protected void perform(InvocationTargetException e, Shell shell, String title, String message) {
- Throwable target= e.getTargetException();
- if (target instanceof CoreException) {
- perform((CoreException)target, shell, title, message);
- } else {
- SmooksConfigurationActivator.log(e);
- if (e.getMessage() != null && e.getMessage().length() > 0) {
- displayMessageDialog(e.getMessage(), shell, title, message);
- } else {
- displayMessageDialog(target.getMessage(), shell, title, message);
- }
- }
- }
-
- private void displayMessageDialog(String exceptionMessage, Shell shell, String title, String message) {
- StringWriter msg= new StringWriter();
- if (message != null) {
- msg.write(message);
- msg.write("\n\n"); //$NON-NLS-1$
- }
- if (exceptionMessage == null || exceptionMessage.length() == 0)
- msg.write(Messages.ExceptionHandler_Exception_Msg);
- else
- msg.write(exceptionMessage);
- MessageDialog.openError(shell, title, msg.toString());
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/Messages.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/Messages.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/Messages.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,45 +0,0 @@
-package org.jboss.tools.smooks.launch;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.smooks.launch.messages"; //$NON-NLS-1$
- public static String ExceptionHandler_Exception_Msg;
- public static String SmooksLaunchConfigurationDelegate_11;
- public static String SmooksLaunchConfigurationDelegate_Error_Copying_Smooks_Launcher;
- public static String SmooksLaunchConfigurationDelegate_Error_launching;
- public static String SmooksLaunchConfigurationDelegate_Error_missing_artifact;
- public static String SmooksLaunchConfigurationDelegate_Error_missing_artifact2;
- public static String SmooksLaunchConfigurationDelegate_Error_Title;
- public static String SmooksLauncher_Error_Do_Not_Support_Java_Inputs;
- public static String SmooksLauncher_Templating_To_StreamResult;
- public static String SmooksLauncher_Java_Mapping_Results;
- public static String SmooksLauncher_Nothing_To_Display;
- public static String SmooksLauncher_Error_Expected_Four_Args;
- public static String SmooksLaunchShortcut_Exception_Occurred;
- public static String SmooksLaunchShortcut_Message_Select_Config;
- public static String SmooksLaunchShortcut_Title_Launch_Failed;
- public static String SmooksLaunchShortcut_Title_Select_Config;
- public static String SmooksRunTab_Button_Browse;
- public static String SmooksRunTab_Button_Search;
- public static String SmooksRunTab_Dialog_Title_Select_Config;
- public static String SmooksRunTab_Error_Invalid_Project_Name;
- public static String SmooksRunTab_Error_Need_Project_Name;
- public static String SmooksRunTab_Error_Not_A_Java_Project;
- public static String SmooksRunTab_Error_Not_A_Java_Project2;
- public static String SmooksRunTab_Error_Smooks_Configuration_Missing;
- public static String SmooksRunTab_Error_Unknown_Project_Name;
- public static String SmooksRunTab_Error_Validation;
- public static String SmooksRunTab_Label_Configuration;
- public static String SmooksRunTab_Label_Project;
- public static String SmooksRunTab_Message_Select_Config;
- public static String SmooksRunTab_Tab_Name;
- public static String SmooksRunTab_Title_Select_Config;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchConfigurationDelegate.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,260 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.launch;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate;
-import org.eclipse.jdt.launching.ExecutionArguments;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IVMRunner;
-import org.eclipse.jdt.launching.VMRunnerConfiguration;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.smooks.configuration.ProcessNodeType;
-import org.jboss.tools.smooks.configuration.RuntimeDependency;
-import org.jboss.tools.smooks.configuration.RuntimeMetadata;
-import org.jboss.tools.smooks.core.SmooksInputType;
-import org.jboss.tools.smooks.launch.serialize.MarshallingStrategy;
-import org.jboss.tools.smooks.launch.serialize.ObjectSerializer;
-import org.jboss.tools.smooks.launch.serialize.XPathMarshaller;
-
-/**
- * Smooks Launch Configuration Delegate.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksLaunchConfigurationDelegate extends JUnitLaunchConfigurationDelegate {
-
- private static final String PLUGIN_ID = "org.jboss.tools.smooks.ui.smooksLauncher"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor)
- */
- public void launch(ILaunchConfiguration launchConfig, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- IJavaProject javaProject = getJavaProject(launchConfig);
- IProject project = javaProject.getProject();
- final String smooksConfigName = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ""); //$NON-NLS-1$
- String[] baseClasspath = getClasspath(launchConfig);
- final RuntimeMetadata launchMetadata = new RuntimeMetadata();
-
- launchMetadata.setSmooksConfig(project.findMember(smooksConfigName));
-
- if(!launchMetadata.isValidSmooksConfig()) {
- displayError(smooksConfigName, launchMetadata.getErrorMessage());
- return;
- } else {
- List<RuntimeDependency> dependencies = launchMetadata.getDependencies();
- URLClassLoader projectClassLoader = toURLClassLoader(baseClasspath);
-
- for(RuntimeDependency dependency : dependencies) {
- if(!dependency.isOnProjectClasspath(projectClassLoader)) {
- displayError(smooksConfigName, Messages.SmooksLaunchConfigurationDelegate_Error_missing_artifact + dependency.getGroupId() + ":" + dependency.getArtifactId() + Messages.SmooksLaunchConfigurationDelegate_Error_missing_artifact2); //$NON-NLS-1$
- return;
- }
- }
- }
-
- IVMRunner runner= getVMRunner(launchConfig, mode);
- VMRunnerConfiguration runConfig = buildRunnerConfig(launchConfig, baseClasspath);
-
- // check for cancellation
- if (monitor.isCanceled()) {
- return;
- }
-
- String inputType = launchMetadata.getInputType();
- String inputPath = launchMetadata.getInputFile().getAbsolutePath();
- String nodeTypes = launchMetadata.getNodeTypesString();
-
- runConfig.setProgramArguments(new String[] {launchMetadata.getConfigFile().getAbsolutePath(), inputType, inputPath, nodeTypes});
-
- runner.run(runConfig, launch, monitor);
- }
-
- private void displayError(final String smooksConfigName, final String errorMessage) {
- final Display display = PlatformUI.getWorkbench().getDisplay();
- display.syncExec(new Runnable() {
- public void run(){
- Shell shell = display.getActiveShell();
- ErrorDialog.openError(shell, Messages.SmooksLaunchConfigurationDelegate_Error_Title, Messages.SmooksLaunchConfigurationDelegate_Error_launching + smooksConfigName + "'.", new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, errorMessage, new Exception())); //$NON-NLS-1$
- }
- });
- }
-
- private VMRunnerConfiguration buildRunnerConfig(ILaunchConfiguration launchConfig, String[] baseClasspath) throws CoreException {
- List<String> classpath = new ArrayList<String>(Arrays.asList(baseClasspath));
-
- // We need to add the SmooksLauncher to the launch classpath because it will not be part of the projects
- // classpath. Bit of a hack... there's probably a nicer way of doing this!!!
- File wsTempClasses = copyLauncherResourcesToFilesys();
- classpath.add(wsTempClasses.getAbsolutePath());
-
- VMRunnerConfiguration runConfig= new VMRunnerConfiguration(SmooksLauncher.class.getName(), classpath.toArray(new String[classpath.size()]));
- String[] envp= getEnvironment(launchConfig);
- ArrayList<String> vmArguments= new ArrayList<String>();
- String vmArgs= getVMArguments(launchConfig);
- ExecutionArguments execArgs= new ExecutionArguments(vmArgs, ""); //$NON-NLS-1$
- File workingDir = verifyWorkingDirectory(launchConfig);
-
- vmArguments.addAll(Arrays.asList(execArgs.getVMArgumentsArray()));
- runConfig.setVMArguments((String[]) vmArguments.toArray(new String[vmArguments.size()]));
- runConfig.setEnvironment(envp);
- if(workingDir != null) {
- runConfig.setWorkingDirectory(workingDir.getAbsolutePath());
- }
- runConfig.setVMSpecificAttributesMap(getVMSpecificAttributesMap(launchConfig));
- runConfig.setBootClassPath(getBootpath(launchConfig));
-
- return runConfig;
- }
-
- private File copyLauncherResourcesToFilesys() throws CoreException {
- File wsRootDir = ResourcesPlugin.getWorkspace().getRoot().getRawLocation().toFile();
- File wsTempClasses = new File(wsRootDir, "temp/launcher/classes"); //$NON-NLS-1$
-
- writeClassToFilesys(SmooksLauncher.class, wsTempClasses);
- writeClassToFilesys(SmooksInputType.class, wsTempClasses);
- writeClassToFilesys(ProcessNodeType.class, wsTempClasses);
- writeClassToFilesys(ObjectSerializer.class, wsTempClasses);
- writeClassToFilesys(MarshallingStrategy.class, wsTempClasses);
- writeClassToFilesys(XPathMarshaller.class, wsTempClasses);
-
- // Need to send the localized message strings to the launcher...
- Properties localizedMessages = new Properties();
- localizedMessages.setProperty("SmooksLauncher_Error_Do_Not_Support_Java_Inputs", Messages.SmooksLauncher_Error_Do_Not_Support_Java_Inputs); //$NON-NLS-1$
- localizedMessages.setProperty("SmooksLauncher_Error_Expected_Four_Args", Messages.SmooksLauncher_Error_Expected_Four_Args); //$NON-NLS-1$
- localizedMessages.setProperty("SmooksLauncher_Java_Mapping_Results", Messages.SmooksLauncher_Java_Mapping_Results); //$NON-NLS-1$
- localizedMessages.setProperty("SmooksLauncher_Templating_To_StreamResult", Messages.SmooksLauncher_Templating_To_StreamResult); //$NON-NLS-1$
- localizedMessages.setProperty("SmooksLauncher_Nothing_To_Display", Messages.SmooksLauncher_Nothing_To_Display); //$NON-NLS-1$
-
- try {
- FileOutputStream messagesOutStream = getFilesysOutStream(SmooksLauncher.LOCALIZED_FILE_NAME, SmooksLauncher.class, wsTempClasses);
- try {
- localizedMessages.store(messagesOutStream, "Localized messages..."); //$NON-NLS-1$
- } finally {
- messagesOutStream.close();
- }
- } catch (IOException e) {
- new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, Messages.SmooksLaunchConfigurationDelegate_Error_Copying_Smooks_Launcher, e));
- }
-
- return wsTempClasses;
- }
-
- private void writeClassToFilesys(Class<?> theClass, File toDir) throws CoreException {
- String className = theClass.getSimpleName() + ".class"; //$NON-NLS-1$
- writeResourceToFilesys(className, theClass, toDir);
- }
-
- private void writeResourceToFilesys(String resource, Class<?> refClass, File toDir) {
- String packagePath = refClass.getPackage().getName().replace(".", "/"); //$NON-NLS-1$ //$NON-NLS-2$
- String resourcePath = "/" + packagePath + Messages.SmooksLaunchConfigurationDelegate_11 + resource; //$NON-NLS-1$
- URL resourceURI = refClass.getResource(resourcePath);
-
- if(resourceURI != null) {
- try {
- InputStream resourceStream = resourceURI.openStream();
-
- if(resourceStream != null) {
- try {
- File resourceOutFile = new File(toDir, resourcePath);
- File resourcePackage = resourceOutFile.getParentFile();
-
- resourcePackage.mkdirs();
- if(resourcePackage.exists()) {
- FileOutputStream resourceOutStream = new FileOutputStream(resourceOutFile);
-
- try {
- byte[] readBuf = new byte[100];
- int readCount = 0;
-
- while(readCount != -1) {
- readCount = resourceStream.read(readBuf);
- if(readCount != -1) {
- resourceOutStream.write(readBuf, 0, readCount);
- }
- }
- } finally {
- try {
- resourceOutStream.flush();
- } finally {
- resourceOutStream.close();
- }
- }
- }
- } finally {
- resourceStream.close();
- }
- }
- } catch (IOException e) {
- new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, Messages.SmooksLaunchConfigurationDelegate_Error_Copying_Smooks_Launcher, e));
- }
- }
- }
-
- private FileOutputStream getFilesysOutStream(String resource, Class<?> refClass, File toDir) throws FileNotFoundException {
- String packagePath = refClass.getPackage().getName().replace(".", "/"); //$NON-NLS-1$ //$NON-NLS-2$
- String resourcePath = "/" + packagePath + "/" + resource; //$NON-NLS-1$ //$NON-NLS-2$
- File resourceOutFile = new File(toDir, resourcePath);
- File resourcePackage = resourceOutFile.getParentFile();
-
- resourcePackage.mkdirs();
-
- return new FileOutputStream(resourceOutFile);
- }
-
- private URLClassLoader toURLClassLoader(String[] baseClasspath) {
- URL[] classPathURLs = new URL[baseClasspath.length];
-
- for(int i = 0; i < baseClasspath.length; i++) {
- try {
- File cpEntry = new File(baseClasspath[i]);
- classPathURLs[i] = cpEntry.toURL();
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- }
-
- return new URLClassLoader(classPathURLs);
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchShortcut.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,241 +0,0 @@
-package org.jboss.tools.smooks.launch;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugModelPresentation;
-import org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.part.FileEditorInput;
-import org.jboss.tools.smooks.configuration.RuntimeMetadata;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-
-public class SmooksLaunchShortcut extends JUnitLaunchShortcut {
-
- private static final String EMPTY_STRING= ""; //$NON-NLS-1$
-
- private Shell getShell() {
- return SmooksConfigurationActivator.getActiveWorkbenchShell();
- }
-
- private ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private List<ILaunchConfiguration> findExistingLaunchConfigurations(ILaunchConfigurationWorkingCopy temporary) throws CoreException {
- ILaunchConfigurationType configType= temporary.getType();
-
- ILaunchConfiguration[] configs= getLaunchManager().getLaunchConfigurations(configType);
- String[] attributeToCompare= getAttributeNamesToCompare();
-
- ArrayList<ILaunchConfiguration> candidateConfigs= new ArrayList<ILaunchConfiguration>(configs.length);
- for (int i= 0; i < configs.length; i++) {
- ILaunchConfiguration config= configs[i];
- if (hasSameAttributes(config, temporary, attributeToCompare)) {
- candidateConfigs.add(config);
- }
- }
- return candidateConfigs;
- }
-
- private static boolean hasSameAttributes(ILaunchConfiguration config1, ILaunchConfiguration config2, String[] attributeToCompare) {
- try {
- for (int i= 0; i < attributeToCompare.length; i++) {
- String val1= config1.getAttribute(attributeToCompare[i], EMPTY_STRING);
- String val2= config2.getAttribute(attributeToCompare[i], EMPTY_STRING);
- if (!val1.equals(val2)) {
- return false;
- }
- }
- return true;
- } catch (CoreException e) {
- // ignore access problems here, return false
- }
- return false;
- }
-
- public void launch(ISelection selection, String mode) {
- if (selection instanceof IStructuredSelection) {
- launch(((IStructuredSelection) selection).toArray(), mode);
- }
- }
-
- public void launch(IEditorPart editor, String mode) {
- if (editor.getEditorInput() != null && editor.getEditorInput() instanceof IFileEditorInput) {
- IFile file= ((IFileEditorInput)editor.getEditorInput()).getFile();
- if (file != null) {
- launch(new Object[] { file }, mode);
- }
- }
- }
-
- private void launch(Object[] elements, String mode) {
- try {
- IFile elementToLaunch= null;
-
- if (elements.length == 1) {
- Object selected= elements[0];
- if (!(selected instanceof IFile) && selected instanceof IAdaptable) {
- selected= ((IAdaptable) selected).getAdapter(IFile.class);
- }
- if (selected instanceof IFile) {
- elementToLaunch = (IFile) selected;
- }
- RuntimeMetadata metadata = new RuntimeMetadata();
- metadata.setSmooksConfig(elementToLaunch);
- if (!metadata.isValidSmooksConfig()) {
- MessageDialog.openError(getShell(), Messages.SmooksLaunchShortcut_Title_Launch_Failed, metadata.getErrorMessage());
- return;
- }
- }
- performLaunch(elementToLaunch, mode);
- } catch (InterruptedException e) {
- // OK, silently move on
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(),
- Messages.SmooksLaunchShortcut_Title_Launch_Failed,
- Messages.SmooksLaunchShortcut_Exception_Occurred);
- }
- }
-
- private void performLaunch(IFile file, String mode) throws InterruptedException, CoreException {
- ILaunchConfigurationWorkingCopy temparary= createLaunchConfiguration(file);
- ILaunchConfiguration config= findExistingLaunchConfiguration(temparary, mode);
- if (config == null) {
- // no existing found: create a new one
- config= temparary.doSave();
- }
- DebugUITools.launch(config, mode);
- }
-
- private ILaunchConfiguration findExistingLaunchConfiguration(ILaunchConfigurationWorkingCopy temporary, String mode) throws InterruptedException, CoreException {
- List<?> candidateConfigs= findExistingLaunchConfigurations(temporary);
-
- // If there are no existing configs associated with the IType, create
- // one.
- // If there is exactly one config associated with the IType, return it.
- // Otherwise, if there is more than one config associated with the
- // IType, prompt the
- // user to choose one.
- int candidateCount= candidateConfigs.size();
- if (candidateCount == 0) {
- return null;
- } else if (candidateCount == 1) {
- return (ILaunchConfiguration) candidateConfigs.get(0);
- } else {
- // Prompt the user to choose a config. A null result means the user
- // cancelled the dialog, in which case this method returns null,
- // since cancelling the dialog should also cancel launching
- // anything.
- ILaunchConfiguration config= chooseConfiguration(candidateConfigs, mode);
- if (config != null) {
- return config;
- }
- }
- return null;
- }
-
- private ILaunchConfiguration chooseConfiguration(List<?> configList, String mode) throws InterruptedException {
- IDebugModelPresentation labelProvider= DebugUITools.newDebugModelPresentation();
- ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setElements(configList.toArray());
- dialog.setTitle(Messages.SmooksLaunchShortcut_Title_Select_Config);
- if (mode.equals(ILaunchManager.RUN_MODE)) {
- dialog.setMessage(Messages.SmooksLaunchShortcut_Message_Select_Config);
- }
- dialog.setMultipleSelection(false);
- int result= dialog.open();
- if (result == Window.OK) {
- return (ILaunchConfiguration) dialog.getFirstResult();
- }
- throw new InterruptedException(); // cancelled by user
- }
-
- protected String getLaunchConfigurationTypeId() {
- return "org.jboss.tools.smooks.ui.smooksLauncher"; //$NON-NLS-1$
- }
-
- protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IFile file) throws CoreException {
- if (file != null) {
-
- ILaunchConfigurationType configType= getLaunchManager().getLaunchConfigurationType(getLaunchConfigurationTypeId());
- ILaunchConfigurationWorkingCopy wc= configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(file.getName()));
-
- IProject project = (IProject) file.getProject();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, file.getProjectRelativePath().toPortableString());
-
- return wc;
- }
-
- return null;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut#getLaunchableResource(org.eclipse.ui.IEditorPart)
- */
- @Override
- public IResource getLaunchableResource(IEditorPart editor) {
- if (editor instanceof AbstractSmooksFormEditor) {
- IEditorInput editorInput = editor.getEditorInput();
- if (editorInput instanceof FileEditorInput) {
- return ((FileEditorInput)editorInput).getFile();
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
- */
- @Override
- public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editor) {
- if (editor instanceof AbstractSmooksFormEditor) {
- IEditorInput editorInput = editor.getEditorInput();
- if (editorInput instanceof FileEditorInput) {
- ILaunchConfigurationWorkingCopy temparary;
- try {
- temparary = createLaunchConfiguration(((FileEditorInput)editorInput).getFile());
-
- ILaunchConfiguration existingConfig = findExistingLaunchConfiguration(temparary, ILaunchManager.RUN_MODE);
- if(existingConfig == null) {
- existingConfig = temparary.doSave();
- }
-
- return new ILaunchConfiguration[] {existingConfig};
- } catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(),
- Messages.SmooksLaunchShortcut_Title_Launch_Failed,
- Messages.SmooksLaunchShortcut_Exception_Occurred);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
-
- return null;
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchTabGroup.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchTabGroup.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLaunchTabGroup.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.tools.smooks.launch;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
-import org.eclipse.debug.ui.CommonTab;
-import org.eclipse.debug.ui.ILaunchConfigurationDialog;
-import org.eclipse.debug.ui.ILaunchConfigurationTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaArgumentsTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaClasspathTab;
-import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
-
-/**
- * Smooks Launcher Tab Group.
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksLaunchTabGroup extends AbstractLaunchConfigurationTabGroup {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
- */
- public void createTabs(ILaunchConfigurationDialog lcDialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
- new SmooksRunTab(),
- new JavaArgumentsTab(),
- new JavaJRETab(),
- new JavaClasspathTab(),
- new CommonTab()
- };
- setTabs(tabs);
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksLauncher.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,169 +0,0 @@
-/**
- * JBoss, Home of Professional Open Source
- * Copyright 2009, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009, JBoss Inc.
- */
-package org.jboss.tools.smooks.launch;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.tools.smooks.configuration.ProcessNodeType;
-import org.jboss.tools.smooks.core.SmooksInputType;
-import org.jboss.tools.smooks.launch.serialize.ObjectSerializer;
-import org.milyn.Smooks;
-import org.milyn.payload.JavaResult;
-import org.milyn.payload.StringResult;
-import org.xml.sax.SAXException;
-
-/**
- * Smooks runtime Launcher class.
- *
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksLauncher {
-
- public static final String LOCALIZED_FILE_NAME = "localizedMessage.properties"; //$NON-NLS-1$
-
- /**
- * Launcher Main.
- * @param args Args.
- */
- public static void main(String[] args) throws IOException, SAXException {
- Properties localizedMessages = loadLocalizedMessages();
-
- if(args.length != 4) {
- throw new RuntimeException(localizedMessages.getProperty("SmooksLauncher_Error_Expected_Four_Args")); //$NON-NLS-1$
- }
-
- if(args[1].equals(SmooksInputType.INPUT_TYPE_JAVA)) {
- System.out.println(localizedMessages.getProperty("SmooksLauncher_Error_Do_Not_Support_Java_Inputs")); //$NON-NLS-1$
- } else {
- File smooksConfig = new File(args[0]);
- File input = new File(args[2]);
-
- assertFile(smooksConfig, "Smooks"); //$NON-NLS-1$
- assertFile(input, "Input"); //$NON-NLS-1$
-
- Smooks smooks = new Smooks(smooksConfig.toURI().getPath());
- try {
- Set<ProcessNodeType> processNodeTypes = SmooksLauncher.fromNodeTypeString(args[3]);
- JavaResult javaResult = new JavaResult();
- boolean nothingDisplayed = true;
-
- if(processNodeTypes.contains(ProcessNodeType.TEMPLATING)) {
- StringResult stringResult = new StringResult();
-
- smooks.filterSource(new StreamSource(new FileInputStream(input)), stringResult, javaResult);
- System.out.println("[" + localizedMessages.getProperty("SmooksLauncher_Templating_To_StreamResult") + " ...]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.println(" |--"); //$NON-NLS-1$
- System.out.println(indent(stringResult.toString()));
- System.out.println(" |--\n"); //$NON-NLS-1$
- nothingDisplayed = false;
- } else {
- smooks.filterSource(new StreamSource(new FileInputStream(input)), javaResult);
- }
-
- Collection<ObjectSerializer> serializedJavaResults = ObjectSerializer.serialize(javaResult);
- if(!serializedJavaResults.isEmpty()) {
- System.out.println("[" + localizedMessages.getProperty("SmooksLauncher_Java_Mapping_Results") + "...]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- for(ObjectSerializer serializedJavaResult : serializedJavaResults) {
- System.out.println(" |--"); //$NON-NLS-1$
- System.out.println(indent(serializedJavaResult.getSerializedForm()));
- System.out.println(" |--"); //$NON-NLS-1$
- }
- nothingDisplayed = false;
- }
-
- if(nothingDisplayed) {
- System.out.println(localizedMessages.getProperty("SmooksLauncher_Nothing_To_Display")); //$NON-NLS-1$
- }
- } finally {
- smooks.close();
- }
- }
- }
-
- private static Properties loadLocalizedMessages() {
- Properties messages = new Properties();
- InputStream messageStream = SmooksLauncher.class.getResourceAsStream(LOCALIZED_FILE_NAME);
-
- try {
- try {
- messages.load(messageStream);
- } catch (IOException e) {
- System.out.println("Unexpected IOException reading classpath resource stream for '" + LOCALIZED_FILE_NAME + "'. " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
- e.printStackTrace();
- }
- } finally {
- try {
- messageStream.close();
- } catch (IOException e) {
- System.out.println("Unexpected IOException closing classpath resource stream for '" + LOCALIZED_FILE_NAME + "'."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- return messages;
- }
-
- private static void assertFile(File file, String name) {
- if(!file.exists()) {
- throw new RuntimeException("Specified '" + name + "' File '" + file.getAbsolutePath() + "' not found."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- if(file.isDirectory()) {
- throw new RuntimeException("Specified '" + name + "' File '" + file.getAbsolutePath() + "' is a Directory."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- public static Set<ProcessNodeType> fromNodeTypeString(String nodeTypeString) {
- String[] tokens = nodeTypeString.split(","); //$NON-NLS-1$
- Set<ProcessNodeType> nodeTypes = new HashSet<ProcessNodeType>();
-
- for(String token : tokens) {
- nodeTypes.add(ProcessNodeType.valueOf(token));
- }
-
- return nodeTypes;
- }
-
- private static String indent(String in) throws IOException {
- BufferedReader lineReader = new BufferedReader(new StringReader(in));
- StringBuilder indentBuf = new StringBuilder();
-
- String line = lineReader.readLine();
- while(line != null) {
- indentBuf.append(" |").append(line); //$NON-NLS-1$
- line = lineReader.readLine();
- if(line != null) {
- indentBuf.append('\n');
- }
- }
-
- return indentBuf.toString();
- }
-}
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/SmooksRunTab.java 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,443 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
- package org.jboss.tools.smooks.launch;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.FileEditorInput;
-import org.jboss.tools.smooks.configuration.RuntimeMetadata;
-import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-
-/**
- * Smooks Run Tab.
- * @author <a href="mailto:tom.fennelly@jboss.com">tom.fennelly(a)jboss.com</a>
- */
-public class SmooksRunTab extends AbstractLaunchConfigurationTab {
-
- // Project UI widgets
- private Text fProjText;
- private Button fProjButton;
- private Text fConfigurationText;
- private Button fSearchButton;
- private RuntimeMetadata launchMetaData = new RuntimeMetadata();
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- Composite comp = new Composite(parent, SWT.NONE);
- setControl(comp);
-
- GridLayout topLayout = new GridLayout();
- topLayout.numColumns= 3;
- comp.setLayout(topLayout);
-
- createFormElements(comp);
-
- Dialog.applyDialogFont(comp);
- validatePage();
- }
-
-// private void createSpacer(Composite comp) {
-// Label label= new Label(comp, SWT.NONE);
-// GridData gd= new GridData();
-// gd.horizontalSpan= 3;
-// label.setLayoutData(gd);
-// }
-
- private void createFormElements(Composite comp) {
- GridData gd = new GridData();
-
- Label fProjLabel = new Label(comp, SWT.NONE);
- gd.horizontalIndent = 10;
- fProjLabel.setText(Messages.SmooksRunTab_Label_Project);
- fProjLabel.setLayoutData(gd);
-
- fProjText= new Text(comp, SWT.SINGLE | SWT.BORDER);
- fProjText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fProjText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- validatePage();
- updateLaunchConfigurationDialog();
- fSearchButton.setEnabled(fProjText.getText().length() > 0);
- }
- });
-
- fProjButton = new Button(comp, SWT.PUSH);
- fProjButton.setText(Messages.SmooksRunTab_Button_Browse);
- fProjButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleProjectButtonSelected();
- }
- });
- setButtonGridData(fProjButton);
-
- Label fConfigLabel = new Label(comp, SWT.NONE);
- gd = new GridData();
- gd.horizontalIndent = 10;
- fConfigLabel.setLayoutData(gd);
- fConfigLabel.setText(Messages.SmooksRunTab_Label_Configuration);
-
-
- fConfigurationText = new Text(comp, SWT.SINGLE | SWT.BORDER);
- fConfigurationText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fConfigurationText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent evt) {
- handleSmooksConfigChange();
- validatePage();
- updateLaunchConfigurationDialog();
- }
- });
-
- fSearchButton = new Button(comp, SWT.PUSH);
- fSearchButton.setEnabled(fProjText.getText().length() > 0);
- fSearchButton.setText(Messages.SmooksRunTab_Button_Search);
- fSearchButton.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent evt) {
- handleSearchButtonSelected();
- }
- });
- setButtonGridData(fSearchButton);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void setDefaults(ILaunchConfigurationWorkingCopy launchConfigWC) {
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ""); //$NON-NLS-1$
-
- if(activePage != null) {
- IEditorPart editor = activePage.getActiveEditor();
-
- // added for Issue JBIDE-5360 - now will get defaults from the navigator first (if valid smooks config) or the smooks editor if it's open
- boolean foundInNavigator = false;
-
- if (activePage.getActivePart().getSite().getSelectionProvider() != null) {
-
- ISelection selection = activePage.getActivePart().getSite().getSelectionProvider().getSelection();
-
- if (selection instanceof IStructuredSelection) {
-
- IStructuredSelection ssel = (IStructuredSelection) selection;
-
- if (!ssel.isEmpty() && ssel.getFirstElement() instanceof IFile) {
-
- IFile file = (IFile) ssel.getFirstElement();
- RuntimeMetadata metadata = new RuntimeMetadata();
- metadata.setSmooksConfig(file);
-
- if (metadata.isValidSmooksConfig()) {
-
- String configName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(file.getName());
-
- launchConfigWC.rename(configName);
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName()); //$NON-NLS-1$
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, file.getProjectRelativePath().toString()); //$NON-NLS-1$
-
- foundInNavigator = true;
- }
- }
- }
- }
-
- if (editor instanceof AbstractSmooksFormEditor && !foundInNavigator ) {
- IEditorInput editorInput = editor.getEditorInput();
-
- if (editorInput instanceof FileEditorInput && !foundInNavigator) {
-
- FileEditorInput fileEI = (FileEditorInput) editorInput;
- IFile file = fileEI.getFile();
- String configName = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(editor.getTitle());
-
- launchConfigWC.rename(configName);
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName()); //$NON-NLS-1$
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, file.getProjectRelativePath().toString()); //$NON-NLS-1$
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public void initializeFrom(ILaunchConfiguration config) {
- try {
- fProjText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "")); //$NON-NLS-1$
- fConfigurationText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, "")); //$NON-NLS-1$
- } catch (CoreException ce) {
- }
- IResource smooksConfig = getSmooksConfig();
- if(smooksConfig != null) {
- launchMetaData.setSmooksConfig(smooksConfig);
- }
- validatePage();
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- public void performApply(ILaunchConfigurationWorkingCopy launchConfigWC) {
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, fProjText.getText());
- launchConfigWC.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, fConfigurationText.getText());
- }
-
- /*
- * Show a dialog that lists all main types
- */
- private void handleSearchButtonSelected() {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject(fProjText.getText());
-
- if(assertProjectOK(project)) {
- dialog.setInput(project);
- } else {
- dialog.setInput(root);
- }
-
- dialog.setTitle(Messages.SmooksRunTab_Dialog_Title_Select_Config);
- if (dialog.open() == Window.CANCEL) {
- return;
- }
-
- Object[] results = dialog.getResult();
- if ((results == null) || (results.length < 1)) {
- return;
- }
-
- IResource resource = (IResource)results[0];
- fConfigurationText.setText(resource.getProjectRelativePath().toString());
- }
-
- private void handleSmooksConfigChange() {
- launchMetaData.setSmooksConfig(getSmooksConfig());
- }
-
- /*
- * Show a dialog that lets the user select a project. This in turn provides
- * context for the main type, allowing the user to key a main type name, or
- * constraining the search for main types to the specified project.
- */
- private void handleProjectButtonSelected() {
- IJavaProject project = chooseJavaProject();
- if (project == null) {
- return;
- }
-
- String projectName = project.getElementName();
- fProjText.setText(projectName);
- }
-
- /*
- * Realize a Java Project selection dialog and return the first selected project,
- * or null if there was none.
- */
- private IJavaProject chooseJavaProject() {
- IJavaProject[] projects;
- try {
- projects= JavaCore.create(getWorkspaceRoot()).getJavaProjects();
- } catch (JavaModelException e) {
- projects= new IJavaProject[0];
- }
-
- ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
- ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider);
- dialog.setTitle(Messages.SmooksRunTab_Title_Select_Config);
- dialog.setMessage(Messages.SmooksRunTab_Message_Select_Config);
- dialog.setElements(projects);
-
- IJavaProject javaProject = getJavaProject();
- if (javaProject != null) {
- dialog.setInitialSelections(new Object[] { javaProject });
- }
- if (dialog.open() == Window.OK) {
- return (IJavaProject) dialog.getFirstResult();
- }
- return null;
- }
-
- /*
- * Return the IJavaProject corresponding to the project name in the project name
- * text field, or null if the text does not match a project name.
- */
- private IJavaProject getJavaProject() {
- String projectName = fProjText.getText().trim();
- if (projectName.length() < 1) {
- return null;
- }
- return getJavaModel().getJavaProject(projectName);
- }
-
- /*
- * Convenience method to get the workspace root.
- */
- private static IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- /*
- * Convenience method to get access to the java model.
- */
- private IJavaModel getJavaModel() {
- return JavaCore.create(getWorkspaceRoot());
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- public boolean isValid(ILaunchConfiguration config) {
- validatePage();
- return getErrorMessage() == null;
- }
-
- private void validatePage() {
-
- setErrorMessage(null);
- setMessage(null);
-
- String projectName= fProjText.getText().trim();
- if (projectName.length() == 0) {
- setErrorMessage(Messages.SmooksRunTab_Error_Need_Project_Name);
- return;
- }
-
- IStatus status= ResourcesPlugin.getWorkspace().validatePath(IPath.SEPARATOR + projectName, IResource.PROJECT);
- if (!status.isOK() || !Path.ROOT.isValidSegment(projectName)) {
- setErrorMessage(Messages.SmooksRunTab_Error_Invalid_Project_Name + projectName + "'."); //$NON-NLS-1$
- return;
- }
-
- IProject project= getWorkspaceRoot().getProject(projectName);
- if (!project.exists()) {
- setErrorMessage(Messages.SmooksRunTab_Error_Unknown_Project_Name + projectName + "'."); //$NON-NLS-1$
- return;
- }
-
- String configName= fConfigurationText.getText().trim();
- try {
- if (!project.hasNature(JavaCore.NATURE_ID)) {
- setErrorMessage(Messages.SmooksRunTab_Error_Not_A_Java_Project + projectName + Messages.SmooksRunTab_Error_Not_A_Java_Project2);
- return;
- }
- if (configName.length() == 0) {
- setErrorMessage(Messages.SmooksRunTab_Error_Smooks_Configuration_Missing);
- return;
- }
- } catch (CoreException e) {
- setErrorMessage(Messages.SmooksRunTab_Error_Validation + e.getMessage());
- }
-
- if(!launchMetaData.isValidSmooksConfig()) {
- setErrorMessage(launchMetaData.getErrorMessage());
- }
- }
-
- private IResource getSmooksConfig() {
- String projectName = fProjText.getText();
- String configName = fConfigurationText.getText();
-
- return getSmooksConfig(projectName, configName);
- }
-
- public static IResource getSmooksConfig(ILaunchConfiguration launchConfig) {
- try {
- String projectName = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$;
- String configName = launchConfig.getAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, ""); //$NON-NLS-1$;
-
- return getSmooksConfig(projectName, configName);
- } catch (CoreException e) {
- return null;
- }
- }
-
- private static IResource getSmooksConfig(String projectName, String configName) {
- if(projectName != null && !projectName.trim().equals("") && configName != null && !configName.trim().equals("")) { //$NON-NLS-1$ //$NON-NLS-2$
- IProject project = getWorkspaceRoot().getProject(projectName);
- if(assertProjectOK(project)) {
- return project.findMember(configName);
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
- public String getName() {
- return Messages.SmooksRunTab_Tab_Name;
- }
-
- private void setButtonGridData(Button button) {
- GridData gridData= new GridData();
- button.setLayoutData(gridData);
- }
-
- private static boolean assertProjectOK(IProject project) {
- return (project != null && project.exists() && project.isAccessible() && !project.isHidden());
- }
-}
-
-
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/messages.properties
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/messages.properties 2010-07-21 08:59:08 UTC (rev 23622)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/launch/messages.properties 2010-07-21 09:11:28 UTC (rev 23623)
@@ -1,31 +0,0 @@
-ExceptionHandler_Exception_Msg=An exception has occurred. Please check the log for details.
-SmooksLaunchConfigurationDelegate_11=/
-SmooksLaunchConfigurationDelegate_Error_Copying_Smooks_Launcher=Error copying SmooksLauncher to classpath.
-SmooksLaunchConfigurationDelegate_Error_launching=Error Launching Smooks Configuration '
-SmooksLaunchConfigurationDelegate_Error_missing_artifact=This configuration depends on the '
-SmooksLaunchConfigurationDelegate_Error_missing_artifact2=' Smooks artifact. Download Smooks and add the Smooks jars to the Project classpath, or update your Maven POM to include the missing artifact.
-SmooksLaunchConfigurationDelegate_Error_Title=Error
-SmooksLauncher_Error_Do_Not_Support_Java_Inputs=Sorry... we don't support Java Inputs yet.
-SmooksLauncher_Templating_To_StreamResult=Stream Templating Result
-SmooksLauncher_Java_Mapping_Results=Java Mapping Results
-SmooksLauncher_Nothing_To_Display=Nothing to Display:\n - No Java Mappings.\n - No Templates Applied.
-SmooksLauncher_Error_Expected_Four_Args=Expected 4 Launch arguments: <Smooks Config> <Input Type> <Input Path> <Node Types>
-SmooksLaunchShortcut_Exception_Occurred=An exception occurred while testing the Smooks Configuration.
-SmooksLaunchShortcut_Message_Select_Config=Select from the available Smooks Runtime Configurations.
-SmooksLaunchShortcut_Title_Launch_Failed=Launch Failed
-SmooksLaunchShortcut_Title_Select_Config=Select Runtime Configuration
-SmooksRunTab_Button_Browse=Browse...
-SmooksRunTab_Button_Search=Search...
-SmooksRunTab_Dialog_Title_Select_Config=Select Smooks Configuration File...
-SmooksRunTab_Error_Invalid_Project_Name=Invalid project name '
-SmooksRunTab_Error_Need_Project_Name=Project name not configured.
-SmooksRunTab_Error_Not_A_Java_Project=Project '
-SmooksRunTab_Error_Not_A_Java_Project2=' is not a Java Project.
-SmooksRunTab_Error_Smooks_Configuration_Missing=Smooks Configuration not specified.
-SmooksRunTab_Error_Unknown_Project_Name=Unknown project name '
-SmooksRunTab_Error_Validation=Unexpected Validation Error:
-SmooksRunTab_Label_Configuration=Configuration:
-SmooksRunTab_Label_Project=Project:
-SmooksRunTab_Message_Select_Config=Type Project name to narrow selection:
-SmooksRunTab_Tab_Name=Run
-SmooksRunTab_Title_Select_Config=Select Smooks Configuration
15 years, 9 months
JBoss Tools SVN: r23622 - in trunk/jsf/tests/org.jboss.tools.jsf.test: src/org/jboss/tools/jsf/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-07-21 04:59:08 -0400 (Wed, 21 Jul 2010)
New Revision: 23622
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/MessagePropertyRefactoringTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
https://jira.jboss.org/browse/JBIDE-4858
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2010-07-21 08:56:53 UTC (rev 23621)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2010-07-21 08:59:08 UTC (rev 23622)
@@ -22,7 +22,8 @@
org.jboss.tools.common.model.ui,
org.eclipse.ui.ide,
org.eclipse.ltk.core.refactoring,
- org.eclipse.wst.validation
+ org.eclipse.wst.validation,
+ org.jboss.tools.common.el.core;bundle-version="3.2.0"
Bundle-Activator: org.jboss.tools.jsf.plugin.JsfTestPlugin
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-07-21 08:56:53 UTC (rev 23621)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2010-07-21 08:59:08 UTC (rev 23622)
@@ -19,6 +19,7 @@
import org.jboss.tools.jsf.kb.test.FaceletsKbModelTest;
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.test.refactoring.ELVariableRefactoringTest;
+import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -49,6 +50,10 @@
new String[] { "projects/JSFKickStartOldFormat" }, //$NON-NLS-1$
new String[] { "JSFKickStartOldFormat" })); //$NON-NLS-1$
suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ MessagePropertyRefactoringTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
+ new String[] { "projects/JSFKickStartOldFormat" }, //$NON-NLS-1$
+ new String[] { "JSFKickStartOldFormat" })); //$NON-NLS-1$
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
JSF2ComponentsValidatorTest.class), "org.jboss.tools.jsf.test", //$NON-NLS-1$
new String[] { "projects/JSF2ComponentsValidator" }, //$NON-NLS-1$
new String[] { "JSF2ComponentsValidator" })); //$NON-NLS-1$
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/MessagePropertyRefactoringTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/MessagePropertyRefactoringTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/MessagePropertyRefactoringTest.java 2010-07-21 08:59:08 UTC (rev 23622)
@@ -0,0 +1,65 @@
+package org.jboss.tools.jsf.test.refactoring;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.el.core.parser.LexicalToken;
+import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegmentImpl;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jsf.el.refactoring.RenameMessagePropertyProcessor;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+import org.jboss.tools.tests.AbstractRefactorTest;
+
+public class MessagePropertyRefactoringTest extends AbstractRefactorTest{
+ static String projectName = "JSFKickStartOldFormat";
+ static IProject project;
+
+ public MessagePropertyRefactoringTest(){
+ super("Resource Bundle Message Refactoring Test");
+ }
+
+ protected void setUp() throws Exception {
+ project = ProjectImportTestSetup.loadProject(projectName);
+ project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ public void testELVariableRename() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+ IFile sourceFile = project.getProject().getFile("/WebContent/pages/hello.jsp");
+
+ String sourceFileContent = FileUtil.getContentFromEditorOrFile(sourceFile);
+
+ int position = sourceFileContent.indexOf("Messages.hello_message");
+
+ TestChangeStructure structure = new TestChangeStructure(project.getProject(), "/WebContent/pages/hello.jsp");
+ TestTextChange change = new TestTextChange(position+9, 8, "good_bye");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IFile propertyFile = project.getProject().getFile("/JavaSource/demo/bundle/Messages.properties");
+ String propertyFileContent = FileUtil.getContentFromEditorOrFile(propertyFile);
+
+ position = propertyFileContent.indexOf("hello_message");
+
+ structure = new TestChangeStructure(project.getProject(), "/JavaSource/demo/bundle/Messages.properties");
+ change = new TestTextChange(position, 8, "good_bye");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ MessagePropertyELSegmentImpl segment = new MessagePropertyELSegmentImpl();
+ segment.setToken(new LexicalToken(position,13,"hello_message",-1000));
+ segment.setMessageBundleResource(propertyFile);
+ segment.setBaseName("demo.Messages");
+ segment.setMessagePropertySourceReference(0,10);
+ RenameMessagePropertyProcessor processor = new RenameMessagePropertyProcessor(sourceFile, segment);
+ processor.setNewName("good_bye");
+
+ checkRename(processor, list);
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/refactoring/MessagePropertyRefactoringTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 9 months