JBoss Tools SVN: r4295 - in trunk/vpe: tests/org.jboss.tools.vpe.test.richfaces and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-10-17 10:33:21 -0400 (Wed, 17 Oct 2007)
New Revision: 4295
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/
trunk/vpe/tests/org.jboss.tools.vpe.test.richfaces/
Log:
bin svn:ignore's
Property changes on: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner
___________________________________________________________________
Name: svn:ignore
- .options
+ .options
bin
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.test.richfaces
___________________________________________________________________
Name: svn:ignore
+ bin
17 years, 2 months
JBoss Tools SVN: r4294 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-17 10:19:39 -0400 (Wed, 17 Oct 2007)
New Revision: 4294
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-985
validation for seam runtime added
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-10-17 14:15:28 UTC (rev 4293)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-10-17 14:19:39 UTC (rev 4294)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.ui.internal.project.facet;
import java.io.File;
+import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -30,6 +31,7 @@
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.seam.core.ISeamProject;
@@ -135,7 +137,7 @@
/**
*
*/
- public static IValidator JBOSS_SEAM_HOME_FOLDER_VALIDATOR = new IValidator() {
+ public static final IValidator JBOSS_SEAM_HOME_FOLDER_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
Map<String, String> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
@@ -159,7 +161,7 @@
/**
*
*/
- public static IValidator JBOSS_AS_HOME_FOLDER_VALIDATOR = new IValidator() {
+ public static final IValidator JBOSS_AS_HOME_FOLDER_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
Map<String, String> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
@@ -182,7 +184,7 @@
/**
*
*/
- public static IValidator CLASS_QNAME_VALIDATOR = new IValidator() {
+ public static final IValidator CLASS_QNAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
String classDecl = "class " + value.toString() + " {}"; //$NON-NLS-1$ //$NON-NLS-2$
ASTParser parser = ASTParser.newParser(AST.JLS3);
@@ -203,7 +205,7 @@
/**
*
*/
- public static IValidator FILESYSTEM_FILE_EXISTS_VALIDATOR = new IValidator() {
+ public static final IValidator FILESYSTEM_FILE_EXISTS_VALIDATOR = new IValidator() {
public java.util.Map<String, String> validate(Object value,
Object context) {
return ValidatorFactory.NO_ERRORS;
@@ -215,7 +217,7 @@
* @author eskimo
*
*/
- public static IValidator SEAM_COMPONENT_NAME_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_COMPONENT_NAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
IStatus status = JavaConventions.validateClassFileName(
@@ -234,12 +236,12 @@
* @author eskimo
*
*/
- public static IValidator SEAM_JAVA_INTEFACE_NAME_CONVENTION_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_JAVA_INTEFACE_NAME_CONVENTION_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
if(!(context instanceof Object[])) {
throw new IllegalArgumentException(
- "Context parameter should be instance of Object[]");
+ "Context parameter should be instance of Object[]"); //$NON-NLS-1$
}
Object[] contextArray = ((Object[]) context);
@@ -261,12 +263,12 @@
}
};
- public static IValidator SEAM_METHOD_NAME_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_METHOD_NAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
if(!(context instanceof Object[])) {
throw new IllegalArgumentException(
- "Context parameter should be instance of Object[]");
+ "Context parameter should be instance of Object[]"); //$NON-NLS-1$
}
Object[] contextArray = ((Object[]) context);
@@ -287,12 +289,12 @@
}
};
- public static IValidator FILE_NAME_VALIDATOR = new IValidator() {
+ public static final IValidator FILE_NAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
if(!(context instanceof Object[])) {
throw new IllegalArgumentException(
- "Context parameter should be instance of Object[]");
+ "Context parameter should be instance of Object[]"); //$NON-NLS-1$
}
Object[] contextArray = ((Object[]) context);
@@ -307,9 +309,12 @@
}
};
- public static IValidator SEAM_PROJECT_NAME_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_PROJECT_NAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
+ if(value==null || "".equals(value)) { //$NON-NLS-1$
+ return createErrormessage(SeamUIMessages.VALIDATOR_FACTORY_PRJ_NOT_SELECTED);
+ }
IResource project = ResourcesPlugin.getWorkspace().getRoot()
.findMember(value.toString());
@@ -335,7 +340,7 @@
}
};
- public static IValidator CONNECTION_PROFILE_VALIDATOR =
+ public static final IValidator CONNECTION_PROFILE_VALIDATOR =
new IValidator() {
public Map<String, String> validate(Object value, Object context) {
if (value == null || "".equals(value.toString().trim())) { //$NON-NLS-1$
@@ -360,46 +365,74 @@
}
};
- public static IValidator SEAM_RUNTIME_NAME_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_RUNTIME_NAME_VALIDATOR = new IValidator() {
public Map<String, String> validate(Object value, Object context) {
+
+ Map<String,String> errors = NO_ERRORS;
if (value == null || "".equals(value.toString().trim())) { //$NON-NLS-1$
- return createErrormessage(
+ errors = createErrormessage(
ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
SeamUIMessages.VALIDATOR_FACTORY_SEAM_RUNTIME_IS_NOT_SELECTED);
+ } else {
+ SeamRuntime rt = SeamRuntimeManager.getInstance()
+ .findRuntimeByName(value.toString());
+ if (rt == null) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_CANNOT_FIND_SEAM_RUNTIME, value));
+ } else if (!new File(rt.getHomeDir()).exists()) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_IS_MISSING,value));
+ } else if (!new File(rt.getSeamGenDir()).exists()) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_IS_MISSING,value));
+ } else if (!new File(rt.getSrcTemplatesDir()).exists()) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_SRC_DIR_IS_MISSING,value));
+ } else if (!new File(rt.getViewTemplatesDir()).exists()) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_VIEW_DIR_IS_MISSING,value));
+ } else if(!new File(rt.getResourceTemplatesDir()).exists()) {
+ errors = createErrormessage(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_RESOURCES_DIR_IS_MISSING,value));
+ }
}
- return NO_ERRORS;
+ return errors;
}
};
- public static IValidator SEAM_RUNTIME_VALIDATOR = new IValidator() {
+ public static final IValidator SEAM_RUNTIME_VALIDATOR = new IValidator() {
public java.util.Map<String, String> validate(Object value,
Object context) {
Map<String,String> errors = NO_ERRORS;
String rtName = value.toString();
- if(value==null || "".equals(value)) {
- errors = createErrormessage("Seam Runtime is not configured for selected Seam Web Project");
+ if(value==null || "".equals(value)) { //$NON-NLS-1$
+ errors = createErrormessage(SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_NOT_CONFIGURED);
} else {
SeamRuntime rt = SeamRuntimeManager.getInstance()
.findRuntimeByName(value.toString());
if (rt == null) {
- errors = createErrormessage("Cannot find '" + value
- + "' Seam Runtime for selected Seam Web Project");
+ errors = createErrormessage(NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_CANNOT_BE_FOUND, value));
} else if (!new File(rt.getHomeDir()).exists()) {
- errors = createErrormessage(
- "Seam Runtime '" + value + "' home directory doesn't exist for selected Seam Web Project");
+ errors = createErrormessage(NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_DOES_NOT_EXIST,value));
} else if (!new File(rt.getSeamGenDir()).exists()) {
- errors = createErrormessage(
- "Seam Runtime '" + value + "' templates directory doesn't exist for selected Seam Web Project");
+ errors = createErrormessage(NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_DOES_NOT_EXIST,value));
} else if (!new File(rt.getSrcTemplatesDir()).exists()) {
- errors = createErrormessage(
- "Seam Runtime '" + value + "' source templates directory doesn't exist for selected Seam Web Project");
+ errors = createErrormessage(NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_SOURCE_TEMPLATES_DIR_DOES_NOT_EXIST,value));
} else if (!new File(rt.getViewTemplatesDir()).exists()) {
- errors = createErrormessage(
- "Seam Runtime '" + value + "' view templates directory doesn't exist for selected Seam Web Project");
- } else if(!new File(rt.getResourceTemplatesDir()).exists()) {
- errors = createErrormessage(
- "Seam Runtime '" + value + "' resources templates directory doesn't exist for selected Seam Web Project");
+ errors = createErrormessage(NLS.bind(
+ SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_VIE_TEMPLATE_DIR_DOES_NOT_EXIST,value));
+// } else if(!new File(rt.getResourceTemplatesDir()).exists()) {
+// errors = createErrormessage(NLS.bind(
+// "Seam Runtime '{0)' resource templates directory doesn't exist for selected Seam Web Project",value));
}
}
return errors;
17 years, 2 months
JBoss Tools SVN: r4293 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-17 10:15:28 -0400 (Wed, 17 Oct 2007)
New Revision: 4293
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-985
validation for seam runtime added
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-10-17 14:15:24 UTC (rev 4292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2007-10-17 14:15:28 UTC (rev 4293)
@@ -299,6 +299,8 @@
public static String TEXT_FIELD_EDITOR_PARENT_CONTROL_SHOULD_BE_COMPOSITE;
+ public static String VALIDATOR_FACTORY_CANNOT_FIND_SEAM_RUNTIME;
+
public static String VALIDATOR_FACTORY_COMPONENT_NAME_IS_NOT_VALID;
public static String VALIDATOR_FACTORY_CONNECTION_PROFILE;
@@ -337,10 +339,34 @@
public static String VALIDATOR_FACTORY_POINTS_TO_FILE;
+ public static String VALIDATOR_FACTORY_PRJ_NOT_SELECTED;
+
public static String VALIDATOR_FACTORY_PROJECT;
public static String VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS;
+ public static String VALIDATOR_FACTORY_SEAM_RT_CANNOT_BE_FOUND;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_DOES_NOT_EXIST;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_IS_MISSING;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_NOT_CONFIGURED;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_RESOURCES_DIR_IS_MISSING;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_SOURCE_TEMPLATES_DIR_DOES_NOT_EXIST;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_SRC_DIR_IS_MISSING;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_DOES_NOT_EXIST;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_IS_MISSING;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_VIE_TEMPLATE_DIR_DOES_NOT_EXIST;
+
+ public static String VALIDATOR_FACTORY_SEAM_RT_VIEW_DIR_IS_MISSING;
+
public static String VALIDATOR_FACTORY_SEAM_RUNTIME_IS_NOT_SELECTED;
public static String VALIDATOR_FACTORY_SELECTED_PROJECT;
@@ -353,7 +379,7 @@
public static String VALIDATOR_FACTORY_PROJECT_ALREADY_EXISTS;
- public static String SEAM_TARGET_RUNTIME;
+ public static String SEAM_TARGET_SERVER;
static {
// load message values from bundle file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-10-17 14:15:24 UTC (rev 4292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2007-10-17 14:15:28 UTC (rev 4293)
@@ -119,6 +119,12 @@
VALIDATOR_FACTORY_PATH=Path '
VALIDATOR_FACTORY_POINTS_TO_FILE=' points to file
VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS=Seam Home folder doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_DOES_NOT_EXIST=Seam Runtime ''{0}'' home directory doesn't exist for selected Seam Web Project
+VALIDATOR_FACTORY_SEAM_RT_HOME_DIR_IS_MISSING=Seam Runtime ''{0}'' home directory doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_RESOURCES_DIR_IS_MISSING=Seam Runtime '{0)' resource templates directory doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_DOES_NOT_EXIST=Seam Runtime ''{0}'' templates directory doesn't exist for selected Seam Web Project
+VALIDATOR_FACTORY_SEAM_RT_TEMPLATES_DIR_IS_MISSING=Seam Runtime ''{0}'' templates directory doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_VIE_TEMPLATE_DIR_DOES_NOT_EXIST=Seam Runtime ''{0}'' view templates directory doesn't exist for selected Seam Web Project
VALIDATOR_FACTORY_HOME_FOLDER_POINTS_TO=Home folder points to
VALIDATOR_FACTORY_LOCATION_THAT_DOES_NOT_LOOK_LIKE_SEAM_HOME_FOLDER=location that does not look like seam home folder ('jboss-seam.jar' is missing)
VALIDATOR_FACTORY_JBOSS_AS_HOME_FOLDER_DOES_NOT_EXIST=JBoss AS Home folder doesn't exist
@@ -129,17 +135,24 @@
VALIDATOR_FACTORY_LOCAL_INTERFACE_NAME_IS_NOT_VALID=Local Interface name is not valid.\n
VALIDATOR_FACTORY_NAME_IS_NOT_VALID2=\ name is not valid.
VALIDATOR_FACTORY_PROJECT=Project '
-VALIDATOR_FACTORY_DOES_NOT_EXIST=' does'n exist.
+VALIDATOR_FACTORY_DOES_NOT_EXIST=' doesn't exist.
VALIDATOR_FACTORY_SELECTED_PROJECT=Selected project '
+VALIDATOR_FACTORY_PRJ_NOT_SELECTED=Project is not selected
VALIDATOR_FACTORY_IS_NOT_A_SEAM_WEB_PROJECT=' is not a Seam Web Project
VALIDATOR_FACTORY_CONNECTION_PROFILE_IS_NOT_SELECTED=Connection profile is not selected
VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_EMPTY_FOR_SELECTED=Driver Class proberty is empty for selected '
+VALIDATOR_FACTORY_SEAM_RT_SOURCE_TEMPLATES_DIR_DOES_NOT_EXIST=Seam Runtime ''{0}'' source templates directory doesn't exist for selected Seam Web Project
VALIDATOR_FACTORY_CONNECTION_PROFILE=' connection profile
VALIDATOR_FACTORY_SEAM_RUNTIME_IS_NOT_SELECTED=Seam Runtime is not selected
+VALIDATOR_FACTORY_SEAM_RT_VIEW_DIR_IS_MISSING=Seam Runtime ''{0}'' view templates directory doesn't exist
+VALIDATOR_FACTORY_SEAM_RT_CANNOT_BE_FOUND=Cannot find ''{0}'' Seam Runtime for selected Seam Web Project
+VALIDATOR_FACTORY_CANNOT_FIND_SEAM_RUNTIME=Cannot find Seam Runtime ''{0}''
+VALIDATOR_FACTORY_SEAM_RT_SRC_DIR_IS_MISSING=Seam Runtime ''{0}'' source templates directory doesn't exist
VALIDATOR_FACTORY_TEST_PROJECT=Test project '
VALIDATOR_FACTORY_EAR_PROJECT=EAR project '
VALIDATOR_FACTORY_EJB_PROJECT=EJB project '
VALIDATOR_FACTORY_PROJECT_ALREADY_EXISTS=' already exists. Please select other name for new Seam project.
+VALIDATOR_FACTORY_SEAM_RT_NOT_CONFIGURED=Seam Runtime is not configured for selected Seam Web Project
SEAM_PROJECT_WIZARD_PAGE1_FILE_CONTAINER_MUST_BE_SPECIFIED=File container must be specified
SEAM_RUNTIME_LIST_FIELD_EDITOR_RUNTIME_NAME_IS_NOT_CORRECT=Runtime name is not correct
SEAM_GENERATE_ENTITIES_WIZARD_CAN_NOT_GENERATE_SEAM_ENTITIES=Can't generate seam entities
@@ -173,4 +186,4 @@
SEAM_RUNTIME_LIST_FIELD_EDITOR_THE_SELECTED_SEAM_APPEARS_TO_BE_OF_INCOMATIBLE_VERSION=The selected seam appears to be of an incompatible version '
SEAM_GENERATE_ENTITIES_WIZARD_THIS_METHOD_IS_NOT_RELEVANT_IN_GENERATING_SEAM_ENTITIES=This method is not relevant in generating seam entities.
SEAM_FORM_WIZARD_PAGE1_JAVA_INTERFACE_SLSB_AND_KEY_SEAMEJB3_ANNOTATIONS_WILL_BE_CREATED=Java Interface, SLSB and key Seam/EJB3 annotations will be created.
-SEAM_TARGET_RUNTIME=Target Server
\ No newline at end of file
+SEAM_TARGET_SERVER=Target Server
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-10-17 14:15:24 UTC (rev 4292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-10-17 14:15:28 UTC (rev 4293)
@@ -11,8 +11,10 @@
package org.jboss.tools.seam.ui.wizard;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -30,11 +32,14 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -71,7 +76,7 @@
throws ExecutionException {
IStatus result = Status.OK_STATUS;
Map<String, INamedElement> params = (Map)info.getAdapter(Map.class);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ final IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
params.get(IParameter.SEAM_PROJECT_NAME).getValueAsString());
Map<String, Object> vars = new HashMap<String, Object>();
@@ -104,7 +109,7 @@
vars.put(IParameter.SEAM_PROJECT_LOCATION_PATH,project.getLocation().toFile().toString());
vars.put(IParameter.SEAM_PROJECT_WEBCONTENT_PATH,webRootContainer.getLocation().toFile().toString());
- vars.put(IParameter.SEAM_EJB_PROJECT_LOCATION_PATH,seamPrjSet.getEjbProject().getLocation().toFile().toString());
+ vars.put(IParameter.SEAM_EJB_PROJECT_LOCATION_PATH,seamPrjSet.getEjbProject()!=null?seamPrjSet.getEjbProject().getLocation().toFile().toString():"");
vars.put(IParameter.SEAM_TEST_PROJECT_LOCATION_PATH,seamPrjSet.getTestProject().getLocation().toFile().toString());
vars.put(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH, actionFolder.replace('.','/'));
vars.put(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME, actionFolder);
@@ -116,21 +121,31 @@
List<String[]> fileMapping = getFileMappings(vars);
List<String[]> fileMappingCopy = applayVariables(fileMapping,vars);
FilterSetCollection filters = getFilterSetCollection(vars);
- File[] file = new File[fileMappingCopy.size()];
+ final File[] file = new File[fileMappingCopy.size()];
int index=0;
for (String[] mapping : fileMappingCopy) {
file[index] = new File(mapping[1]);
FileUtils.getFileUtils().copyFile(new File(mapping[0]), file[index],filters,true);
index++;
}
-
seamPrjSet.refreshLocal(monitor);
-
- if(file.length > 0){
- IFile iFile = project.getWorkspace().getRoot().getFileForLocation(new Path(file[0].getAbsolutePath()));
- IDE.openEditor(SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(), iFile);
- }
-
+ Display.getCurrent().asyncExec(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ // TODO Auto-generated method stub
+ if(file.length > 0){
+ IFile iFile = project.getWorkspace().getRoot().getFileForLocation(new Path(file[0].getAbsolutePath()));
+ try {
+ IDE.openEditor(SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(), iFile);
+ } catch (PartInitException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ });
+
} catch (CoreException e) {
result = new Status(IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,e.getMessage(),e);
} catch (BackingStoreException e) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2007-10-17 14:15:24 UTC (rev 4292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2007-10-17 14:15:28 UTC (rev 4293)
@@ -95,7 +95,13 @@
} else {
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
}
- setPageComplete(false);
+ String selectdProject = getEditor(IParameter.SEAM_PROJECT_NAME).getValueAsString();
+
+ if(selectdProject!=null && !"".equals(selectdProject) && isValidProjectSelected()) {
+ isValidRuntimeConfigured(getSelectedProject());
+ } else {
+ setPageComplete(false);
+ }
}
/* (non-Javadoc)
@@ -187,16 +193,8 @@
*
*/
protected void doValidate(PropertyChangeEvent event) {
- Map errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
- editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
+ if(!isValidProjectSelected()) return;
- if(errors.size()>0) {
- setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).toString());
- setPageComplete(false);
- getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
- return;
- }
-
IProject project = getSelectedProject();
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(!isWar());
@@ -205,7 +203,7 @@
LabelFieldEditor label = (LabelFieldEditor)((CompositeEditor)getEditor(IParameter.SEAM_LOCAL_INTERFACE_NAME)).getEditors().get(0);
label.getLabelControl().setText(isWar()?SeamUIMessages.SEAM_BASE_WIZARD_PAGE_POJO_CLASS_NAME: SeamUIMessages.SEAM_BASE_WIZARD_PAGE_LOCAL_CLASS_NAME);
- errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
+ Map errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_COMPONENT_NAME).getValue(), null);
if(errors.size()>0) {
@@ -274,7 +272,7 @@
*/
protected boolean isValidRuntimeConfigured(IProject project) {
Map errors;
- String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,"war"); //$NON-NLS-1$
+ String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
if(errors.size()>0) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).toString());
@@ -284,6 +282,19 @@
return true;
}
+ protected boolean isValidProjectSelected() {
+ Map errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
+ editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
+
+ if(errors.size()>0) {
+ setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).toString());
+ setPageComplete(false);
+ getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
+ return false;
+ }
+ return true;
+ }
+
/**
*
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-10-17 14:15:24 UTC (rev 4292)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-10-17 14:15:28 UTC (rev 4293)
@@ -157,7 +157,7 @@
protected void createSeamServerTargetComposite(Composite parent) {
// super.createServerTargetComposite(parent);
Group group = new Group(parent, SWT.NONE);
- group.setText(SeamUIMessages.SEAM_TARGET_RUNTIME);
+ group.setText(SeamUIMessages.SEAM_TARGET_SERVER);
group.setLayoutData(gdhfill());
group.setLayout(new GridLayout(2, false));
17 years, 2 months
JBoss Tools SVN: r4292 - trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-17 10:15:24 -0400 (Wed, 17 Oct 2007)
New Revision: 4292
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath
Log:
http://jira.jboss.org/jira/browse/JBIDE-985
validation for seam runtime added
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath 2007-10-17 14:02:10 UTC (rev 4291)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.classpath 2007-10-17 14:15:24 UTC (rev 4292)
@@ -3,5 +3,6 @@
<classpathentry kind="src" path="ejbModule"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.jboss.ide.eclipse.as.classpath.core.runtime.ProjectRuntimeInitializer/@runtimeName@"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
17 years, 2 months
JBoss Tools SVN: r4291 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-10-17 10:02:10 -0400 (Wed, 17 Oct 2007)
New Revision: 4291
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-800
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-10-17 14:01:44 UTC (rev 4290)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2007-10-17 14:02:10 UTC (rev 4291)
@@ -28,7 +28,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.rules.IToken;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamContextVariable;
17 years, 2 months
JBoss Tools SVN: r4290 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-10-17 10:01:44 -0400 (Wed, 17 Oct 2007)
New Revision: 4290
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-800
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-10-17 13:44:03 UTC (rev 4289)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2007-10-17 14:01:44 UTC (rev 4290)
@@ -30,7 +30,6 @@
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3;
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.graphics.Image;
@@ -43,12 +42,20 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor;
import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
import org.jboss.tools.common.text.ext.IEditorWrapper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.w3c.dom.Node;
/**
* Content assist proposal processor.
@@ -56,7 +63,7 @@
*
* @author Jeremy
*/
-public class SeamELProposalProcessor implements IContentAssistProcessor {
+public class SeamELProposalProcessor extends AbstractContentAssistProcessor {
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
private static final IContextInformation[] NO_CONTEXTS= new IContextInformation[0];
@@ -66,13 +73,19 @@
private final String fString;
private final String fPrefix;
private final int fOffset;
+ private final int fNewPosition;
public Proposal(String string, String prefix, int offset) {
- fString= string;
- fPrefix= prefix;
- fOffset= offset;
+ this(string, prefix, offset, offset + string.length());
}
+ public Proposal(String string, String prefix, int offset, int newPosition) {
+ fString = string;
+ fPrefix = prefix;
+ fOffset = offset;
+ fNewPosition = newPosition;
+ }
+
/*
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(IDocument)
*/
@@ -84,7 +97,7 @@
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(IDocument)
*/
public Point getSelection(IDocument document) {
- return new Point(fOffset + fString.length(), 0);
+ return new Point(fNewPosition, 0);
}
/*
@@ -206,7 +219,6 @@
public boolean isAutoInsertable() {
return false;
}
-
}
private final SeamELCompletionEngine fEngine= new SeamELCompletionEngine();
@@ -223,40 +235,57 @@
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
try {
ITextEditor part = getActiveEditor();
- if (part == null)
+ if (part == null) {
return NO_PROPOSALS;
-
+ }
+
IEditorInput editorInput = part.getEditorInput();
- if (!(editorInput instanceof IFileEditorInput))
+ if (!(editorInput instanceof IFileEditorInput)) {
return NO_PROPOSALS;
-
+ }
+
IFile file = ((IFileEditorInput)editorInput).getFile();
IProject project = (file == null ? null : file.getProject());
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
- if (seamProject == null)
+ if (seamProject == null) {
return NO_PROPOSALS;
+ }
String prefix= SeamELCompletionEngine.getPrefix(viewer, offset);
prefix = (prefix == null ? "" : prefix); //$NON-NLS-1$
-
- if (!checkStartPositionInEL(viewer, offset))
- return NO_PROPOSALS;
+ String proposalPrefix = "";
+ String proposalSufix = "";
+ if (!checkStartPositionInEL(viewer, offset)) {
+ // Work only with attribute value for JSP/HTML
+ if((part instanceof XMLTextEditor) || (!isAttributeValue(viewer, offset))) {
+ return NO_PROPOSALS;
+ }
+ if(isCharSharp(viewer, offset-1)) {
+ proposalPrefix = "{"; //$NON-NLS-1$
+ } else {
+ proposalPrefix = "#{"; //$NON-NLS-1$
+ }
+ proposalSufix = "}"; //$NON-NLS-1$
+ }
+
List<String> suggestions = fEngine.getCompletions(seamProject, file, viewer.getDocument(), prefix, offset - prefix.length());
List<String> uniqueSuggestions = fEngine.makeUnique(suggestions);
List<ICompletionProposal> result= new ArrayList<ICompletionProposal>();
for (String string : uniqueSuggestions) {
- if (string.length() > 0)
- result.add(createProposal(string, prefix, offset));
+ if (string.length() > 0) {
+ string = proposalPrefix + string + proposalSufix;
+ result.add(new Proposal(string, prefix, offset, offset + string.length() - proposalSufix.length()));
+ }
}
-
- if (result == null || result.size() == 0)
+
+ if (result == null || result.size() == 0) {
return NO_PROPOSALS;
+ }
ICompletionProposal[] resultArray = result.toArray(new ICompletionProposal[result.size()]);
Arrays.sort(resultArray, new Comparator<ICompletionProposal>() {
-
public int compare(ICompletionProposal arg0,
ICompletionProposal arg1) {
String str0 = (arg0 == null ? "" : arg0.getDisplayString()); //$NON-NLS-1$
@@ -265,21 +294,29 @@
}});
return resultArray;
} catch (BadLocationException x) {
+ SeamGuiPlugin.getPluginLog().logError(x);
return NO_PROPOSALS;
} catch (StringIndexOutOfBoundsException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
return NO_PROPOSALS;
}
}
- /* Creates Proposal object
- *
- * @param string
- * @param prefix
- * @param offset
- * @return
- */
- private ICompletionProposal createProposal(String string, String prefix, int offset) {
- return new Proposal(string, prefix, offset);
+ private boolean isAttributeValue(ITextViewer viewer, int offset) {
+ IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, offset);
+
+ if(treeNode instanceof Node) {
+ Node node = (Node) treeNode;
+ while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
+ node = node.getParentNode();
+ }
+ if(node instanceof IDOMNode) {
+ IDOMNode xmlnode = (IDOMNode) node;
+ ITextRegion completionRegion = getCompletionRegion(offset, node);
+ return DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE == completionRegion.getType();
+ }
+ }
+ return false;
}
/*
@@ -334,7 +371,7 @@
public String getErrorMessage() {
return null; // no custom error message
}
-
+
/*
* Returns active text editor
* @return
@@ -357,7 +394,15 @@
return null;
}
+ private boolean isCharSharp(ITextViewer viewer, int offset) throws BadLocationException {
+ IDocument doc= viewer.getDocument();
+ if (doc == null || offset > doc.getLength() || offset < 0) {
+ return false;
+ }
+ return '#' == doc.getChar(offset);
+ }
+
/*
* Checks if the EL start starting characters are present
* @param viewer
@@ -369,7 +414,7 @@
IDocument doc= viewer.getDocument();
if (doc == null || offset > doc.getLength())
return false;
-
+
while (--offset >= 0) {
if ('}' == doc.getChar(offset))
return false;
@@ -383,4 +428,4 @@
}
return false;
}
-}
+}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r4289 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-17 09:44:03 -0400 (Wed, 17 Oct 2007)
New Revision: 4289
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextShortVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
Log:
JBIDE-1075
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextShortVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextShortVariable.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamContextShortVariable.java 2007-10-17 13:44:03 UTC (rev 4289)
@@ -0,0 +1,5 @@
+package org.jboss.tools.seam.core;
+
+public interface ISeamContextShortVariable extends ISeamContextVariable {
+ public ISeamContextVariable getOriginal();
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-10-17 13:22:23 UTC (rev 4288)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-10-17 13:44:03 UTC (rev 4289)
@@ -146,6 +146,13 @@
public Set<ISeamContextVariable> getVariables();
/**
+ * Adds references to variables that provide short name if
+ * seam package including the original variable is imported.
+ * @return all seam context variables of project
+ */
+ public Set<ISeamContextVariable> getVariables(boolean includeShortNames);
+
+ /**
* @param name
* @return all seam variables by name from all contexts
*/
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2007-10-17 13:44:03 UTC (rev 4289)
@@ -0,0 +1,37 @@
+package org.jboss.tools.seam.internal.core;
+
+import org.jboss.tools.seam.core.ISeamContextShortVariable;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ScopeType;
+
+public class SeamContextShortVariable extends SeamObject implements ISeamContextShortVariable {
+ ISeamContextVariable original;
+
+ public SeamContextShortVariable(ISeamContextVariable original) {
+ this.original = original;
+ }
+
+ public ISeamContextVariable getOriginal() {
+ return original;
+ }
+
+ public String getName() {
+ String n = original.getName();
+ int i = n.lastIndexOf('.');
+ return n.substring(i + 1);
+ }
+
+ public ScopeType getScope() {
+ return original.getScope();
+ }
+
+ public void setName(String name) {
+ }
+
+ public void setScope(ScopeType type) {
+ }
+
+ public SeamContextShortVariable clone() throws CloneNotSupportedException {
+ throw new CloneNotSupportedException();
+ }
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-10-17 13:22:23 UTC (rev 4288)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-10-17 13:44:03 UTC (rev 4289)
@@ -971,6 +971,32 @@
}
/**
+ * @see org.jboss.tools.seam.core.ISeamProject#getVariables()
+ */
+ public Set<ISeamContextVariable> getVariables(boolean includeShortNames) {
+ if(!includeShortNames) {
+ return allVariables;
+ }
+ Set<ISeamContextVariable> result = new HashSet<ISeamContextVariable>();
+ result.addAll(allVariables);
+ for (ISeamContextVariable v: allVariables) {
+ String n = v.getName();
+ int i = n.lastIndexOf('.');
+ if(i < 0) continue;
+ String packageName = n.substring(0, i);
+ if(isImportedPackage(packageName)) {
+ result.add(new SeamContextShortVariable(v));
+ }
+ }
+ return result;
+ }
+
+ public boolean isImportedPackage(String packageName) {
+ //TODO implement processing imported packages
+ return false;
+ }
+
+ /**
* @see org.jboss.tools.seam.core.ISeamProject#getVariablesByName(java.lang.String)
*/
public Set<ISeamContextVariable> getVariablesByName(String name) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-10-17 13:22:23 UTC (rev 4288)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2007-10-17 13:44:03 UTC (rev 4289)
@@ -28,6 +28,7 @@
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
@@ -71,20 +72,8 @@
* @return
*/
private static List<ISeamContextVariable> internalResolveVariables(ISeamProject project, String name, boolean onlyEqualNames) {
- List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
- Set<ISeamContextVariable> variables = project.getVariables();
- for (ISeamContextVariable variable : variables) {
- if(onlyEqualNames) {
- if (variable.getName().equals(name)) {
- resolvedVariables.add(variable);
- }
- } else {
- if (variable.getName().startsWith(name)) {
- resolvedVariables.add(variable);
- }
- }
- }
- return resolvedVariables;
+ Set<ISeamContextVariable> variables = project.getVariables(true);
+ return internalResolveVariables(project, name, onlyEqualNames, variables);
}
/**
@@ -97,15 +86,20 @@
* @return
*/
private static List<ISeamContextVariable> internalResolveVariablesByScope(ISeamProject project, ScopeType scope, String name, boolean onlyEqualNames) {
- List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
Set<ISeamContextVariable> variables = project.getVariablesByScope(scope, true);
+ return internalResolveVariables(project, name, onlyEqualNames, variables);
+ }
+
+ private static List<ISeamContextVariable> internalResolveVariables(ISeamProject project, String name, boolean onlyEqualNames, Set<ISeamContextVariable> variables) {
+ List<ISeamContextVariable> resolvedVariables = new ArrayList<ISeamContextVariable>();
for (ISeamContextVariable variable : variables) {
+ String n = variable.getName();
if(onlyEqualNames) {
- if (variable.getName().equals(name)) {
+ if (n.equals(name)) {
resolvedVariables.add(variable);
}
} else {
- if (variable.getName().startsWith(name)) {
+ if (n.startsWith(name)) {
resolvedVariables.add(variable);
}
}
@@ -121,6 +115,9 @@
*/
public static IMember getMemberByVariable(ISeamContextVariable variable, boolean onlyEqualNames) {
IMember member = null;
+ if(variable instanceof ISeamContextShortVariable) {
+ return getMemberByVariable(((ISeamContextShortVariable)variable).getOriginal(), onlyEqualNames);
+ }
if (variable instanceof ISeamComponent) {
ISeamComponent component = (ISeamComponent)variable;
ISeamJavaComponentDeclaration decl = component.getJavaDeclaration();
17 years, 2 months
JBoss Tools SVN: r4288 - trunk/documentation/GettingStartedGuide/docs/userguide/en/images.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-10-17 09:22:23 -0400 (Wed, 17 Oct 2007)
New Revision: 4288
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber2.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber3.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber4.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad4.png
Log:
http://jira.jboss.com/jira/browse/RHDS-145 screenshots are retaken
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/guessnumber4.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad4.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r4287 - trunk/documentation/GettingStartedGuide/docs/userguide/en/images.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-10-17 08:59:09 -0400 (Wed, 17 Oct 2007)
New Revision: 4287
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj04.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj044.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj045.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newjbossserver.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject1.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject2.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject3.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject4.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject5.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newprojectjsp20.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad1.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad10.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad11.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad12.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad13.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad14.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad15.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad16.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad5.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad6.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad62.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad63.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad64.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad7.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad9.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/serveroverview.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/serverstarted.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/servertype.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication2.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication3.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication4.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication5.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication6.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/startingfromicon.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/startingfromserversview.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/stoppingserver2.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/webxmldesign.png
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/webxmlsource.png
Log:
http://jira.jboss.com/jira/browse/RHDS-145 screenshots are retaken
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj04.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj044.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/SeamNewProj045.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newjbossserver.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject1.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject4.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newproject5.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newprojectjsp20.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad1.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad10.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad11.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad12.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad13.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad14.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad15.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad16.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad5.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad6.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad62.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad63.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad64.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad7.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/newrad9.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/serveroverview.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/serverstarted.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/servertype.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication4.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication5.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/simplejspwebapplication6.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/startingfromicon.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/startingfromserversview.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/stoppingserver2.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/webxmldesign.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/webxmlsource.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r4286 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-10-17 08:10:43 -0400 (Wed, 17 Oct 2007)
New Revision: 4286
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
Log:
JBIDE-1067: Mapping Diagram crashes with enum Attributes
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ShapeEditPart.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -57,7 +57,7 @@
OrmEditPart implements PropertyChangeListener, NodeEditPart {
static protected OrmLabelProvider ormLabelProvider =
- new OrmLabelProvider(new OrmModelImageVisitor(), new OrmModelNameVisitor(null));
+ new OrmLabelProvider(new OrmModelImageVisitor(), new OrmModelNameVisitor());
protected void createEditPolicies() {
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ShapesSelectionEditPolicy());
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/ObjectEditorInput.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -12,6 +12,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.hibernate.console.ConsoleConfiguration;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenActionDelegate.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenActionDelegate.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -16,10 +16,16 @@
import org.eclipse.ui.IWorkbenchPart;
public abstract class OpenActionDelegate implements IObjectActionDelegate {
+ private IWorkbenchPart part;
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ this.part = targetPart;
}
public void selectionChanged(IAction action, ISelection selection) {
}
+
+ public IWorkbenchPart getPart() {
+ return part;
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -19,6 +19,7 @@
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ObjectPluginAction;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.views.KnownConfigurationsView;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
public class OpenDiagramActionDelegate extends OpenActionDelegate {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenFileActionUtils.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -71,6 +71,7 @@
}
public static boolean rootClassHasAnnotations(ConsoleConfiguration consoleConfiguration, java.io.File configXMLFile, RootClass rootClass) {
+ if (configXMLFile == null) return true;
Document doc = getDocument(consoleConfiguration, configXMLFile);
return getElements(doc, HTConstants.HIBERNATE_TAG_MAPPING, HTConstants.HIBERNATE_TAG_CLASS, HibernateUtils.getPersistentClassName(rootClass)).hasNext();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -142,7 +142,7 @@
return ViewPlugin.getImageDescriptor(BUNDLE
.getString("OrmModelImageVisitor.Collection"));
}
- } catch (MappingException e) {
+ } catch (Exception e) {
return ViewPlugin.getImageDescriptor(BUNDLE
.getString("OrmModelImageVisitor.PersistentFieldNot_mapped"));
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-10-17 12:02:50 UTC (rev 4285)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-10-17 12:10:43 UTC (rev 4286)
@@ -12,10 +12,13 @@
import java.sql.Types;
import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jface.text.TextUtilities;
import org.eclipse.jface.viewers.ContentViewer;
import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
+import org.hibernate.eclipse.console.workbench.TypeNameValueVisitor;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.DependantValue;
@@ -25,24 +28,21 @@
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
+import org.hibernate.mapping.Value;
import org.hibernate.type.EntityType;
import org.hibernate.type.ManyToOneType;
public class OrmModelNameVisitor /*implements IOrmModelVisitor*/ {
- private ContentViewer viewer;
-
static private String SPACE = " ";
-
static private String POINTER = " -> ";
private ResourceBundle BUNDLE = ResourceBundle
.getBundle(OrmModelNameVisitor.class.getPackage().getName()
+ ".views");
- public OrmModelNameVisitor(ContentViewer viewer) {
+ public OrmModelNameVisitor() {
super();
- this.viewer = viewer;
}
public Object visitDatabaseColumn(Column column, Object argument) {
@@ -100,25 +100,56 @@
name.append(field.getName());
name.append(BUNDLE.getString("OrmModelNameVisitor.Colon"));
String typeString = null;
+
try {
- if (field.getType().isEntityType()) {
- typeString = ((EntityType)field.getType()).getAssociatedEntityName();
- } else {
- typeString = field.getType().getReturnedClass().getName();
- }
+ typeString = field.getType().getReturnedClass().getName();
} catch (Exception e) {
if (field.getValue() instanceof Component) {
typeString = ((Component)field.getValue()).getComponentClassName();
+ } else if (field.getValue().isSimpleValue()) {
+ typeString = ((SimpleValue)field.getValue()).getTypeName();
}
}
+
+
+
if (typeString != null) {
+ typeString = correctTypeString(typeString);
+ name.append(SPACE);
name.append(typeString);
}
- return name.toString();
+// return name.toString();
+ Value value = field.getValue();
+ String typeName = (String) value.accept(new TypeNameValueVisitor(false));
+
+ if (typeName!=null) {
+ return field.getName() + " : " + typeName;
+ }
+
+ return field.getName();
}
+ private String correctTypeString(String str) {
+ String ret = str;
+ while (ret.startsWith("[")) {
+ ret = ret.substring(1).concat("[]");
+ }
+ switch (ret.toCharArray()[0]) {
+ case 'Z': ret = "boolean".concat(ret.substring(1));break;
+ case 'B': ret = "byte".concat(ret.substring(1));break;
+ case 'C': ret = "char".concat(ret.substring(1));break;
+ case 'L': ret = ret.substring(1);break;
+ case 'D': ret = "double".concat(ret.substring(1));break;
+ case 'F': ret = "float".concat(ret.substring(1));break;
+ case 'I': ret = "int".concat(ret.substring(1));break;
+ case 'J': ret = "long".concat(ret.substring(1));break;
+ case 'S': ret = "short".concat(ret.substring(1));break;
+ }
+ return ret;
+ }
+
public Object visitCollectionKeyMapping(DependantValue mapping, Object argument) {
return "key";
}
17 years, 3 months