JBoss Tools SVN: r5243 - in trunk/jsf/docs/userguide/en: images/jsf_support and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-12-11 09:08:25 -0500 (Tue, 11 Dec 2007)
New Revision: 5243
Modified:
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_2.png
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_33.png
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_37.png
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_4.png
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_7.png
trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_8.png
trunk/jsf/docs/userguide/en/master.xml
trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml
trunk/jsf/docs/userguide/en/modules/jsf_support.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-162 the first three chapters of "Visual Web Tools Reference Guide" are updated, added and retaken screenshots.
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_2.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_33.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_37.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_4.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_7.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/jsf_support/jsf_support_8.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/master.xml
===================================================================
--- trunk/jsf/docs/userguide/en/master.xml 2007-12-11 14:02:43 UTC (rev 5242)
+++ trunk/jsf/docs/userguide/en/master.xml 2007-12-11 14:08:25 UTC (rev 5243)
@@ -6,10 +6,10 @@
<!ENTITY Visual_Web_Tools SYSTEM "modules/Visual_Web_Tools.xml">
<!ENTITY features_list SYSTEM "modules/features_list.xml">
<!ENTITY jsf_support SYSTEM "modules/jsf_support.xml">
-<!ENTITY struts SYSTEM "modules/struts.xml">
+<!ENTITY struts SYSTEM "modules/struts_support.xml">
+<!ENTITY editors SYSTEM "modules/editors.xml">
<!ENTITY palette SYSTEM "modules/palette.xml">
<!ENTITY web_projects SYSTEM "modules/web_projects.xml">
-<!ENTITY editors SYSTEM "modules/editors.xml">
<!ENTITY verif_valid SYSTEM "modules/verif_valid.xml">
<!--<!ENTITY editors_features SYSTEM "modules/editors_features.xml"> -->
@@ -37,9 +37,9 @@
&features_list;
&jsf_support;
&struts;
+ &editors;
&palette;
&web_projects;
&verif_valid;
- &editors;
&preferences;
</book>
Modified: trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml 2007-12-11 14:02:43 UTC (rev 5242)
+++ trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml 2007-12-11 14:08:25 UTC (rev 5243)
@@ -13,6 +13,6 @@
<title>Visual Web Tools</title>
<para>In <property>JBoss Tools</property>
there is an extensive collection of specialized wizards,
- editors and views that can be used in various scenerios. The following
+ editors and views that can be used in various scenarios while developing Web applications. The following
chapters walksthrough these features.</para>
</chapter>
Modified: trunk/jsf/docs/userguide/en/modules/jsf_support.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/jsf_support.xml 2007-12-11 14:02:43 UTC (rev 5242)
+++ trunk/jsf/docs/userguide/en/modules/jsf_support.xml 2007-12-11 14:08:25 UTC (rev 5243)
@@ -9,7 +9,7 @@
<keyword>Tomcat</keyword>
</keywordset>
</chapterinfo>
- <title>Java Server Faces Support</title>
+ <title>JavaServer Faces Support</title>
<para>JBoss Developer Studio is especially designed for supporting JSF and JSF-related
technologies. JBDS provides extensible and exemplary tools for building JSF-based
applications as well as adding JSF capabilities to existing web projects, importing
@@ -44,7 +44,7 @@
<title>Choosing JSF Environment</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jsf_support/jsf_support_1.png"/>
+ <imagedata fileref="images/jsf_support/jsf_support_11.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -112,7 +112,7 @@
</mediaobject>
</figure>
<para>The JBoss Tools Palette comes with the Facelets components ready to use. A
- useful tip appears when you hover the mouse cursor over the tag:</para>
+ useful tip appears when you hover the mouse cursor over the tag - that includes a detailed description of the tag component, the syntax and available attributes:</para>
<!-- JBoss Developer Studio does not provide templates for MyFaces right out of the box, but you can easily do it
yourself with the "Save As Template" feature (available on the File submenu). Just create a small project
@@ -142,10 +142,10 @@
<itemizedlist>
<listitem>
- <para>In any HTML tag you also get the code assist for <emphasis
+ <para>Code assist is also available for <emphasis
role="italic">
<property>"jsfc"</property>
- </emphasis> attribute</para>
+ </emphasis> attribute in any HTML tag</para>
</listitem>
</itemizedlist>
@@ -190,7 +190,7 @@
</mediaobject>
</figure>
- <para>Using JBoss Developer Studio OpenOn feature, you can easily navigate between
+ <para>JBDS provides Eclipse's <emphasis><property>OpenOn</property></emphasis> feature for editing Facelets files. Using this feature, you can easily navigate between
the <property>Facelets templates</property> and other parts of your
projects. Just by holding down the Control key while hovering the mouse
cursor over a reference to a template, the reference becomes a hyperlink to
@@ -360,7 +360,7 @@
</figure>
<para>When you are all done, you should have the project that has been
- created in the Package Explorer view:</para>
+ appeared in the Package Explorer view:</para>
<figure>
<title>A New Project in the Package Explorer</title>
<mediaobject>
@@ -373,7 +373,7 @@
</figure>
<para>At this point you can open faces-config.xml and start working on your
- application.</para>
+ application. JBDS provides a lot of features to develop JSF applications. We will describe the features further.</para>
</section>
<section id="ImportingExsJSFProjWithAnyStr74447">
@@ -412,7 +412,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>The wizard will first show you the web.xml file location and the
+ <para>The wizard will first ask you to show the web.xml file location and the
project name:</para>
<figure>
<title>Project Location</title>
@@ -464,7 +464,11 @@
</mediaobject>
</figure>
<para>Once your project is imported you can see that JSF related libraries
- have been added to your project jsf-api.jar and jsf-impl.jar.</para>
+ have been added to your project: jsf-api.jar and jsf-impl.jar.</para>
+ <note>
+ <title>Note:</title>
+ <para>Some application servers provide their own jsf implementation libraries. So, to avoid conflicts you should not add jsf libraries while adding jsf capabilities.</para>
+ </note>
<para>You are now ready to work with JSF by creating a new JSF configuration
file:</para>
@@ -485,7 +489,7 @@
<section id="AddingYourOwnProjectTemplates853">
<?dbhtml filename="AddingYourOwnProjectTemplates.html"?>
<title>Adding Your Own Project Templates</title>
-
+ <para>Template is a set of files that serve as a basis to facilitate the creation of a new project. Project templates provide content and structure for a project.</para>
<para>JBoss Developer Studio has a powerful templating capability for
creating new and importing existing Struts and JSF projects. This
templating facility has a variety of aspects to consider. But,
@@ -616,7 +620,7 @@
</mediaobject>
</figure>
- <para>It is also possible to create a new page by right-clicking anywhere on
+ <para>It is also possible to create a new page with context menu by right-clicking anywhere on
the diagram and selecting <emphasis>
<property> New View</property>
</emphasis>.</para>
@@ -651,8 +655,8 @@
<title>Tree View</title>
<para>The Tree mode for the editor displays all JSF application artifacts
- referenced in the configuration file in a tree format. Select any
- node and its properties will appear in the right-hand area:</para>
+ referenced in the configuration file in a tree format. By selecting any
+ node you can see and edit its properties will appear in the right-hand area. For example, a Managed Bean:</para>
<figure>
<title>Tree View</title>
<mediaobject>
@@ -664,7 +668,7 @@
</mediaobject>
</figure>
- <para>To edit, right-click any node and select one of the available actions
+ <para>To edit some artifact, right-click any node and select one of the available actions
in the context menu. You can also edit in the properties window to
the right:</para>
<figure>
@@ -677,6 +681,17 @@
</imageobject>
</mediaobject>
</figure>
+ <para>The same way you can create a new artifact:</para>
+ <figure>
+ <title>Creating a New Artifact in Tree View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/jsf_support/jsf_support_59.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
<section id="SourceView4643">
<?dbhtml filename="SourceView.html"?>
@@ -699,11 +714,11 @@
</section>
<section id="ContentAssist976">
<?dbhtml filename="SendAnAJAXRequest.html"?>
- <title>Content Assist</title>
-
- <para>Content assist is always available in the Source viewer:</para>
+ <title>Code Assist</title>
+ <para>Code Assist provides pop-up help to help you complete your code statements. Using Code Assist allows you to complete your code statements faster and with more accuracy.</para>
+ <para>Code assist is always available in the Source mode:</para>
<figure>
- <title>Content Assist in Source View</title>
+ <title>Code Assist in Source View</title>
<mediaobject>
<imageobject>
<imagedata
@@ -716,7 +731,7 @@
<section id="ErrorReporting3324">
<?dbhtml filename="ErrorReporting.html"?>
<title>Error Reporting</title>
-
+ <para>When you are developing your project, JBoss Developer Studio constantly provides error checking. This greatly reduces your development time as it allows you to catch many of the errors during development.</para>
<para>Errors will be reported by JBoss Developer Studio's <link
linkend="verif_valid"> verification</link>
facility:</para>
@@ -743,11 +758,11 @@
</mediaobject>
</figure>
- <para>You can also work in the Source viewer with the help of the <emphasis>
+ <para>You can also work in the Source editor with the help of the <emphasis>
<property>Outline view</property>
</emphasis>. The Outline views show a tree structure of the JSF
configuration file. Simply select any element in the Outline view,
- and it will jump to the same place in the Source viewer.</para>
+ and it will jump to the same place in the Source editor, so you can navigate through the source code with Outline view.</para>
<figure>
<title>Outline View</title>
<mediaobject>
@@ -776,9 +791,9 @@
</mediaobject>
</figure>
- <para>You can also edit in the <emphasis>
+ <para>You can also edit the properties of the selected element in the <emphasis>
<property>Tree</property>
- </emphasis> viewer with the help of the Properties view as shown
+ </emphasis> mode with the help of the Properties view as shown
below:</para>
<figure>
<title>Properties View </title>
@@ -828,9 +843,11 @@
</imageobject>
</mediaobject>
</figure>
- <para>When you define a new managed bean, make sure that Generate Source
- Code is checked as shown in the figure below:</para>
- <figure>
+ <note>
+ <title>Note:</title>
+ <para>When you define a new managed bean, make sure that Generate Source Code is checked as shown in the figure below:</para>
+ </note>
+ <figure>
<title>New Managed Bean</title>
<mediaobject>
<imageobject>
@@ -890,7 +907,7 @@
<property>"getter"</property>
</emphasis> and <emphasis role="italic">
<property>"setter"</property>
- </emphasis> methods:</para>
+ </emphasis> methods. Right click on the bean and select <emphasis><property>New > Property</property></emphasis>. You will see "Add Property" dialog:</para>
<figure>
<title>Generation of Source Code for Properties</title>
<mediaobject>
18 years
JBoss Tools SVN: r5242 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2007-12-11 09:02:43 -0500 (Tue, 11 Dec 2007)
New Revision: 5242
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/views/ConfigurationsViewActionGroup.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1412
PersistanceClass search updated (added entity-class,
full name and short name search).
Menus changed places.
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 2007-12-11 11:25:12 UTC (rev 5241)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2007-12-11 14:02:43 UTC (rev 5242)
@@ -31,6 +31,9 @@
*/
public class OpenMappingAction extends SelectionListenerAction {
+
+ private static final String HIBERNATE_TAG_NAME = "name";
+ private static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name";
public OpenMappingAction() {
super("Open Mapping File");
@@ -97,8 +100,8 @@
public static IRegion findSelection(Property property, FindReplaceDocumentAdapter findAdapter) {
Assert.isNotNull(property.getPersistentClass());
- try {
- IRegion classRegion = findAdapter.find(0, generatePattern(property.getPersistentClass()), true, true, false, true);
+ try {
+ IRegion classRegion = findSelection(property.getPersistentClass(), findAdapter);
if (classRegion == null) return null;
IRegion finalRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), "</class", true, true, false, false);
IRegion propRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), generatePattern(property), true, true, false, true);
@@ -118,7 +121,11 @@
public static IRegion findSelection(PersistentClass persClass,
FindReplaceDocumentAdapter findAdapter) {
try {
- IRegion classRegion = findAdapter.find(0, generatePattern(persClass), true, true, false, true);
+ String[] classPatterns = generatePatterns(persClass);
+ IRegion classRegion = null;
+ for (int i = 0; (classRegion == null) && (i < classPatterns.length); i++){
+ classRegion = findAdapter.find(0, classPatterns[i], true, true, false, true);
+ }
if (classRegion == null) return null;
int length = persClass.getNodeName().length();
int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
@@ -128,19 +135,67 @@
}
}
- private static String generatePattern(Object sel){
+ private static String[] generatePatterns(PersistentClass persClass){
+ String fullClassName = null;
+ if (persClass.getEntityName() != null){
+ fullClassName = persClass.getEntityName();
+ } else {
+ fullClassName = persClass.getClassName();
+ }
+
Cfg2HbmTool tool = new Cfg2HbmTool();
- String name = null;
+ String[] patterns = new String[4];
StringBuilder pattern = new StringBuilder("<");
- if (sel instanceof PersistentClass) {
- pattern.append(tool.getTag((PersistentClass)sel));
- name = ((PersistentClass)sel).getNodeName();
- } else if (sel instanceof Property){
- pattern.append(tool.getTag((Property)sel));
- name = ((Property)sel).getNodeName();
+ pattern.append(tool.getTag(persClass));
+ pattern.append("[\\s]+[.[^>]]*");
+ pattern.append(HIBERNATE_TAG_NAME);
+ pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append(persClass.getNodeName());
+ pattern.append('\"');
+ patterns[0] = pattern.toString();
+
+ pattern = new StringBuilder("<");
+ pattern.append(tool.getTag(persClass));
+ pattern.append("[\\s]+[.[^>]]*");
+ pattern.append(HIBERNATE_TAG_NAME);
+ pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append(fullClassName);
+ pattern.append('\"');
+ patterns[1] = pattern.toString();
+
+ pattern = new StringBuilder("<");
+ pattern.append(tool.getTag(persClass));
+ pattern.append("[\\s]+[.[^>]]*");
+ pattern.append(HIBERNATE_TAG_ENTITY_NAME);
+ pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append(persClass.getNodeName());
+ pattern.append('\"');
+ patterns[2] = pattern.toString();
+
+ pattern = new StringBuilder("<");
+ pattern.append(tool.getTag(persClass));
+ pattern.append("[\\s]+[.[^>]]*");
+ pattern.append(HIBERNATE_TAG_ENTITY_NAME);
+ pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append(fullClassName);
+ pattern.append('\"');
+ patterns[3] = pattern.toString();
+ return patterns;
+ }
+
+ private static String generatePattern(Property property){
+ Cfg2HbmTool tool = new Cfg2HbmTool();
+ StringBuilder pattern = new StringBuilder("<");
+ if(property.getPersistentClass().getIdentifierProperty()==property) {
+ pattern.append("id");
+ } else{
+ pattern.append(tool.getTag(property));
}
- pattern.append("[\\s]+[.[^>]]*name[\\s]*=[\\s]*\"");
- pattern.append(name).append("\"");
+ pattern.append("[\\s]+[.[^>]]*");
+ pattern.append(HIBERNATE_TAG_NAME);
+ pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append(property.getNodeName());
+ pattern.append('\"');
return pattern.toString();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2007-12-11 11:25:12 UTC (rev 5241)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2007-12-11 14:02:43 UTC (rev 5242)
@@ -139,14 +139,14 @@
menu.add(new Separator() );
if (first instanceof RootClass
//|| first instanceof Property
- || first instanceof Subclass){
+ || first instanceof Subclass){
+ menu.appendToGroup("deagramEditorAction", openSourceAction);
menu.add(openMappingAction);
- menu.add(openSourceAction);
}
if (first instanceof Property
&& ((Property)first).getPersistentClass() != null){
- menu.add(openMappingAction);
menu.add(openSourceAction);
+ menu.add(openMappingAction);
}
}
18 years
JBoss Tools SVN: r5241 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-12-11 06:25:12 -0500 (Tue, 11 Dec 2007)
New Revision: 5241
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java
Log:
JBIDE-1472
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java 2007-12-11 10:41:22 UTC (rev 5240)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/editor/PaletteDialog.java 2007-12-11 11:25:12 UTC (rev 5241)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.views.palette.editor;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.common.model.ui.navigator.*;
import org.jboss.tools.common.model.ui.objecteditor.XModelObjectEditor;
@@ -24,6 +25,9 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.common.meta.action.XActionItem;
+import org.jboss.tools.common.meta.action.XActionList;
+import org.jboss.tools.common.meta.action.XActionItem.Acceptor;
import org.jboss.tools.common.meta.help.HelpUtil;
import org.jboss.tools.common.model.event.*;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
@@ -36,7 +40,25 @@
protected XModelTreeListenerSWTSync syncListener = new XModelTreeListenerSWTSync(listener);
protected XModelTreeListener listener2 = new ObjectListener();
protected XModelTreeListenerSWTSync syncListener2 = new XModelTreeListenerSWTSync(listener2);
- TreeViewerMenuInvoker menu = new TreeViewerMenuInvoker();
+
+ TreeViewerMenuInvoker menu = new TreeViewerMenuInvoker() {
+ protected XActionList getActionList(XModelObject o) {
+ XActionList l = super.getActionList(o);
+ if(l != null) {
+ // Filter out 'Properties' item which is redundant in this editor.
+ l = (XActionList)l.copy(new Acceptor() {
+ public boolean accepts(XActionItem item) {
+ if(item.getName().startsWith("Propert")) {
+ return false;
+ }
+ return true;
+ }
+ });
+ }
+ return l;
+ }
+ };
+
PaletteDialogState state = new PaletteDialogState(this);
SL sl = new SL();
SashForm sash;
@@ -153,4 +175,5 @@
public void structureChanged(XModelTreeEvent event) {}
}
+
}
18 years
JBoss Tools SVN: r5240 - in trunk: core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-12-11 05:41:22 -0500 (Tue, 11 Dec 2007)
New Revision: 5240
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/plugin.xml
trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/plugin.xml
trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/src/main/org/jboss/ide/eclipse/jdt/j2ee/xml/ui/JDTJ2EEXMLUIMessages.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1450
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui.mbeans/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -82,7 +82,11 @@
icon="icons/mbean16.gif"
id="org.jboss.ide.eclipse.as.ui.MBeanComponents"
name="MBean Stubs"
- project="false"/>
+ project="false">
+ <description>
+ Create an MBean Stubs
+ </description>
+ </wizard>
</extension>
Modified: trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/plugin.xml
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -10,6 +10,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewApplicationXml13PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewApplicationXml13PageWizard">
+ <description>
+ Create an empty EAR 1.3 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="EAR 1.4 Deployment Descriptor"
@@ -17,6 +20,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewApplicationXml14PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewApplicationXml14PageWizard">
+ <description>
+ Create an empty EAR 1.4 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml10PageWizard"
@@ -24,6 +30,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml10PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml10PageWizard">
+ <description>
+ Create an empty J2EE Connector 1.0 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml15PageWizard"
@@ -31,6 +40,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml15PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewConnectorXml15PageWizard">
+ <description>
+ Create an empty J2EE Connector 1.5 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml20PageWizard"
@@ -38,6 +50,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml20PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml20PageWizard">
+ <description>
+ Create an empty EJB 2.0 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml21PageWizard"
@@ -45,6 +60,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml21PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewEjbXml21PageWizard">
+ <description>
+ Create an empty EJB 2.1 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml12PageWizard"
@@ -52,6 +70,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml12PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml12PageWizard">
+ <description>
+ Create an empty Tag Library 1.2 Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml20PageWizard"
@@ -59,6 +80,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml20PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewTagLibXml20PageWizard">
+ <description>
+ Create an empty Tag Library 2.0 Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml23PageWizard"
@@ -66,6 +90,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml23PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml23PageWizard">
+ <description>
+ Create an empty Web Application 2.3 Deployment Descriptor
+ </description>
</wizard>
<wizard
name="%org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml24PageWizard"
@@ -73,6 +100,9 @@
category="org.jboss.ide.eclipse.ui.wizards/org.jboss.ide.eclipse.ui.wizards.descriptors"
class="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml24PageWizard"
id="org.jboss.ide.eclipse.jdt.j2ee.xml.ui.wizards.NewWebXml24PageWizard">
+ <description>
+ Create an empty Web Application 2.4 Deployment Descriptor
+ </description>
</wizard>
</extension>
Modified: trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/src/main/org/jboss/ide/eclipse/jdt/j2ee/xml/ui/JDTJ2EEXMLUIMessages.properties
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/src/main/org/jboss/ide/eclipse/jdt/j2ee/xml/ui/JDTJ2EEXMLUIMessages.properties 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/core/plugins/org.jboss.ide.eclipse.jdt.j2ee.xml.ui/src/main/org/jboss/ide/eclipse/jdt/j2ee/xml/ui/JDTJ2EEXMLUIMessages.properties 2007-12-11 10:41:22 UTC (rev 5240)
@@ -45,5 +45,5 @@
NewWebXml24PageWizard.window.title=New Web Application 2.4 Deployment Descriptor
NewWebXml24PageWizardPage.title=Web Application 2.4 Deployment Descriptor
-NewWebXml24PageWizardPage.description=Create an empty Web Application 2.3 Deployment Descriptor
+NewWebXml24PageWizardPage.description=Create an empty Web Application 2.4 Deployment Descriptor
NewWebXml24PageWizardPage.message.extension=Deployment Descriptor are usually named web.xml
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -75,6 +75,9 @@
id="org.jboss.tools.jsf.ui.wizard.newfile.NewFacesConfigFileWizard"
name="Faces Config"
project="false">
+ <description>
+ Create a Faces Config
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -87,6 +90,9 @@
name="%newProjectWizard.name"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="true">
+ <description>
+ Create a JSF Project
+ </description>
</wizard>
</extension>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -46,6 +46,9 @@
<wizard category="org.jboss.tools.jst.web/org.jboss.tools.struts" class="org.jboss.tools.jst.web.tiles.ui.wizard.newfile.NewTilesFileWizard" icon="images/xstudio/wizards/new_tiles_file.gif" id="org.jboss.tools.jst.web.tiles.ui.wizard.newfile.NewTilesFileWizard" name="%new.tiles" project="false">
<selection class="org.eclipse.core.resources.IResource">
</selection>
+ <description>
+ Create a Tiles File
+ </description>
</wizard>
</extension>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -116,6 +116,9 @@
name="CSS File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a CSS File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -128,6 +131,9 @@
name="JS File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a JS File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -140,6 +146,9 @@
name="Web Descriptor"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a Web Descriptor
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -152,6 +161,9 @@
name="JSP File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a JSP File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -164,6 +176,9 @@
name="XHTML File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a XHTML File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -176,6 +191,9 @@
name="HTML File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a HTML File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -186,6 +204,9 @@
id="org.jboss.tools.common.model.ui.wizard.newfile.NewPropertiesFileWizard"
name="Properties File"
project="false">
+ <description>
+ Create a Properties File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -198,6 +219,9 @@
name="TLD File"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a TLD File
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
+++ trunk/struts/plugins/org.jboss.tools.struts.ui/plugin.xml 2007-12-11 10:41:22 UTC (rev 5240)
@@ -42,6 +42,9 @@
name="%newProjectWizard.name"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="true">
+ <description>
+ Create a Struts Project
+ </description>
</wizard>
<wizard
category="org.jboss.tools.jst.web/org.jboss.tools.struts"
@@ -52,6 +55,9 @@
name="%strutsConfig.11"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a Struts Config
+ </description>
<selection class="org.eclipse.core.resources.IResource">
</selection>
</wizard>
@@ -64,6 +70,9 @@
name="%new.validation"
preferredPerspectives="org.jboss.tools.jst.web.ui.WebDevelopmentPerspective"
project="false">
+ <description>
+ Create a Validation File
+ </description>
<selection
class="org.eclipse.core.resources.IResource">
</selection>
18 years
JBoss Tools SVN: r5239 - in trunk/common/plugins/org.jboss.tools.common.model: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-12-11 04:36:17 -0500 (Tue, 11 Dec 2007)
New Revision: 5239
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/EditHTMLTabNamespaceHandler.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_page.meta
Log:
JBIDE-1473
Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2007-12-11 09:11:52 UTC (rev 5238)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml 2007-12-11 09:36:17 UTC (rev 5239)
@@ -292,8 +292,6 @@
class="org.jboss.tools.common.model.loaders.impl.SimpleWebFileLoader"/>
<xclass id="org.jboss.tools.common.model.loaders.impl.URLRootLoader"
class="org.jboss.tools.common.model.loaders.impl.URLRootLoader"/>
- <xclass id="org.jboss.tools.common.model.options.impl.EditHTMLTabNamespaceHandler"
- class="org.jboss.tools.common.model.options.impl.EditHTMLTabNamespaceHandler"/>
<xclass id="org.jboss.tools.common.model.options.impl.HiddenPaletteTabsHandler"
class="org.jboss.tools.common.model.options.impl.HiddenPaletteTabsHandler"/>
<xclass id="org.jboss.tools.common.model.options.impl.PaletteAdopt"
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_page.meta
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_page.meta 2007-12-11 09:11:52 UTC (rev 5238)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_page.meta 2007-12-11 09:36:17 UTC (rev 5239)
@@ -558,14 +558,6 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem ICON="main.package" displayName="PageTab" group="1" kind="list">
- <XActionItem
- HandlerClassName="org.jboss.tools.common.model.options.impl.EditHTMLTabNamespaceHandler"
- ICON="action.empty" WizardClassName="%Default%"
- displayName="Edit Namespace" kind="action" name="EditNamespace">
- <EntityData EntityName="SPTNameSpaceHelper">
- <AttributeData AttributeName="namespace" Mandatory="no"/>
- </EntityData>
- </XActionItem>
<XActionItem ICON="action.empty" displayName="Create" kind="list" name="CreateActions">
<XActionItem
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler"
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/EditHTMLTabNamespaceHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/EditHTMLTabNamespaceHandler.java 2007-12-11 09:11:52 UTC (rev 5238)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/impl/EditHTMLTabNamespaceHandler.java 2007-12-11 09:36:17 UTC (rev 5239)
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.model.options.impl;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.impl.*;
-import org.jboss.tools.common.meta.action.impl.handlers.*;
-
-public class EditHTMLTabNamespaceHandler extends AbstractHandler {
-
- public EditHTMLTabNamespaceHandler() {}
-
- public boolean isEnabled(XModelObject object) {
- if(object == null || !object.isObjectEditable()) return false;
- XModelObject[] l = getMacroList(object);
- String ns = (l.length == 0) ? null : getNamespace(l[0]);
- return ns != null;
- }
-
- public void executeHandler(XModelObject object, Properties p) throws Exception {
- if(!isEnabled(object)) return;
- XModelObject[] l = getMacroList(object);
- String ns = (l.length == 0) ? null : getNamespace(l[0]);
- p = DefaultCreateHandler.extractProperties(data[0]);
- String ns2 = p.getProperty("namespace");
- for (int i = 0; i < l.length; i++) replace(l[i], ns, ns2);
- }
-
- private XModelObject[] getMacroList(XModelObject tab) {
- List<XModelObject> l = new ArrayList<XModelObject>();
- getMacroList(tab, l);
- return l.toArray(new XModelObject[0]);
- }
-
- private void getMacroList(XModelObject object, List<XModelObject> l) {
- if("SharableMacroHTML".equals(object.getModelEntity().getName())) {
- l.add(object);
- } else {
- XModelObject[] cs = object.getChildren();
- for (int i = 0; i < cs.length; i++) getMacroList(cs[i], l);
- }
- }
-
- private String getNamespace(XModelObject macro) {
- String start = macro.getAttributeValue("start text");
- if(!start.startsWith("<")) return null;
- int i = start.indexOf(':');
- int j = start.indexOf('>');
- return (j < 0) ? null : (i < 0 || i > j) ? "" : start.substring(1, i);
- }
-
- public void setDefaultData(XModelObject object) {
- super.setDefaultData(object);
- XModelObject[] l = getMacroList(object);
- if(l.length == 0) return;
- String ns = getNamespace(l[0]);
- if(ns != null && ns.length() > 0) data[0].getAttributeData()[0].setValue(ns);
- }
-
- private void replace(XModelObject o, String ns1, String ns2) {
- if(ns1.length() > 0) ns1 += ":";
- if(ns2.length() > 0) ns2 += ":";
- String start = o.getAttributeValue("start text");
- start = replace(start, "<", ns1, ns2);
- o.getModel().changeObjectAttribute(o, "start text", start);
- String end = o.getAttributeValue("end text");
- end = replace(end, "</", ns1, ns2);
- o.getModel().changeObjectAttribute(o, "end text", end);
- String d = o.getAttributeValue("description");
- d = replace(d, "<", ns1, ns2);
- d = replace(d, "<", ns1, ns2);
- d = replace(d, "</", ns1, ns2);
- d = replace(d, "</", ns1, ns2);
- o.getModel().changeObjectAttribute(o, "description", d);
- }
-
- private String replace(String text, String pref, String b1, String b2) {
- int i = text.indexOf(pref + b1);
- return (i < 0) ? text : text.substring(0, i + pref.length()) + b2 +
- text.substring(i + pref.length() + b1.length());
- }
-
-}
18 years
JBoss Tools SVN: r5238 - 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: dgeraskov
Date: 2007-12-11 04:11:52 -0500 (Tue, 11 Dec 2007)
New Revision: 5238
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1416
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml 2007-12-11 09:09:06 UTC (rev 5237)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/plugin.xml 2007-12-11 09:11:52 UTC (rev 5238)
@@ -2,7 +2,7 @@
<plugin>
<extension point="org.eclipse.ui.popupMenus">
- <objectContribution id="diagramEditorAction" objectClass="org.hibernate.mapping.RootClass">
+ <objectContribution id="diagramEditorAction" objectClass="org.hibernate.mapping.PersistentClass">
<menu id="org.jboss.tools.hibernate.ui.view.openDiagram" label="Open Mapping Diagram" path="diagramEditorAction"/>
<action
id="org.jboss.tools.hibernate.ui.view.openDiagramAction"
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-12-11 09:09:06 UTC (rev 5237)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OpenDiagramActionDelegate.java 2007-12-11 09:11:52 UTC (rev 5238)
@@ -20,6 +20,8 @@
import org.eclipse.ui.internal.ObjectPluginAction;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
import org.jboss.tools.hibernate.ui.view.ViewPlugin;
public class OpenDiagramActionDelegate extends OpenActionDelegate {
@@ -27,7 +29,13 @@
public void run(IAction action) {
ObjectPluginAction objectPluginAction = (ObjectPluginAction)action;
- Object rootClass = ((TreeSelection)objectPluginAction.getSelection()).getFirstElement();
+ Object persClass = ((TreeSelection)objectPluginAction.getSelection()).getFirstElement();
+ Object rootClass = null;
+ if (persClass instanceof RootClass) {
+ rootClass = (RootClass) persClass;
+ } else if (persClass instanceof Subclass) {
+ rootClass = ((Subclass) persClass).getRootClass();
+ }
ObjectEditorInput input = (ObjectEditorInput)hashMap.get(rootClass);
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(((TreeSelection)objectPluginAction.getSelection()).getPaths()[0]).getSegment(0);
18 years
JBoss Tools SVN: r5237 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2007-12-11 04:09:06 -0500 (Tue, 11 Dec 2007)
New Revision: 5237
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingActionDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceActionDelegate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1412
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingActionDelegate.java 2007-12-11 08:54:38 UTC (rev 5236)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingActionDelegate.java 2007-12-11 09:09:06 UTC (rev 5237)
@@ -25,6 +25,12 @@
import org.hibernate.mapping.RootClass;
import org.hibernate.util.XMLHelper;
+/**
+ * @author Dmitry Geraskov
+ * @deprecated - Can't shine selected element in the Editor.
+ * Use OpenMappingAction instead of this.
+ */
+
public class OpenMappingActionDelegate extends OpenActionDelegate {
private static XMLHelper helper = new XMLHelper();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceActionDelegate.java 2007-12-11 08:54:38 UTC (rev 5236)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceActionDelegate.java 2007-12-11 09:09:06 UTC (rev 5237)
@@ -25,6 +25,11 @@
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.mapping.RootClass;
+/**
+ * @author Dmitry Geraskov
+ * @deprecated - Can't shine selected element in the Editor.
+ * Use OpenSourceAction instead of this.
+ */
public class OpenSourceActionDelegate extends OpenActionDelegate {
public void run(IAction action) {
18 years
JBoss Tools SVN: r5236 - 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: dgeraskov
Date: 2007-12-11 03:54:38 -0500 (Tue, 11 Dec 2007)
New Revision: 5236
Added:
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/OpenSourceAction.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1412
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2007-12-11 08:54:31 UTC (rev 5235)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2007-12-11 08:54:38 UTC (rev 5236)
@@ -135,7 +135,7 @@
</extension>
<extension point="org.eclipse.ui.popupMenus">
- <objectContribution id="mappingEditorAction" objectClass="org.hibernate.mapping.RootClass">
+ <!--objectContribution id="mappingEditorAction" objectClass="org.hibernate.mapping.RootClass">
<menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
<action
id="org.hibernate.eclipse.console.actions.openMappingAction"
@@ -143,6 +143,14 @@
class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
</action>
</objectContribution>
+ <objectContribution id="mappingEditorAction2" objectClass="org.hibernate.mapping.Property">
+ <menu id="org.hibernate.eclipse.console.actions.openMappingMenu" label="Open Mapping File" path="mappingEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openMappingAction"
+ label="Open Mapping File"
+ class="org.hibernate.eclipse.console.actions.OpenMappingActionDelegate">
+ </action>
+ </objectContribution>
<objectContribution id="sourceEditorAction" objectClass="org.hibernate.mapping.RootClass">
<menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
<action
@@ -151,6 +159,14 @@
class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
</action>
</objectContribution>
+ <objectContribution id="sourceEditorAction2" objectClass="org.hibernate.mapping.Property">
+ <menu id="org.hibernate.eclipse.console.actions.openSourceMenu" label="Open Source File" path="sourceEditorAction"/>
+ <action
+ id="org.hibernate.eclipse.console.actions.openSourceAction"
+ label="Open Source File"
+ class="org.hibernate.eclipse.console.actions.OpenSourceActionDelegate">
+ </action>
+ </objectContribution-->
</extension>
<extension
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2007-12-11 08:54:31 UTC (rev 5235)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2007-12-11 08:54:38 UTC (rev 5236)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
@@ -47,8 +48,8 @@
private static final String HIBERNATE_TAG_CATALOG = "catalog";
private static final String HIBERNATE_TAG_SCHEMA = "schema";
- public static void openEditor(IWorkbenchPage page, IResource resource) throws PartInitException {
- IDE.openEditor(page, (IFile) resource);
+ public static IEditorPart openEditor(IWorkbenchPage page, IResource resource) throws PartInitException {
+ return IDE.openEditor(page, (IFile) resource);
}
Added: 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 (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2007-12-11 08:54:38 UTC (rev 5236)
@@ -0,0 +1,164 @@
+package org.hibernate.eclipse.console.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.SelectionListenerAction;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
+import org.hibernate.tool.hbm2x.Cfg2HbmTool;
+
+/**
+ * @author Dmitry Geraskov
+ */
+
+public class OpenMappingAction extends SelectionListenerAction {
+
+ public OpenMappingAction() {
+ super("Open Mapping File");
+ setToolTipText("Open Mapping File");
+ setEnabled( true );
+ }
+
+ public void run() {
+ IStructuredSelection sel = getStructuredSelection();
+ if (sel instanceof TreeSelection){
+ TreePath path = ((TreeSelection)sel).getPaths()[0];
+ ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
+ run(path.getLastSegment(), consoleConfiguration);
+ }
+ }
+
+ public void run(Object selection, ConsoleConfiguration consoleConfiguration) {
+ IEditorPart editorPart = null;
+ if (selection instanceof Property){
+ Property p = (Property)selection;
+ if (p.getPersistentClass() == null) return;
+ //use PersistentClass to open editor
+ editorPart = openMapping(p.getPersistentClass(), consoleConfiguration);
+ } else {
+ editorPart = openMapping(selection, consoleConfiguration);
+ }
+
+ Assert.isNotNull(editorPart);
+ ITextEditor textEditor = getTextEditor(editorPart);
+ if (textEditor == null) return;
+ IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
+ IRegion selectRegion = null;
+
+ if (selection instanceof RootClass
+ || selection instanceof Subclass){
+ selectRegion = findSelection((PersistentClass)selection, findAdapter);
+ } else if (selection instanceof Property){
+ selectRegion = findSelection((Property)selection, findAdapter);
+ }
+
+ if (selectRegion != null){
+ textEditor.selectAndReveal(selectRegion.getOffset(), selectRegion.getLength());
+ }
+ }
+
+ static public IEditorPart openMapping(Object selElement,
+ ConsoleConfiguration consoleConfiguration) {
+ IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
+ java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
+ IResource resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, selElement);
+
+ if (resource != null && resource instanceof IFile){
+ try {
+ return OpenFileActionUtils.openEditor(HibernateConsolePlugin.getDefault().getActiveWorkbenchWindow().getActivePage(), (IFile) resource);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping or source file.", e);
+ }
+ } else {
+ HibernateConsolePlugin.getDefault().log("Can't open mapping file for " + selElement);
+ }
+ return null;
+ }
+
+ public static IRegion findSelection(Property property, FindReplaceDocumentAdapter findAdapter) {
+ Assert.isNotNull(property.getPersistentClass());
+ try {
+ IRegion classRegion = findAdapter.find(0, generatePattern(property.getPersistentClass()), true, true, false, true);
+ if (classRegion == null) return null;
+ IRegion finalRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), "</class", true, true, false, false);
+ IRegion propRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), generatePattern(property), true, true, false, true);
+ if (propRegion != null && finalRegion != null
+ && propRegion.getOffset() > finalRegion.getOffset()){
+ return null;
+ } else {
+ int length = property.getName().length();
+ int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
+ return new Region(offset, length);
+ }
+ } catch (BadLocationException e) {
+ return null;
+ }
+
+ }
+ public static IRegion findSelection(PersistentClass persClass,
+ FindReplaceDocumentAdapter findAdapter) {
+ try {
+ IRegion classRegion = findAdapter.find(0, generatePattern(persClass), true, true, false, true);
+ if (classRegion == null) return null;
+ int length = persClass.getNodeName().length();
+ int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
+ return new Region(offset, length);
+ } catch (BadLocationException e) {
+ return null;
+ }
+ }
+
+ private static String generatePattern(Object sel){
+ Cfg2HbmTool tool = new Cfg2HbmTool();
+ String name = null;
+ StringBuilder pattern = new StringBuilder("<");
+ if (sel instanceof PersistentClass) {
+ pattern.append(tool.getTag((PersistentClass)sel));
+ name = ((PersistentClass)sel).getNodeName();
+ } else if (sel instanceof Property){
+ pattern.append(tool.getTag((Property)sel));
+ name = ((Property)sel).getNodeName();
+ }
+ pattern.append("[\\s]+[.[^>]]*name[\\s]*=[\\s]*\"");
+ pattern.append(name).append("\"");
+ return pattern.toString();
+ }
+
+ private ITextEditor getTextEditor(IEditorPart editorPart) {
+ /*
+ * if EditorPart is MultiPageEditorPart then get ITextEditor from it.
+ */
+ if (editorPart instanceof MultiPageEditorPart) {
+ ITextEditor editor = null;
+ IEditorPart[] editors = ((MultiPageEditorPart) editorPart).findEditors(editorPart.getEditorInput());
+ for (int i = 0; i < editors.length; i++) {
+ if (editors[i] instanceof ITextEditor){
+ editor = (ITextEditor) editors[i];
+ break;
+ }
+ }
+ return editor;
+ }
+ return null;
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2007-12-11 08:54:38 UTC (rev 5236)
@@ -0,0 +1,98 @@
+package org.hibernate.eclipse.console.actions;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.SelectionListenerAction;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
+
+/**
+ * @author Dmitry Geraskov
+ */
+
+public class OpenSourceAction extends SelectionListenerAction {
+
+ public OpenSourceAction() {
+ super("Open Source File");
+ setToolTipText("Open Source File");
+ setEnabled( true );
+ }
+
+ public void run() {
+ IStructuredSelection sel = getStructuredSelection();
+ if (sel instanceof TreeSelection){
+ TreePath path = ((TreeSelection)sel).getPaths()[0];
+ PersistentClass persClass = getPersistentClass(path.getLastSegment());
+ Assert.isNotNull(persClass);
+ ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
+ IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
+
+ IResource resource = null;
+ String fullyQualifiedName = OpenFileActionUtils.getPersistentClassName(persClass);
+ IType type = null;
+ try {
+ type = proj.findType(fullyQualifiedName);
+ if (type != null) resource = type.getResource();
+
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
+ }
+
+ if (resource instanceof IFile){
+ try {
+ IEditorPart editorPart = OpenFileActionUtils.openEditor(HibernateConsolePlugin.getDefault().getActiveWorkbenchWindow().getActivePage(), (IFile) resource);
+ if (editorPart instanceof JavaEditor) {
+ IJavaElement jElement = null;
+ if (path.getLastSegment() instanceof Property){
+ jElement = type.getField(((Property)path.getLastSegment()).getName());
+ } else {
+ jElement = type;
+ }
+ JavaEditor jEditor = (JavaEditor) editorPart;
+ selectionToEditor(jElement, jEditor);
+ }
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source file.", e);
+ }
+ }
+
+ if (resource == null) {
+ MessageDialog.openInformation(HibernateConsolePlugin.getDefault().getShell(), "Open Source File", "Source file for class '" + fullyQualifiedName + "' not found.");
+ }
+ }
+ }
+
+ private PersistentClass getPersistentClass(Object selection){
+ if (selection instanceof Property){
+ return ((Property)selection).getPersistentClass();
+ } else if (selection instanceof Subclass){
+ return (PersistentClass)selection;
+ } else {
+ return (RootClass)selection;
+ }
+ }
+
+ private void selectionToEditor(IJavaElement jElement, JavaEditor jEditor) {
+ if (jEditor != null) {
+ jEditor.setSelection(jElement);
+ }
+ }
+
+}
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2007-12-11 08:54:31 UTC (rev 5235)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2007-12-11 08:54:38 UTC (rev 5236)
@@ -24,18 +24,25 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.actions.SelectionListenerAction;
+import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
import org.hibernate.eclipse.console.actions.CriteriaEditorAction;
import org.hibernate.eclipse.console.actions.DeleteConfigurationAction;
import org.hibernate.eclipse.console.actions.EditConsoleConfiguration;
import org.hibernate.eclipse.console.actions.HQLScratchpadAction;
+import org.hibernate.eclipse.console.actions.OpenMappingAction;
+import org.hibernate.eclipse.console.actions.OpenSourceAction;
import org.hibernate.eclipse.console.actions.RefreshAction;
+import org.hibernate.mapping.Property;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
/**
* @author max
@@ -53,6 +60,8 @@
private final StructuredViewer selectionProvider;
private SelectionListenerAction hqlEditorAction;
private CriteriaEditorAction criteriaEditorAction;
+ private SelectionListenerAction openMappingAction;
+ private SelectionListenerAction openSourceAction;
public ConfigurationsViewActionGroup(IViewPart part, StructuredViewer selectionProvider) {
@@ -88,6 +97,13 @@
criteriaEditorAction = new CriteriaEditorAction();
selectionProvider.addSelectionChangedListener(criteriaEditorAction);
+
+ openMappingAction = new OpenMappingAction();
+ selectionProvider.addSelectionChangedListener(openMappingAction);
+
+ openSourceAction = new OpenSourceAction();
+ selectionProvider.addSelectionChangedListener(openSourceAction);
+
}
public void dispose() {
@@ -102,18 +118,36 @@
}
public void fillContextMenu(IMenuManager menu) {
-
+ if (getContext() == null) return;
+ IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();
+ if (selection == null) return;
+ Object first = selection.getFirstElement();
menu.add(hqlEditorAction);
menu.add(criteriaEditorAction);
menu.add(new Separator() );
menu.add(addConfigurationAction);
- menu.add(reloadConfigurationAction);
- menu.add(editConfigurationAction);
- menu.add(deleteConfigurationAction);
+ if (first instanceof ConsoleConfiguration){
+ menu.add(reloadConfigurationAction);
+ menu.add(editConfigurationAction);
+ menu.add(deleteConfigurationAction);
+ }
menu.add(new Separator() );
menu.add(refreshAction);
- menu.add(schemaExportAction);
-
+ if (first instanceof ConsoleConfiguration){
+ menu.add(schemaExportAction);
+ }
+ menu.add(new Separator() );
+ if (first instanceof RootClass
+ //|| first instanceof Property
+ || first instanceof Subclass){
+ menu.add(openMappingAction);
+ menu.add(openSourceAction);
+ }
+ if (first instanceof Property
+ && ((Property)first).getPersistentClass() != null){
+ menu.add(openMappingAction);
+ menu.add(openSourceAction);
+ }
}
public void fillActionBars(IActionBars actionBars) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2007-12-11 08:54:31 UTC (rev 5235)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2007-12-11 08:54:38 UTC (rev 5236)
@@ -40,7 +40,6 @@
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.internal.ObjectPluginAction;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.PropertySheetPage;
@@ -48,10 +47,11 @@
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.node.BaseNode;
import org.hibernate.eclipse.console.actions.EditConsoleConfiguration;
-import org.hibernate.eclipse.console.actions.OpenMappingActionDelegate;
+import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.workbench.xpl.AnyAdaptableLabelProvider;
-import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.util.StringHelper;
@@ -157,9 +157,13 @@
consoleConfiguration.executeHQLQuery( hql );
}
}
- } else if (firstElement instanceof RootClass) {
+ } else if (firstElement instanceof RootClass
+ || firstElement instanceof Subclass
+ || (firstElement instanceof Property
+ && ((Property)firstElement).getPersistentClass() != null)) {
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)((TreeSelection)selection).getPaths()[0].getSegment(0);
- OpenMappingActionDelegate.openMapping((RootClass) firstElement, consoleConfiguration);
+ //OpenMappingActionDelegate.openMapping((RootClass) firstElement, consoleConfiguration);
+ new OpenMappingAction().run(firstElement, consoleConfiguration);
}
}
};
18 years
JBoss Tools SVN: r5235 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test: mapping and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2007-12-11 03:54:31 -0500 (Tue, 11 Dec 2007)
New Revision: 5235
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Address.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Customer.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Employee.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.hbm.xml
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/hibernate.cfg.xml
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1412
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2007-12-10 22:49:57 UTC (rev 5234)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsolePluginAllTests.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -1,7 +1,6 @@
package org.hibernate.eclipse.console.test;
import java.io.IOException;
-import java.util.Properties;
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -17,6 +16,7 @@
suite.addTestSuite( PerspectiveTest.class );
suite.addTestSuite( ConsoleConfigurationTest.class );
suite.addTestSuite( JavaFormattingTest.class );
+ suite.addTestSuite( OpenMappingTests.class );
// core tests
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,74 @@
+package org.hibernate.eclipse.console.test;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Iterator;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.eclipse.console.actions.OpenMappingAction;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
+
+/**
+ * @author Dmitry Geraskov
+ */
+
+public class OpenMappingTests extends TestCase{
+
+ public static final String MAPPING_PACKAGE = "src/org/hibernate/eclipse/console/test/mapping/";
+ public static final String HIBERATE_CFG_FILE = "hibernate.cfg.xml";
+ public static final String PERSON_CFG_FILE = "Person.hbm.xml";
+
+ public void testParceComplexProcess() {
+ IPath path_hib = new Path(MAPPING_PACKAGE+HIBERATE_CFG_FILE);
+ IPath path_pers = new Path(MAPPING_PACKAGE+PERSON_CFG_FILE);
+ File file_hib = path_hib.toFile();
+ File file_pers = path_pers.toFile();
+ if (!file_hib.exists()) {
+ fail("File "+HIBERATE_CFG_FILE+" not found!");
+ }
+ if (!file_pers.exists()) {
+ fail("File "+PERSON_CFG_FILE+" not found!");
+ }
+ try {
+ Configuration config = new Configuration();
+ config.configure(file_hib);
+
+ FileReader reader = new FileReader(file_pers);
+ BufferedReader in = new BufferedReader(reader);
+ String s, text = "";
+ while ((s = in.readLine()) != null) {
+ text += s + '\n';
+ }
+ Document document = new Document(text);
+ FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
+
+ Iterator classMappings = config.getClassMappings();
+ while (classMappings.hasNext()) {
+ Object element = classMappings.next();
+ if (element instanceof PersistentClass) {
+ PersistentClass type = (PersistentClass)element;
+ assertNotNull(OpenMappingAction.findSelection(type, findAdapter));
+ Iterator properties = type.getPropertyIterator();
+ while (properties.hasNext()) {
+ Property prop = (Property) properties.next();
+ assertNotNull(OpenMappingAction.findSelection(prop, findAdapter));
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ fail("FileNotFoundException: "+ e.getMessage());
+ } catch (IOException e) {
+ fail("IOException: "+ e.getMessage());
+ }
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Address.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Address.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Address.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,11 @@
+//$Id$
+package org.hibernate.eclipse.console.test.mapping;
+
+/**
+ * @author Gavin King
+ */
+public class Address {
+ public String address;
+ public String zip;
+ public String country;
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Address.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Customer.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Customer.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Customer.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,35 @@
+//$Id$
+package org.hibernate.eclipse.console.test.mapping;
+
+/**
+ * @author Gavin King
+ */
+public class Customer extends Person {
+ private Employee salesperson;
+ private String comments;
+
+ /**
+ * @return Returns the salesperson.
+ */
+ public Employee getSalesperson() {
+ return salesperson;
+ }
+ /**
+ * @param salesperson The salesperson to set.
+ */
+ public void setSalesperson(Employee salesperson) {
+ this.salesperson = salesperson;
+ }
+ /**
+ * @return Returns the comments.
+ */
+ public String getComments() {
+ return comments;
+ }
+ /**
+ * @param comments The comments to set.
+ */
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Customer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Employee.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Employee.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Employee.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,49 @@
+//$Id$
+package org.hibernate.eclipse.console.test.mapping;
+
+import java.math.BigDecimal;
+
+/**
+ * @author Gavin King
+ */
+public class Employee extends Person {
+ private String title;
+ private BigDecimal salary;
+ private Employee manager;
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+ /**
+ * @param title The title to set.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+ /**
+ * @return Returns the manager.
+ */
+ public Employee getManager() {
+ return manager;
+ }
+ /**
+ * @param manager The manager to set.
+ */
+ public void setManager(Employee manager) {
+ this.manager = manager;
+ }
+ /**
+ * @return Returns the salary.
+ */
+ public BigDecimal getSalary() {
+ return salary;
+ }
+ /**
+ * @param salary The salary to set.
+ */
+ public void setSalary(BigDecimal salary) {
+ this.salary = salary;
+ }
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Employee.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.hbm.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.hbm.xml (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.hbm.xml 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates content-based discrimination for the
+ table-per-hierarchy mapping strategy, using a formula
+ discriminator.
+
+-->
+
+<hibernate-mapping
+ package="org.hibernate.eclipse.console.test.mapping"
+ default-access="field">
+
+ <class name="Person"
+ discriminator-value="P">
+
+ <id name="id"
+ column="person_id"
+ unsaved-value="0">
+ <generator class="native"/>
+ </id>
+
+
+ <discriminator
+ type="character"
+ formula="case when title is not null then 'E' when salesperson is not null then 'C' else 'P' end"/>
+
+ <property name="name"
+ not-null="true"
+ length="80"/>
+
+ <property name="sex"
+ not-null="true"
+ update="false"/>
+
+ <component name="address">
+ <property name="address"/>
+ <property name="zip"/>
+ <property name="country"/>
+ </component>
+
+ <subclass name="Employee"
+ discriminator-value="E">
+ <property name="title"
+ length="20"/>
+ <property name="salary"
+ length="0"/>
+ <many-to-one name="manager"/>
+ </subclass>
+
+ <subclass name="Customer"
+ discriminator-value="C">
+ <property name="comments"/>
+ <many-to-one name="salesperson"/>
+ </subclass>
+
+ </class>
+
+
+</hibernate-mapping>
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.hbm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.java 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,70 @@
+//$Id$
+package org.hibernate.eclipse.console.test.mapping;
+
+
+/**
+ * @author Gavin King
+ */
+public class Person {
+ private long id;
+ private String name;
+ private char sex;
+ private Address address = new Address();
+ /**
+ * @return Returns the address.
+ */
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(String string) {
+ this.address.address = string;
+ }
+
+ public void setZip(String string) {
+ this.address.zip = string;
+ }
+
+ public void setCountry(String string) {
+ this.address.country = string;
+ }
+
+
+ /**
+ * @return Returns the sex.
+ */
+ public char getSex() {
+ return sex;
+ }
+ /**
+ * @param sex The sex to set.
+ */
+ public void setSex(char sex) {
+ this.sex = sex;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public long getId() {
+ return id;
+ }
+ /**
+ * @param id The id to set.
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+ /**
+ * @return Returns the identity.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param identity The identity to set.
+ */
+ public void setName(String identity) {
+ this.name = identity;
+ }
+
+}
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/Person.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/hibernate.cfg.xml
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/hibernate.cfg.xml (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/hibernate.cfg.xml 2007-12-11 08:54:31 UTC (rev 5235)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC
+"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <property name="hibernate.bytecode.use_reflection_optimizer">false</property>
+ <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
+ <property name="hibernate.connection.password">postgres</property>
+ <property name="hibernate.connection.url">jdbc:postgresql:postgres</property>
+ <property name="hibernate.connection.username">postgres</property>
+ <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+
+ <mapping resource="org\hibernate\eclipse\console\test\mapping\Person.hbm.xml" />
+
+ </session-factory>
+
+
+</hibernate-configuration>
+
Property changes on: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mapping/hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
18 years
JBoss Tools SVN: r5234 - trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-12-10 17:49:57 -0500 (Mon, 10 Dec 2007)
New Revision: 5234
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
Log:
JBIDE-1408 issue if destination for the archive doesn't exist already. Was weird; simple fix.
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2007-12-10 21:21:28 UTC (rev 5233)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/build/ArchiveBuildDelegate.java 2007-12-10 22:49:57 UTC (rev 5234)
@@ -79,6 +79,9 @@
EventManager.startedBuildingArchive(pkg);
ModelTruezipBridge.deleteArchive(pkg);
+ if( !pkg.getGlobalDestinationPath().toFile().exists() ) {
+ pkg.getGlobalDestinationPath().toFile().mkdirs();
+ }
ModelTruezipBridge.createFile(pkg);
// force create all folders
18 years