JBoss Tools SVN: r14551 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:46:38 -0400 (Tue, 07 Apr 2009)
New Revision: 14551
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TreeToTableComposite.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java
Log:
JBIDE-4137
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TreeToTableComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TreeToTableComposite.java 2009-04-07 12:46:06 UTC (rev 14550)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TreeToTableComposite.java 2009-04-07 12:46:38 UTC (rev 14551)
@@ -94,7 +94,7 @@
return null;
}
protected Object doGetValue() {
- return new Integer(value);
+ return Integer.valueOf(value);
}
protected void doSetFocus() {
@@ -129,7 +129,7 @@
return null;
} else {
try {
- return new Integer(Integer.parseInt((String) super.doGetValue()));
+ return Integer.valueOf(Integer.parseInt((String) super.doGetValue()));
} catch(NumberFormatException nfe) {
return null;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java 2009-04-07 12:46:06 UTC (rev 14550)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java 2009-04-07 12:46:38 UTC (rev 14551)
@@ -104,12 +104,12 @@
if("not-null".equals(property)) { //$NON-NLS-1$
if(tf.getNullable()==null) {
- return new Integer(2);
+ return Integer.valueOf(2);
}
if(tf.getNullable().booleanValue()) {
- return new Integer(0);
+ return Integer.valueOf(0);
} else {
- return new Integer(1);
+ return Integer.valueOf(1);
}
}
15 years, 8 months
JBoss Tools SVN: r14550 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views: properties and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:46:06 -0400 (Tue, 07 Apr 2009)
New Revision: 14550
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
Log:
JBIDE-4137
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java 2009-04-07 12:45:22 UTC (rev 14549)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/KnownConfigurationsNavigator.java 2009-04-07 12:46:06 UTC (rev 14550)
@@ -29,7 +29,7 @@
public class KnownConfigurationsNavigator extends CommonNavigator {
protected IAdaptable getInitialInput() {
- return new AdaptableWrapper(new String());
+ return new AdaptableWrapper(""); //$NON-NLS-1$
}
public void createPartControl(Composite aParent) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-04-07 12:45:22 UTC (rev 14549)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2009-04-07 12:46:06 UTC (rev 14550)
@@ -62,7 +62,7 @@
if(descriptors==null) {
PropertyDescriptor[] properties = new PropertyDescriptor[collection.size()];
for (int i = 0; i < properties.length; i++) {
- properties[i] = new PropertyDescriptor(new Integer(i),"#" + i); //$NON-NLS-1$
+ properties[i] = new PropertyDescriptor(Integer.valueOf(i),"#" + i); //$NON-NLS-1$
}
descriptors = properties;
}
15 years, 8 months
JBoss Tools SVN: r14549 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:45:22 -0400 (Tue, 07 Apr 2009)
New Revision: 14549
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/NavigatorProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
Log:
JBIDE-4137
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-04-07 12:44:48 UTC (rev 14548)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-04-07 12:45:22 UTC (rev 14549)
@@ -168,7 +168,6 @@
result = (String) context.execute(new ExecutionContext.Command() {
public Object execute() {
- Session session = null;
try {
SessionFactoryImpl sfimpl = (SessionFactoryImpl) sf; // hack - to get to the actual queries..
StringBuffer str = new StringBuffer(256);
@@ -205,7 +204,6 @@
}
return str.toString();
} catch(Throwable t) {
- if(session!=null) session.close();
//StringWriter sw = new StringWriter();
StringBuffer msgs = new StringBuffer();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/NavigatorProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/NavigatorProvider.java 2009-04-07 12:44:48 UTC (rev 14548)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/NavigatorProvider.java 2009-04-07 12:45:22 UTC (rev 14549)
@@ -85,7 +85,7 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
- children[kids] = new Long(kids);
+ children[kids] = Long.valueOf(kids);
}
return children;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-04-07 12:44:48 UTC (rev 14548)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2009-04-07 12:45:22 UTC (rev 14549)
@@ -249,7 +249,7 @@
int i = 0;
while(iterator.hasNext()) {
if (type == ((Type) iterator.next())) {
- return new Integer(i);
+ return Integer.valueOf(i);
}
i++;
}
15 years, 8 months
JBoss Tools SVN: r14548 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: actions and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:44:48 -0400 (Tue, 07 Apr 2009)
New Revision: 14548
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterProperty.java
Log:
JBIDE-4137
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2009-04-07 12:43:40 UTC (rev 14547)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2009-04-07 12:44:48 UTC (rev 14548)
@@ -99,7 +99,7 @@
*/
public HibernateConsolePlugin() {
super();
- plugin = this;
+ setPlugin(this);
}
@@ -301,7 +301,7 @@
public void stop(BundleContext context) throws Exception {
super.stop(context);
stopListeningForConfigurations();
- plugin = null;
+ setPlugin(null);
resourceBundle = null;
}
@@ -315,6 +315,10 @@
return plugin;
}
+ private static void setPlugin(HibernateConsolePlugin plugin) {
+ HibernateConsolePlugin.plugin = plugin;
+ }
+
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-04-07 12:43:40 UTC (rev 14547)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-04-07 12:44:48 UTC (rev 14548)
@@ -222,11 +222,9 @@
return editor;
}
}
- if (editorPart == null) {
- String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_file_for_property_not_found, compositeProperty.getNodeName());
- throw new FileNotFoundException(out);
- }
- return null;
+ // here editorPart := null
+ String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_file_for_property_not_found, compositeProperty.getNodeName());
+ throw new FileNotFoundException(out);
}
/**
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2009-04-07 12:43:40 UTC (rev 14547)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2009-04-07 12:44:48 UTC (rev 14548)
@@ -206,7 +206,7 @@
if(props.containsKey("template_path")) { //$NON-NLS-1$
String resolveTemplatePath = resolve(props.getProperty("template_path")); //$NON-NLS-1$
StringTokenizer st = new StringTokenizer(resolveTemplatePath, ";"); //$NON-NLS-1$
- String out = new String();
+ String out = ""; //$NON-NLS-1$
while (st.hasMoreTokens()) {
String locationAsStringPath = PathHelper.getLocationAsStringPath(st.nextToken());
if(locationAsStringPath==null) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterProperty.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterProperty.java 2009-04-07 12:43:40 UTC (rev 14547)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterProperty.java 2009-04-07 12:44:48 UTC (rev 14548)
@@ -88,6 +88,10 @@
}
return false;
}
+
+ public int hashCode() {
+ return getName().hashCode();
+ }
public boolean isRequired() {
return required;
15 years, 8 months
JBoss Tools SVN: r14547 - in trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate: console/node and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:43:40 -0400 (Tue, 07 Apr 2009)
New Revision: 14547
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
Log:
JBIDE-4137
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java 2009-04-07 12:21:20 UTC (rev 14546)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleQueryParameter.java 2009-04-07 12:43:40 UTC (rev 14547)
@@ -44,22 +44,22 @@
static final Map typeFormats = new HashMap();
static {
addTypeFormat(Hibernate.BOOLEAN, Boolean.TRUE );
- addTypeFormat(Hibernate.BYTE, new Byte((byte) 42));
+ addTypeFormat(Hibernate.BYTE, Byte.valueOf((byte) 42));
addTypeFormat(Hibernate.BIG_INTEGER, BigInteger.valueOf(42));
- addTypeFormat(Hibernate.SHORT, new Short((short) 42));
+ addTypeFormat(Hibernate.SHORT, Short.valueOf((short) 42));
addTypeFormat(Hibernate.CALENDAR, new GregorianCalendar());
addTypeFormat(Hibernate.CALENDAR_DATE, new GregorianCalendar());
- addTypeFormat(Hibernate.INTEGER, new Integer(42));
- addTypeFormat(Hibernate.INTEGER, new Integer(42));
+ addTypeFormat(Hibernate.INTEGER, Integer.valueOf(42));
+ addTypeFormat(Hibernate.INTEGER, Integer.valueOf(42));
addTypeFormat(Hibernate.BIG_DECIMAL, new BigDecimal(42.0));
- addTypeFormat(Hibernate.CHARACTER, new Character('h'));
+ addTypeFormat(Hibernate.CHARACTER, Character.valueOf('h'));
addTypeFormat(Hibernate.CLASS, Table.class);
addTypeFormat(Hibernate.CURRENCY, Currency.getInstance(Locale.getDefault()));
addTypeFormat(Hibernate.DATE, new Date());
- addTypeFormat(Hibernate.DOUBLE, new Double(42.42));
- addTypeFormat(Hibernate.FLOAT, new Float(42.42));
+ addTypeFormat(Hibernate.DOUBLE, Double.valueOf(42.42));
+ addTypeFormat(Hibernate.FLOAT, Float.valueOf((float)42.42));
addTypeFormat(Hibernate.LOCALE, Locale.getDefault());
- addTypeFormat(Hibernate.LONG, new Long(42));
+ addTypeFormat(Hibernate.LONG, Long.valueOf(42));
addTypeFormat(Hibernate.STRING, "a string"); //$NON-NLS-1$
addTypeFormat(Hibernate.TEXT, "a text"); //$NON-NLS-1$
addTypeFormat(Hibernate.TIME, new Date());
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-04-07 12:21:20 UTC (rev 14546)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-04-07 12:43:40 UTC (rev 14547)
@@ -105,7 +105,7 @@
Iterator iterator = map.keySet().iterator();
//TODO: filter non classes.
- String imports = new String();
+ String imports = ""; //$NON-NLS-1$
while (iterator.hasNext() ) {
String element = (String) iterator.next();
imports += "import " + element + ";\n"; //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2009-04-07 12:21:20 UTC (rev 14546)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/NodeFactory.java 2009-04-07 12:43:40 UTC (rev 14547)
@@ -121,7 +121,7 @@
Enhancer e = ProxyFactory.createEnhancer(PropertyNode.class);
return (BaseNode) e.create(new Class[] { NodeFactory.class, BaseNode.class, int.class, ClassMetadata.class, Object.class, boolean.class},
- new Object[] { this, node, new Integer(i),md,baseObject,Boolean.valueOf(objectGraph) } );
+ new Object[] { this, node, Integer.valueOf(i),md,baseObject,Boolean.valueOf(objectGraph) } );
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-04-07 12:21:20 UTC (rev 14546)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/CurrentContext.java 2009-04-07 12:43:40 UTC (rev 14547)
@@ -51,9 +51,6 @@
map.put( key, stack );
stack.push( message );
}
- else if ( stack.isEmpty() ) {
- stack.push( message );
- }
else {
stack.push( message );
}
15 years, 8 months
JBoss Tools SVN: r14546 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:21:20 -0400 (Tue, 07 Apr 2009)
New Revision: 14546
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
Log:
JBIDE-4139 - [ (4) EclipseImageMap - declare static variable which is not expose it's static nature; ]
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-04-07 12:19:09 UTC (rev 14545)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/EclipseImageMap.java 2009-04-07 12:21:20 UTC (rev 14546)
@@ -39,7 +39,7 @@
*/
public class EclipseImageMap extends ImageMap {
- protected static URL ICON_BASE_URL = null;
+ protected URL ICON_BASE_URL = null;
public EclipseImageMap(Plugin plugin) {
String pathSuffix = "icons/";//$NON-NLS-1$
15 years, 8 months
JBoss Tools SVN: r14545 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-04-07 08:19:09 -0400 (Tue, 07 Apr 2009)
New Revision: 14545
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/AbstractPane.java
Log:
JBIDE-4139 - [ (7) AbstractPane - recursive call "typo" error fix; ]
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/AbstractPane.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/AbstractPane.java 2009-04-07 11:04:24 UTC (rev 14544)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/xpl/AbstractPane.java 2009-04-07 12:19:09 UTC (rev 14545)
@@ -1916,6 +1916,7 @@
container,
labelText,
comboListener,
+ labelProvider,
null,
helpId
);
15 years, 8 months
JBoss Tools SVN: r14544 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-07 07:04:24 -0400 (Tue, 07 Apr 2009)
New Revision: 14544
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4135
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-04-07 10:57:01 UTC (rev 14543)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-04-07 11:04:24 UTC (rev 14544)
@@ -44,7 +44,7 @@
+ ".project.default.deployment.type"; //$NON-NLS-1$
/**
- * Last selected deployment type
+ * Last selected Seam configuration template
*/
public static final String SEAM_CONFIG_TEMPLATE = SeamCorePlugin.PLUGIN_ID
+ ".project.facet.config.template"; //$NON-NLS-1$
15 years, 8 months
JBoss Tools SVN: r14543 - in trunk/seam/plugins: org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-04-07 06:57:01 -0400 (Tue, 07 Apr 2009)
New Revision: 14543
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4135 Set Seam default configuration to 2.0v.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-04-07 10:15:45 UTC (rev 14542)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-04-07 10:57:01 UTC (rev 14543)
@@ -198,10 +198,6 @@
facet="jst.java"/>
<fixed
facet="jst.web"/>
- <!--fixed
- facet="jst.seam"/>
- <fixed
- facet="jst.jsf"/-->
<preset
id="jst.seam.preset">
</preset>
@@ -216,14 +212,24 @@
facet="jst.java"/>
<fixed
facet="jst.web"/>
- <!--fixed
- facet="jst.seam"/>
- <fixed
- facet="jst.jsf"/-->
<preset
id="jst.seam2.preset">
</preset>
</template>
+
+ <template
+ id="template.jst.seam21">
+ <label>
+ Seam 2.1 Web Project
+ </label>
+ <fixed
+ facet="jst.java"/>
+ <fixed
+ facet="jst.web"/>
+ <preset
+ id="jst.seam21.preset">
+ </preset>
+ </template>
</extension>
<extension
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-04-07 10:15:45 UTC (rev 14542)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamProjectPreferences.java 2009-04-07 10:57:01 UTC (rev 14543)
@@ -44,6 +44,12 @@
+ ".project.default.deployment.type"; //$NON-NLS-1$
/**
+ * Last selected deployment type
+ */
+ public static final String SEAM_CONFIG_TEMPLATE = SeamCorePlugin.PLUGIN_ID
+ + ".project.facet.config.template"; //$NON-NLS-1$
+
+ /**
* Last selected DB type
*/
public static final String HIBERNATE_DEFAULT_DB_TYPE = SeamCorePlugin.PLUGIN_ID
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-04-07 10:15:45 UTC (rev 14542)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2009-04-07 10:57:01 UTC (rev 14543)
@@ -54,6 +54,7 @@
.node(DefaultScope.SCOPE)
.node(SeamCorePlugin.PLUGIN_ID);
+ node.put(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE, "template.jst.seam2"); //$NON-NLS-1$
node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war"); //$NON-NLS-1$
node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL"); //$NON-NLS-1$
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 2009-04-07 10:15:45 UTC (rev 14542)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2009-04-07 10:57:01 UTC (rev 14543)
@@ -13,7 +13,9 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IProject;
@@ -25,6 +27,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -54,6 +57,7 @@
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -69,13 +73,10 @@
import org.jboss.tools.jst.web.server.RegistrationHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
-import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils;
import org.jboss.tools.seam.internal.core.project.facet.DataSourceXmlDeployer;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.project.facet.Seam2ProjectCreator;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetProjectCreationDataModelProvider;
-import org.jboss.tools.seam.internal.core.project.facet.SeamProjectCreator;
import org.jboss.tools.seam.ui.ISeamHelpContextIds;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -88,6 +89,14 @@
*/
public class SeamProjectWizard extends WebProjectWizard {
+ private SeamWebProjectFirstPage firstPage;
+ private String seamConfigTemplate;
+
+ // We need these controls there to listen to them to set seam action models.
+ private Combo matchedServerTargetCombo;
+ private Control[] dependentServerControls;
+ private Combo serverRuntimeTargetCombo;
+
public SeamProjectWizard() {
super();
setWindowTitle(SeamUIMessages.SEAM_PROJECT_WIZARD_NEW_SEAM_PROJECT);
@@ -102,8 +111,6 @@
return DataModelFactory.createDataModel(new SeamFacetProjectCreationDataModelProvider());
}
- private SeamWebProjectFirstPage firstPage;
-
@Override
protected IWizardPage createFirstPage() {
firstPage = new SeamWebProjectFirstPage(model, "first.page"); //$NON-NLS-1$
@@ -114,11 +121,17 @@
return firstPage;
}
- // We need these controls there to listen to them to set seam action models.
- private Combo matchedServerTargetCombo;
- private Control[] dependentServerControls;
- private Combo serverRuntimeTargetCombo;
+ private static final Map<String, String> templates = new HashMap<String, String>();
+ static {
+ templates.put("jst.seam.preset", "template.jst.seam");
+ templates.put("jst.seam2.preset", "template.jst.seam2");
+ templates.put("jst.seam21.preset", "template.jst.seam21");
+ }
+ private void setSeamConfigTemplate(String seamConfigTemplate) {
+ this.seamConfigTemplate = seamConfigTemplate;
+ }
+
@Override
public void createPageControls(Composite container) {
super.createPageControls(container);
@@ -130,6 +143,12 @@
}, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
getFacetedProjectWorkingCopy().addListener(new IFacetedProjectListener() {
public void handleEvent(IFacetedProjectEvent event) {
+ IPreset preset = getFacetedProjectWorkingCopy().getSelectedPreset();
+ setSeamConfigTemplate(templates.get(preset.getId()));
+ }
+ }, IFacetedProjectEvent.Type.SELECTED_PRESET_CHANGED);
+ getFacetedProjectWorkingCopy().addListener(new IFacetedProjectListener() {
+ public void handleEvent(IFacetedProjectEvent event) {
Set<Action> actions = getFacetedProjectWorkingCopy().getProjectFacetActions();
for (Action action : actions) {
if(ISeamFacetDataModelProperties.SEAM_FACET_ID.equals(action.getProjectFacetVersion().getProjectFacet().getId())) {
@@ -203,7 +222,8 @@
}
protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("template.jst.seam"); //$NON-NLS-1$
+ seamConfigTemplate = SeamCorePlugin.getDefault().getPluginPreferences().getString(SeamProjectPreferences.SEAM_CONFIG_TEMPLATE);
+ return ProjectFacetsManager.getTemplate(seamConfigTemplate);
}
/* (non-Javadoc)
@@ -503,12 +523,18 @@
public void storeDefaultSettings() {
super.storeDefaultSettings();
+ Preferences preferences = SeamCorePlugin.getDefault().getPluginPreferences();
String serverName = SeamFacetProjectCreationDataModelProvider.getServerName(model);
if (serverName != null && serverName.length() > 0) {
- SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ preferences.setValue(
SeamProjectPreferences.SEAM_LAST_SERVER_NAME,
serverName);
}
+ if(seamConfigTemplate!=null) {
+ preferences.setValue(
+ SeamProjectPreferences.SEAM_CONFIG_TEMPLATE,
+ seamConfigTemplate);
+ }
}
}
}
\ No newline at end of file
15 years, 8 months
JBoss Tools SVN: r14542 - in workspace/dart/smooksConfigurationsEditor: 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: 2009-04-07 06:15:45 -0400 (Tue, 07 Apr 2009)
New Revision: 14542
Added:
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
Modified:
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/edit/common/provider/AbstractAnyTypeItemProvider.java
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
Log:
Modified: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/edit/common/provider/AbstractAnyTypeItemProvider.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/edit/common/provider/AbstractAnyTypeItemProvider.java 2009-04-07 09:48:50 UTC (rev 14541)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/edit/common/provider/AbstractAnyTypeItemProvider.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -15,7 +15,6 @@
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -28,10 +27,6 @@
import org.jboss.tools.smooks.edit.xsl.provider.Xsl1EditPlugin;
import org.jboss.tools.smooks.model.common.AbstractAnyType;
import org.jboss.tools.smooks.model.common.CommonPackage;
-import org.jboss.tools.smooks.model.smooks.SmooksFactory;
-import org.jboss.tools.smooks.model.smooks.SmooksPackage;
-import org.jboss.tools.smooks.model.xsl.XslFactory;
-import org.jboss.tools.smooks.model.xsl.XslPackage;
/**
@@ -58,6 +53,10 @@
super(adapterFactory);
}
+ protected boolean isWrappingNeeded(Object object){
+ wrappingNeeded = null;
+ return super.isWrappingNeeded(object);
+ }
/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
Added: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java (rev 0)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ * <p>
+ * Apr 7, 2009
+ */
+public interface IPropertyUICreator {
+ public void createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature);
+}
Property changes on: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java (rev 0)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)<p>
+ * Apr 7, 2009
+ */
+public class PropertyUICreatorManager {
+ private static PropertyUICreatorManager instance;
+
+ private Map<Class<?>,IPropertyUICreator> map = null;
+
+ private PropertyUICreatorManager(){
+ map = new HashMap<Class<?>,IPropertyUICreator>();
+ }
+
+ public void registePropertyUICreator(Class<?> key,IPropertyUICreator creator){
+ map.put(key, creator);
+ }
+
+ public IPropertyUICreator getPropertyUICreator(Class<?> key){
+ return map.get(key);
+ }
+
+ public IPropertyUICreator getPropertyUICreator(Object model){
+ return map.get(model.getClass());
+ }
+
+ public static synchronized PropertyUICreatorManager getInstance() {
+ if(instance == null){
+ instance = new PropertyUICreatorManager();
+ }
+ return instance;
+ }
+}
Property changes on: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-04-07 09:48:50 UTC (rev 14541)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
+ * 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,
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.BasicFeatureMapEntry;
-import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IWrapperItemProvider;
@@ -27,6 +27,9 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
@@ -46,9 +49,12 @@
import org.eclipse.ui.forms.widgets.Section;
/**
- * @author Dart Peng (dpeng(a)redhat.com) Date Apr 1, 2009
+ * @author Dart Peng (dpeng(a)redhat.com)
+ * <p>
+ * Date Apr 1, 2009
*/
-public class SmooksMasterDetailBlock extends MasterDetailsBlock implements IMenuListener {
+public class SmooksMasterDetailBlock extends MasterDetailsBlock implements IMenuListener,
+ ISelectionChangedListener {
private Section configurationSection;
private SectionPart sectionPart;
@@ -101,7 +107,12 @@
*/
@Override
protected void registerPages(DetailsPart detailsPart) {
-
+ SmooksStuffDetailsPageProvider provider = new SmooksStuffDetailsPageProvider();
+ detailsPart.setPageProvider(provider);
+ // provider.registePage(ResourceType.class, new
+ // SmooksStuffPropertyDetailPage());
+ detailsPart.registerPage(EObject.class, new SmooksStuffPropertyDetailPage(
+ (SmooksMultiFormEditor) this.formEditor));
}
protected void createSmooksTreeViewer(FormToolkit tool, final IManagedForm managedForm,
@@ -126,14 +137,17 @@
fillLayout.marginHeight = 1;
fillLayout.marginWidth = 1;
tableComposite.setLayout(fillLayout);
- smooksTreeViewer = new TreeViewer(tableComposite, SWT.NONE);
+ smooksTreeViewer = new TreeViewer(tableComposite, SWT.NONE) {
+
+ };
+ smooksTreeViewer.addSelectionChangedListener(this);
smooksTreeViewer.setContentProvider(new AdapterFactoryContentProvider(editingDomain
.getAdapterFactory()));
smooksTreeViewer.setLabelProvider(new AdapterFactoryLabelProvider(editingDomain.getAdapterFactory()));
smooksTreeViewer.setFilters(new ViewerFilter[] { new TextEObjectModelFilter() });
Object smooksModel = ((SmooksMultiFormEditor) this.formEditor).getSmooksModel();
if (smooksModel != null) {
- smooksTreeViewer.setInput(smooksModel);
+ smooksTreeViewer.setInput(editingDomain.getResourceSet());
}
createMenuForViewer(smooksTreeViewer);
formEditor.getSite().setSelectionProvider(smooksTreeViewer);
@@ -142,6 +156,7 @@
smooksTreeViewer.addSelectionChangedListener((ISelectionChangedListener) formEditor
.getEditorSite().getActionBarContributor());
}
+ smooksTreeViewer.addSelectionChangedListener(this);
gd = new GridData(GridData.FILL_BOTH);
tableComposite.setLayoutData(gd);
@@ -213,7 +228,36 @@
}
public void setSmooksModel(Object model) {
- smooksTreeViewer.setInput(model);
+ if (model != null) {
+ smooksTreeViewer.setInput(model);
+ } else {
+ smooksTreeViewer.setInput(new Object());
+ }
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(
+ * org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (sectionPart != null && sectionPart.getManagedForm() != null) {
+ Object[] objs = ((IStructuredSelection) event.getSelection()).toArray();
+ List<Object> objList = new ArrayList<Object>();
+ for (int i = 0; i < objs.length; i++) {
+ Object obj = objs[i];
+ obj = AdapterFactoryEditingDomain.unwrap(obj);
+ objList.add(obj);
+ }
+ if (objList.isEmpty()) {
+ sectionPart.getManagedForm().fireSelectionChanged(sectionPart, event.getSelection());
+ } else {
+ sectionPart.getManagedForm().fireSelectionChanged(sectionPart,
+ new StructuredSelection(objList.toArray()));
+ }
+ }
+ }
+
}
Modified: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-07 09:48:50 UTC (rev 14541)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -13,6 +13,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EventObject;
@@ -34,10 +35,12 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IWrapperItemProvider;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.eclipse.jface.text.DocumentEvent;
@@ -95,7 +98,7 @@
// Try to select the affected objects.
//
Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand();
- if (mostRecentCommand != null) {
+ if (mostRecentCommand != null && (mostRecentCommand instanceof AddCommand)) {
setSelectionToViewer(mostRecentCommand.getAffectedObjects());
}
if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
@@ -169,7 +172,14 @@
public void setSelectionToViewer(Collection<?> collection) {
final Collection<?> theSelection = collection;
if (theSelection != null && !theSelection.isEmpty() && configurationPage != null) {
- configurationPage.setSelectionToViewer(collection);
+ List<Object> newList = new ArrayList<Object>();
+ for (Iterator<?> iterator = theSelection.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ if(object instanceof IWrapperItemProvider){
+ newList.add(((IWrapperItemProvider)object).getValue());
+ }
+ }
+ configurationPage.setSelectionToViewer(newList);
}
}
@@ -223,7 +233,6 @@
if (handleEMFModelChange) {
handleEMFModelChange = false;
-// handleDocumentChange();
} else {
timerTask = new TimerTask() {
@Override
@@ -258,10 +267,11 @@
try {
resource.load(new ByteArrayInputStream(conents.getBytes()), Collections.emptyMap());
this.smooksModel = resource.getContents().get(0);
- configurationPage.setSmooksModel(this.smooksModel);
} catch (IOException e) {
- e.printStackTrace();
+ smooksModel = null;
+ SmooksConfigurationActivator.getDefault().log(e);
}
+ configurationPage.setSmooksModel(this.smooksModel);
}
protected SmooksConfigurationFormPage createSmooksConfigurationFormPage() {
@@ -280,6 +290,13 @@
*/
@Override
public void doSave(IProgressMonitor monitor) {
+ IEditorPart activeEditor = getActiveEditor();
+ if(activeEditor != null && activeEditor == textEditor){
+ textEditor.doSave(monitor);
+ ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
+ firePropertyChange(PROP_DIRTY);
+ return;
+ }
Map<?, ?> options = Collections.emptyMap();
initSaveOptions(options);
if (editingDomain != null) {
@@ -339,30 +356,6 @@
}
- protected void pageChange(int newPageIndex) {
- int index = this.getActivePage();
- if (index == newPageIndex) {
- super.pageChange(newPageIndex);
- return;
- }
- if (isDirty()) {
- if (index == 0 && newPageIndex == 1) {
- synchronizeModelToText();
- }
- if (index == 1 && newPageIndex == 0) {
- synchronizeTextToModel();
- }
- }
- }
-
- private void synchronizeTextToModel() {
-
- }
-
- private void synchronizeModelToText() {
-
- }
-
public ComposedAdapterFactory getAdapterFactory() {
return adapterFactory;
}
Added: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java (rev 0)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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();
+ }
+
+}
Property changes on: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffDetailsPageProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java (rev 0)
+++ workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-04-07 10:15:45 UTC (rev 14542)
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * 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.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor.PropertyValueWrapper;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+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.Text;
+import org.eclipse.ui.forms.IDetailsPage;
+import org.eclipse.ui.forms.IFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ *
+ * @author Dart (dpeng(a)redhat.com)
+ * <p>
+ * Apr 7, 2009
+ */
+public class SmooksStuffPropertyDetailPage implements IDetailsPage {
+ FormToolkit formToolKit = null;
+ private IManagedForm managedForm;
+ private ISelection selection;
+ private IFormPart formPart;
+ private Section section;
+ private SmooksMultiFormEditor formEditor;
+ private AdapterFactoryLabelProvider labelProvider = null;
+ private AdapterFactoryEditingDomain editingDomain = null;
+ private IItemPropertySource itemPropertySource = null;
+
+ private Object oldModel = null;
+
+ private boolean isStale = false;
+ private Composite propertyMainComposite;
+ private Composite propertyComposite;
+
+ public SmooksStuffPropertyDetailPage(SmooksMultiFormEditor formEditor) {
+ super();
+ this.formEditor = formEditor;
+ editingDomain = (AdapterFactoryEditingDomain) formEditor.getEditingDomain();
+ labelProvider = new AdapterFactoryLabelProvider(editingDomain.getAdapterFactory());
+ }
+
+ public void createContents(Composite parent) {
+ parent.setLayout(new FillLayout());
+ section = formToolKit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+
+ Composite client = formToolKit.createComposite(section);
+ section.setLayout(new FillLayout());
+ section.setClient(client);
+ createSectionContents(client);
+ }
+
+ private void createSectionContents(Composite client) {
+ client.setLayout(new FillLayout());
+ propertyMainComposite = new Composite(client, SWT.NONE);
+ propertyMainComposite.setLayout(new FillLayout());
+ propertyComposite = new Composite(propertyMainComposite, SWT.NONE);
+ }
+
+ /**
+ *
+ * @param propertyComposite
+ */
+ protected void createPropertyComposite(Composite propertyComposite) {
+ try {
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ propertyComposite.setLayout(layout);
+ IPropertyUICreator creator = PropertyUICreatorManager.getInstance().getPropertyUICreator(
+ getModel());
+ List<IItemPropertyDescriptor> propertyDes = itemPropertySource.getPropertyDescriptors(getModel());
+ for (Iterator<IItemPropertyDescriptor> iterator = propertyDes.iterator(); iterator.hasNext();) {
+ final IItemPropertyDescriptor itemPropertyDescriptor = (IItemPropertyDescriptor) iterator.next();
+ EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(getModel());
+ if (creator != null) {
+ creator.createPropertyUI(formToolKit, propertyComposite, itemPropertyDescriptor,
+ getModel(), feature);
+ } else {
+ String displayName = itemPropertyDescriptor.getDisplayName(getModel());
+ formToolKit.createLabel(propertyComposite, displayName + " :");
+ EClassifier typeClazz = feature.getEType();
+ if (typeClazz.getInstanceClass() == String.class) {
+ final Text text = formToolKit.createText(propertyComposite, "", SWT.NONE);
+ final Object value = itemPropertyDescriptor.getPropertyValue(getModel());
+ if (value != null && value instanceof PropertyValueWrapper) {
+ Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ if (editValue != null)
+ text.setText(editValue.toString());
+ }
+ text.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if (value != null && value instanceof PropertyValueWrapper) {
+ Object editValue = ((PropertyValueWrapper) value).getEditableValue(getModel());
+ if (editValue != null){
+ if(!editValue.equals(text.getText())){
+ itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ }
+ }else{
+ itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ }
+ }else{
+ itemPropertyDescriptor.setPropertyValue(getModel(), text.getText());
+ }
+ }
+ });
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(gd);
+ }
+ }
+ }
+ formToolKit.paintBordersFor(propertyComposite);
+ propertyComposite.pack();
+ propertyMainComposite.layout();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse
+ * .ui.forms.IFormPart, org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IFormPart part, ISelection selection) {
+ Object oldModel = getModel();
+ setOldModel(oldModel);
+ this.selection = selection;
+ this.formPart = part;
+ this.itemPropertySource = (IItemPropertySource) editingDomain.getAdapterFactory().adapt(getModel(),
+ IItemPropertySource.class);
+ if (getOldModel() == getModel())
+ return;
+ if (getOldModel() != getModel()) {
+ if (propertyComposite != null) {
+ propertyComposite.dispose();
+ propertyComposite = new Composite(propertyMainComposite, SWT.NONE);
+ }
+ createPropertyComposite(propertyComposite);
+ }
+// if ((getModel() != null && getOldModel() != null)) {
+// if ((getModel().getClass() != getOldModel().getClass())) {
+// if (propertyComposite != null) {
+// propertyComposite.dispose();
+// propertyComposite = new Composite(propertyMainComposite, SWT.NONE);
+// }
+// createPropertyComposite(propertyComposite);
+// }
+// }
+ refreshWhenSelectionChanged();
+ }
+
+ public void commit(boolean onSave) {
+
+ }
+
+ public void dispose() {
+
+ }
+
+ public IFormPart getFormPart() {
+ return formPart;
+ }
+
+ public void initialize(IManagedForm form) {
+ this.managedForm = form;
+ if (managedForm != null) {
+ formToolKit = managedForm.getToolkit();
+ }
+ }
+
+ public boolean isDirty() {
+ return false;
+ }
+
+ public boolean isStale() {
+ return this.isStale;
+ }
+
+ public void refresh() {
+ }
+
+ public void setFocus() {
+
+ }
+
+ public boolean setFormInput(Object input) {
+ return false;
+ }
+
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+ }
+
+ public Object getModel() {
+ if (selection != null && selection instanceof IStructuredSelection) {
+ return ((IStructuredSelection) selection).getFirstElement();
+ }
+ return null;
+ }
+
+ protected void refreshWhenSelectionChanged() {
+ Object model = getModel();
+ if (model instanceof EObject) {
+ String text = labelProvider.getText(model);
+ section.setText(text);
+ section.setDescription("Details of " + text);
+ }
+ }
+
+ public SmooksMultiFormEditor getFormEditor() {
+ return formEditor;
+ }
+
+ protected Object getOldModel() {
+ return oldModel;
+ }
+
+ protected void setOldModel(Object oldModel) {
+ this.oldModel = oldModel;
+ }
+
+ public void setStale(boolean isStale) {
+ this.isStale = isStale;
+ }
+}
Property changes on: workspace/dart/smooksConfigurationsEditor/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 8 months