JBoss Tools SVN: r8683 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: estherbin
Date: 2008-06-10 11:45:43 -0400 (Tue, 10 Jun 2008)
New Revision: 8683
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java
Log:
Fix junit
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java 2008-06-10 15:43:52 UTC (rev 8682)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1713Test.java 2008-06-10 15:45:43 UTC (rev 8683)
@@ -107,7 +107,7 @@
String activeToggleClass = activeToggle.getAttribute(HTML.ATTR_CLASS);
assertNotNull(activeToggleClass);
assertEquals(
- "dr-pnlbar-h rich-panelbar-header myHeaderStyleActive myHeaderStyleActive",
+ "dr-pnlbar-h rich-panelbar-header myHeaderStyle1 myHeaderStyle myHeaderStyleActive1 myHeaderStyleActive",
activeToggleClass);
String activeToggleStyle = activeToggle.getAttribute(HTML.ATTR_STYLE);
@@ -136,7 +136,7 @@
.getAttribute(HTML.ATTR_CLASS);
assertNotNull(activeContentClass);
assertEquals(
- "dr-pnlbar-c rich-panelbar-content myContentStyle myContentStyle",
+ "dr-pnlbar-c rich-panelbar-content myContentStyle1 myContentStyle",
activeContentClass);
// check facet
17 years, 10 months
JBoss Tools SVN: r8682 - trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-06-10 11:43:52 -0400 (Tue, 10 Jun 2008)
New Revision: 8682
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl
Log:
http://jira.jboss.com/jira/browse/JBDS-336 - highlighting meaningful words
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl 2008-06-10 15:17:47 UTC (rev 8681)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl 2008-06-10 15:43:52 UTC (rev 8682)
@@ -6,12 +6,11 @@
Author: Mark Newton <mark.newton(a)jboss.org>
-->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="classpath:/xslt/org/jboss/pdf.xsl"/>
-
+
<!-- overwriting links properties -->
- <xsl:param name="ulink.show" select="0"></xsl:param>
<xsl:attribute-set name="xref.properties">
<xsl:attribute name="text-decoration">
@@ -23,5 +22,13 @@
</xsl:attribute>
</xsl:attribute-set>
+ <!-- highlighting meaningful words -->
+ <xsl:template match="property">
+ <xsl:variable name="currant" select="child::node()"/>
+ <fo:inline color="#0066cc">
+ <xsl:value-of select="$currant"/>
+ </fo:inline>
+ </xsl:template>
+
</xsl:stylesheet>
17 years, 10 months
JBoss Tools SVN: r8681 - trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-06-10 11:17:47 -0400 (Tue, 10 Jun 2008)
New Revision: 8681
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl
Log:
http://jira.jboss.com/jira/browse/JBDS-336 - all links are underlined & displayed URLs after them are ommited.
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl 2008-06-10 15:17:12 UTC (rev 8680)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/pdf.xsl 2008-06-10 15:17:47 UTC (rev 8681)
@@ -9,8 +9,19 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="classpath:/xslt/org/jboss/pdf.xsl"/>
-
- <!-- Ignore image scaling in html version -->
- <xsl:param name="ignore.image.scaling" select="1"/>
+ <!-- overwriting links properties -->
+ <xsl:param name="ulink.show" select="0"></xsl:param>
+
+ <xsl:attribute-set name="xref.properties">
+ <xsl:attribute name="text-decoration">
+ <xsl:choose>
+ <xsl:when test="self::ulink">underline</xsl:when>
+ <xsl:when test="self::link">underline</xsl:when>
+ <!--xsl:otherwise>inherit</xsl:otherwise-->
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+
</xsl:stylesheet>
17 years, 10 months
JBoss Tools SVN: r8680 - trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-06-10 11:17:12 -0400 (Tue, 10 Jun 2008)
New Revision: 8680
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/pdf.xsl
Log:
http://jira.jboss.com/jira/browse/JBDS-336 - all links are underlined & displayed URLs after them are ommited.
Bg color for 'note', 'important' & 'tip' boxes is changed.
Meaningful words are highrlighted
Modified: trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/pdf.xsl
===================================================================
--- trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/pdf.xsl 2008-06-10 13:54:56 UTC (rev 8679)
+++ trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/pdf.xsl 2008-06-10 15:17:12 UTC (rev 8680)
@@ -6,8 +6,122 @@
Author: Mark Newton <mark.newton(a)jboss.org>
-->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="classpath:/xslt/com/jboss/pdf.xsl"/>
+
+ <!--xsl:template name="toc.line">
+ <xsl:param name="toc-context" select="NOTANODE"/>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
+ <xsl:variable name="label">
+ <xsl:apply-templates select="." mode="label.markup"/>
+ </xsl:variable>
+
+ <fo:block xsl:use-attribute-sets="toc.line.properties">
+ <fo:inline keep-with-next.within-line="always">
+
+ <fo:basic-link internal-destination="{$id}"
+ background-image="new.png"
+ background-repeat="no-repeat"
+ background-position-horizontal="right">
+
+
+ <xsl:if test="$label != ''">
+ <xsl:copy-of select="$label"/>
+ <xsl:value-of select="$autotoc.label.separator"/>
+ </xsl:if>
+ <xsl:apply-templates select="." mode="title.markup"/>
+ </fo:basic-link>
+ </fo:inline>
+ <fo:inline keep-together.within-line="always">
+ <xsl:text> </xsl:text>
+ <fo:leader leader-pattern="dots"
+ leader-pattern-width="3pt"
+ leader-alignment="reference-area"
+ keep-with-next.within-line="always"/>
+ <xsl:text> </xsl:text>
+ <fo:basic-link internal-destination="{$id}">
+ <fo:page-number-citation ref-id="{$id}"/>
+ </fo:basic-link>
+ </fo:inline>
+ </fo:block>
+ </xsl:template-->
+
+ <!-- overwriting links properties -->
+ <xsl:param name="ulink.show" select="0"></xsl:param>
+
+ <xsl:attribute-set name="xref.properties">
+ <xsl:attribute name="text-decoration">
+ <xsl:choose>
+ <xsl:when test="self::ulink">underline</xsl:when>
+ <xsl:when test="self::link">underline</xsl:when>
+ <!--xsl:otherwise>inherit</xsl:otherwise-->
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+<!-- note, impotent & tip boxes bgcolor overwriting -->
+ <xsl:attribute-set name="graphical.admonition.properties">
+
+ <xsl:attribute name="color">
+ <xsl:choose>
+ <xsl:when test="self::note">#4C5253</xsl:when>
+ <xsl:when test="self::caution">#533500</xsl:when>
+ <xsl:when test="self::important">white</xsl:when>
+ <xsl:when test="self::warning">white</xsl:when>
+ <xsl:when test="self::tip">white</xsl:when>
+ <xsl:otherwise>white</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:attribute name="background-color">
+ <xsl:choose>
+ <xsl:when test="self::note">#B5BCBD</xsl:when>
+ <xsl:when test="self::caution">#E3A835</xsl:when>
+ <xsl:when test="self::important">#5d7694</xsl:when>
+ <xsl:when test="self::warning">#7B1E1E</xsl:when>
+ <xsl:when test="self::tip">#859986</xsl:when>
+ <!--xsl:otherwise>#404040</xsl:otherwise-->
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:attribute name="space-before.optimum">1em</xsl:attribute>
+ <xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-before.maximum">1.2em</xsl:attribute>
+ <xsl:attribute name="space-after.optimum">1em</xsl:attribute>
+ <xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
+ <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
+ <xsl:attribute name="padding-bottom">12pt</xsl:attribute>
+ <xsl:attribute name="padding-top">12pt</xsl:attribute>
+ <xsl:attribute name="padding-right">12pt</xsl:attribute>
+ <xsl:attribute name="padding-left">12pt</xsl:attribute>
+ <xsl:attribute name="margin-left">
+ <xsl:value-of select="$title.margin.left"/>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- tables headers bgcolor overwriting -->
+
+ <!--xsl:template name="table.cell.block.properties">
+ <xsl:if test="ancestor::thead or ancestor::tfoot">
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ <xsl:attribute name="background-color">green</xsl:attribute>
+ <xsl:attribute name="border-color">green</xsl:attribute>
+ <xsl:attribute name="color">white</xsl:attribute>
+ </xsl:if>
+ </xsl:template-->
+
+ <!-- highlighting meaningful words -->
+
+ <xsl:template match="property">
+ <xsl:variable name="currant" select="child::node()"/>
+ <fo:inline color="#0066cc">
+ <xsl:value-of select="$currant"/>
+ </fo:inline>
+ </xsl:template>
+
</xsl:stylesheet>
17 years, 10 months
JBoss Tools SVN: r8679 - in trunk/esb/plugins/org.jboss.tools.esb.core: resources/meta and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-10 09:54:56 -0400 (Tue, 10 Jun 2008)
New Revision: 8679
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBRouteToImpl.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/NotificationConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/RouteToConverter.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/AliasConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/IPropertyConverter.java
Log:
JBIDE-2022
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2008-06-10 13:54:56 UTC (rev 8679)
@@ -29,6 +29,8 @@
class="org.jboss.tools.esb.core.model.ESBAnyElementPresentation"/>
<xclass id="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"
class="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.ESBRouteToImpl"
+ class="org.jboss.tools.esb.core.model.ESBRouteToImpl"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2008-06-10 13:54:56 UTC (rev 8679)
@@ -49,6 +49,44 @@
</ICONS>
<GlobalActions kind="list"/>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionAggregator101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.Aggregator" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="timeout in millies" xmlname="timeoutInMillies"/>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionByteArrayToString101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -88,6 +126,145 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionCommandInterpreter101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.jbpm.CommandInterpreter"
+ name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%" name="ESBPreActionContentBasedRouter101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreRouteTo"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.ContentBasedRouter" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="rule set" xmlname="ruleSet"/>
+ <XModelAttribute PROPERTIES="category=general;pre=true;save=always"
+ name="rule language" xmlname="ruleLanguage"/>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ default="Default(false)" name="rule reload" xmlname="ruleReload">
+ <Constraint loader="ListString">
+ <value name="Default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Constraint loader="ListString">
+ <value name="process"/>
+ <value name="split"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Route To..." kind="action" name="AddRouteTo">
+ <EntityData EntityName="ESBPreRouteTo">
+ <AttributeData AttributeName="destination name"/>
+ <AttributeData AttributeName="service category" Mandatory="no"/>
+ <AttributeData AttributeName="service name" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionGroovyProcessor101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor"
+ name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general" name="script" xmlname="script"/>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionLongToDateConverter101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -167,6 +344,51 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%" name="ESBPreActionNotifier101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreNotificationList"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.Notifier" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Notification List..." kind="action" name="AddNotificationList">
+ <EntityData EntityName="ESBPreNotificationList">
+ <AttributeData AttributeName="type"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionObjectInvoke101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -306,6 +528,92 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionSOAPClient101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.soap.SOAPClient" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general" name="wsdl" xmlname="wsdl"/>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="operation" xmlname="operation"/>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Property..." kind="action" name="AddProperty">
+ <EntityData EntityName="ESBProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionSOAPProcessor101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.soap.SOAPProcessor" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="jbossws endpoint" xmlname="jbossws-endpoint"/>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionSmooksTransformer101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -351,6 +659,164 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%" name="ESBPreActionStaticRouter101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreRouteTo"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.StaticRouter" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Constraint loader="ListString">
+ <value name="process"/>
+ <value name="split"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Route To..." kind="action" name="AddRouteTo">
+ <EntityData EntityName="ESBPreRouteTo">
+ <AttributeData AttributeName="destination name"/>
+ <AttributeData AttributeName="service category" Mandatory="no"/>
+ <AttributeData AttributeName="service name"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%" name="ESBPreActionStaticWiretap101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreRouteTo"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.StaticWiretap" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Constraint loader="ListString">
+ <value name="process"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Route To..." kind="action" name="AddRouteTo">
+ <EntityData EntityName="ESBPreRouteTo">
+ <AttributeData AttributeName="destination name"/>
+ <AttributeData AttributeName="service category" Mandatory="no"/>
+ <AttributeData AttributeName="service name"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData" name="ESBPreActionSystemPrintln101">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pre-packed action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="org.jboss.soa.esb.actions.SystemPrintln" name="class" xmlname="class">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute
+ PROPERTIES="pre=true;category=general;id=true;save=always"
+ name="message" xmlname="message"/>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ default="Default(false)" name="print full" xmlname="printfull">
+ <Constraint loader="ListString">
+ <value name="Default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ default="Default(false)" name="output stream" xmlname="outputstream">
+ <Constraint loader="ListString">
+ <value name="Default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="process" xmlname="process">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%" name="ESBPreActionXStreamToObject101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -457,6 +923,107 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=notification"
+ XMLSUBPATH="NotificationList" name="ESBPreNotificationList">
+ <XChildrenEntities>
+ <XChildEntity name="AnyElement"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="notification list" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="type" xmlname="type"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="entity=AnyElement" WizardClassName="%Default%"
+ displayName="Add Tag..." kind="action" name="CreateTag">
+ <EntityData EntityName="AnyElementNew">
+ <AttributeData AttributeName="tag"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.ESBRouteToImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=route"
+ XMLSUBPATH="route-to" name="ESBPreRouteTo">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="route to" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general"
+ name="destination name" xmlname="destination-name"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="service category" xmlname="service-category"/>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="service name" xmlname="service-name"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XEntityExtension name="ESBActions101">
<XChildrenEntities>
<XChildEntity name="ESBPreActionByteArrayToString101"/>
@@ -467,6 +1034,16 @@
<XChildEntity name="ESBPreActionSmooksTransformer101"/>
<XChildEntity name="ESBPreActionMessagePersister101"/>
<XChildEntity name="ESBPreActionXStreamToObject101"/>
+ <XChildEntity name="ESBPreActionCommandInterpreter101"/>
+ <XChildEntity name="ESBPreActionGroovyProcessor101"/>
+ <XChildEntity name="ESBPreActionAggregator101"/>
+ <XChildEntity name="ESBPreActionContentBasedRouter101"/>
+ <XChildEntity name="ESBPreActionStaticRouter101"/>
+ <XChildEntity name="ESBPreActionStaticWiretap101"/>
+ <XChildEntity name="ESBPreActionSOAPProcessor101"/>
+ <XChildEntity name="ESBPreActionSOAPClient101"/>
+ <XChildEntity name="ESBPreActionSystemPrintln101"/>
+ <XChildEntity name="ESBPreActionNotifier101"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -474,21 +1051,6 @@
<XActionItem displayName="Pre-packed Action" group="1" kind="list" name="PrePackedAction">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Byte Array To String..." kind="action" name="AddByteArrayToString">
- <EntityData EntityName="ESBPreActionByteArrayToString101">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="encoding" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Long To Date..." kind="action" name="AddLongToDate">
- <EntityData EntityName="ESBPreActionLongToDateConverter101">
- <AttributeData AttributeName="name"/>
- </EntityData>
- </XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Object Invoke..." kind="action" name="AddObjectInvoke">
<EntityData EntityName="ESBPreActionObjectInvoke101">
<AttributeData AttributeName="name"/>
@@ -496,53 +1058,155 @@
<AttributeData AttributeName="class method"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Object To CSV String..." kind="action" name="AddObjectToCSVString">
- <EntityData EntityName="ESBPreActionObjectToCSVString101">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bean properties"/>
- <AttributeData AttributeName="fail on missing property" Mandatory="no"/>
- </EntityData>
+ <XActionItem displayName="Converters" group="1" kind="list" name="Converters">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Byte Array To String..." kind="action" name="AddByteArrayToString">
+ <EntityData EntityName="ESBPreActionByteArrayToString101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="encoding" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Long To Date..." kind="action" name="AddLongToDate">
+ <EntityData EntityName="ESBPreActionLongToDateConverter101">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Object To CSV String..." kind="action" name="AddObjectToCSVString">
+ <EntityData EntityName="ESBPreActionObjectToCSVString101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="bean properties"/>
+ <AttributeData AttributeName="fail on missing property" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Object To XStream..." kind="action" name="AddObjectToXStream">
+ <EntityData EntityName="ESBPreActionObjectToXStream101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="class alias" Mandatory="no"/>
+ <AttributeData AttributeName="exclude package" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Smooks Transformer..." kind="action" name="AddSmooksTransformer">
+ <EntityData EntityName="ESBPreActionSmooksTransformer101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="resource config"/>
+ <AttributeData AttributeName="from" Mandatory="no"/>
+ <AttributeData AttributeName="from type" Mandatory="no"/>
+ <AttributeData AttributeName="to" Mandatory="no"/>
+ <AttributeData AttributeName="to type" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Message Persister..." kind="action" name="AddMessagePersister">
+ <EntityData EntityName="ESBPreActionMessagePersister101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="classification" Mandatory="no"/>
+ <AttributeData AttributeName="message store class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="XStream To Object..." kind="action" name="AddXStreamToObject">
+ <EntityData EntityName="ESBPreActionXStreamToObject101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="class alias" Mandatory="no"/>
+ <AttributeData AttributeName="exclude package" Mandatory="no"/>
+ <AttributeData AttributeName="incoming type"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Object To XStream..." kind="action" name="AddObjectToXStream">
- <EntityData EntityName="ESBPreActionObjectToXStream101">
+ displayName="Command Interpreter..." kind="action" name="AddCommandInterpreter">
+ <EntityData EntityName="ESBPreActionCommandInterpreter101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="class alias" Mandatory="no"/>
- <AttributeData AttributeName="exclude package" Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Smooks Transformer..." kind="action" name="AddSmooksTransformer">
- <EntityData EntityName="ESBPreActionSmooksTransformer101">
+ displayName="Groovy Action Processor..." kind="action" name="AddGroovyProcessor">
+ <EntityData EntityName="ESBPreActionGroovyProcessor101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="resource config"/>
- <AttributeData AttributeName="from" Mandatory="no"/>
- <AttributeData AttributeName="from type" Mandatory="no"/>
- <AttributeData AttributeName="to" Mandatory="no"/>
- <AttributeData AttributeName="to type" Mandatory="no"/>
+ <AttributeData AttributeName="script"/>
</EntityData>
</XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Message Persister..." kind="action" name="AddMessagePersister">
- <EntityData EntityName="ESBPreActionMessagePersister101">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="classification" Mandatory="no"/>
- <AttributeData AttributeName="message store class" Mandatory="no"/>
- </EntityData>
+ <XActionItem displayName="Routers" group="1" kind="list" name="Routers">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Aggregator..." kind="action" name="AddAggregator">
+ <EntityData EntityName="ESBPreActionAggregator101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="timeout in millies" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Content Based Router..." kind="action" name="AddContentBasedRouter">
+ <EntityData EntityName="ESBPreActionContentBasedRouter101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="process" Mandatory="no"/>
+ <AttributeData AttributeName="rule set"/>
+ <AttributeData AttributeName="rule language" Mandatory="no"/>
+ <AttributeData AttributeName="rule reload" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Static Router..." kind="action" name="AddStaticRouter">
+ <EntityData EntityName="ESBPreActionStaticRouter101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="process" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Static Wiretap..." kind="action" name="AddStaticWiretap">
+ <EntityData EntityName="ESBPreActionStaticWiretap101">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Notifier..." kind="action" name="AddNotifier">
+ <EntityData EntityName="ESBPreActionNotifier101">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
+ <XActionItem displayName="SOAP" group="1" kind="list" name="SOAP">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="SOAP Processor..." kind="action" name="SOAPProcessor">
+ <EntityData EntityName="ESBPreActionSOAPProcessor101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="jbossws endpoint"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="SOAP Client..." kind="action" name="SOAPClient">
+ <EntityData EntityName="ESBPreActionSOAPClient101">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="wsdl"/>
+ <AttributeData AttributeName="operation"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="XStream To Object..." kind="action" name="AddXStreamToObject">
- <EntityData EntityName="ESBPreActionXStreamToObject101">
+ displayName="System Println..." kind="action" name="AddSystemPrintln">
+ <EntityData EntityName="ESBPreActionSystemPrintln101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="class alias" Mandatory="no"/>
- <AttributeData AttributeName="exclude package" Mandatory="no"/>
- <AttributeData AttributeName="incoming type"/>
+ <AttributeData AttributeName="message"/>
</EntityData>
</XActionItem>
</XActionItem>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2008-06-10 13:54:56 UTC (rev 8679)
@@ -49,7 +49,7 @@
</ICONS>
<GlobalActions kind="list"/>
<XModelEntity ImplementingClass="%ESB%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="action" name="ESBAction101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBRouteToImpl.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBRouteToImpl.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBRouteToImpl.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ESBRouteToImpl extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public ESBRouteToImpl() {}
+
+ public String getPresentationString() {
+ String dn = getAttributeValue("destination name");
+ if(dn != null && dn.length() > 0) return dn;
+ return super.getPresentationString();
+ }
+
+}
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.model;
import java.util.HashMap;
@@ -12,17 +22,21 @@
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.esb.core.ESBCorePlugin;
import org.jboss.tools.esb.core.model.converters.AliasConverter;
+import org.jboss.tools.esb.core.model.converters.NotificationConverter;
+import org.jboss.tools.esb.core.model.converters.RouteToConverter;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class SpecificActionLoader implements ESBConstants {
- public static SpecificActionLoader instance = new SpecificActionLoader();
- static String ACTION_ENTITY = "ESBAction";
- static String ACTIONS_FOLDER_ENTITY = "ESBActions";
+ static final String ACTION_ENTITY = "ESBAction";
+ static final String ACTIONS_FOLDER_ENTITY = "ESBActions";
/**
* Version suffix should be added to entity name
*/
- String[][] SPECIFIC_ACTIONS = {
+ static final String[][] SPECIFIC_ACTIONS = {
{"org.jboss.soa.esb.actions.converters.ByteArrayToString", "ESBPreActionByteArrayToString"},
//encoding
{"org.jboss.soa.esb.actions.converters.LongToDateConverter", "ESBPreActionLongToDateConverter"},
@@ -41,7 +55,7 @@
//class-alias, exclude-package, incoming-type, root-node, aliases
{"org.jboss.soa.esb.actions.jbpm.CommandInterpreter", "ESBPreActionCommandInterpreter"},
//
- {"org.jboss.soa.esb.actions.scripting.GroovyActionProcessor", "ESBPreActionGroovyActionProcessor"},
+ {"org.jboss.soa.esb.actions.scripting.GroovyActionProcessor", "ESBPreActionGroovyProcessor"},
//script
{"org.jboss.soa.esb.actions.Aggregator", "ESBPreActionAggregator"},
//timeoutInMillies
@@ -61,6 +75,8 @@
//message, printfull, outputstream
};
+ public static final SpecificActionLoader instance = new SpecificActionLoader();
+
Map<String,String> classToEntity = new HashMap<String, String>();
Map<String,String> entityToClass = new HashMap<String, String>();
@@ -145,8 +161,11 @@
String converter = childEntity.getProperty("converter");
if("alias".equals(converter)) {
new AliasConverter().toSpecific(basic, action);
+ } else if("route".equals(converter)) {
+ new RouteToConverter().toSpecific(basic, action);
+ } else if("notification".equals(converter)) {
+ new NotificationConverter().toSpecific(basic, action);
}
- //TODO
}
XModelObject[] cs = basic.getChildren(ESBConstants.ENT_ESB_PROPERTY);
@@ -177,8 +196,8 @@
if(pre == null || pre.length() == 0) continue;
if("true".equals(pre)) {
String value = action.getAttributeValue(as[i].getName());
- if(value == null || (value.length() == 0 && !"always".equals(as[i].getProperty("save")))) {
- continue;
+ if(value == null || value.length() == 0 || value.equals(as[i].getDefaultValue())) {
+ if(!"always".equals(as[i].getProperty("save"))) continue;
}
XModelObject p = action.getModel().createModelObject(ESBConstants.ENT_ESB_PROPERTY, null);
p.setAttributeValue("name", as[i].getXMLName());
@@ -199,8 +218,11 @@
String converter = childEntity.getProperty("converter");
if("alias".equals(converter)) {
new AliasConverter().toBasic(result, action);
+ } else if("route".equals(converter)) {
+ new RouteToConverter().toBasic(result, action);
+ } else if("notification".equals(converter)) {
+ new NotificationConverter().toBasic(result, action);
}
- //TODO
}
XModelObject[] cs = action.getChildren(ESBConstants.ENT_ESB_PROPERTY);
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/AliasConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/AliasConverter.java 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/AliasConverter.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -1,62 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.model.converters;
-import java.util.HashMap;
-import java.util.Map;
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class AliasConverter extends ListConverter {
+ static final String ALIAS_ENTITY = "ESBPreAlias";
+ static final String ALIASES = "aliases";
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.impl.AnyElementObjectImpl;
-import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
-import org.jboss.tools.esb.core.model.ESBConstants;
-
-public class AliasConverter implements IPropertyConverter {
- static String ALIAS_ENTITY = "ESBPreAlias";
-
- public void toSpecific(XModelObject basicAction, XModelObject specificAction) {
- XModelObject p = basicAction.getChildByPath("aliases");
- if(p == null) return;
- XModelObject[] as = p.getChildren();
- for (int i = 0; i < as.length; i++) {
- if(as[i] instanceof AnyElementObjectImpl) {
- Map<String, String> attr = toMap(((AnyElementObjectImpl)as[i]).getAttributes());
- String n = attr.get(ESBConstants.ATTR_NAME);
- String v = attr.get(ESBConstants.ATTR_VALUE);
- if(n == null || v == null) {
- continue;
- }
- XModelObject a = specificAction.getModel().createModelObject(ALIAS_ENTITY, null);
- a.setAttributeValue(ESBConstants.ATTR_NAME, n);
- a.setAttributeValue(ESBConstants.ATTR_VALUE, v);
- specificAction.addChild(a);
- }
- }
- p.removeFromParent();
+ protected String getPropertyName() {
+ return ALIASES;
}
- public void toBasic(XModelObject basicAction, XModelObject specificAction) {
- XModelObject[] as = specificAction.getChildren(ALIAS_ENTITY);
- if(as.length == 0) return;
- XModelObject p = basicAction.getModel().createModelObject(ESBConstants.ENT_ESB_PROPERTY, null);
- p.setAttributeValue(ESBConstants.ATTR_NAME, "aliases");
- basicAction.addChild(p);
- for (int i = 0; i < as.length; i++) {
- XModelObject t = basicAction.getModel().createModelObject("AnyElement", null);
- t.setAttributeValue("tag", "alias");
- String attrs = ESBConstants.ATTR_NAME + "="
- + as[i].getAttributeValue(ESBConstants.ATTR_NAME)
- + ";" + ESBConstants.ATTR_VALUE + "="
- + as[i].getAttributeValue(ESBConstants.ATTR_VALUE);
- t.setAttributeValue("attributes", attrs);
- t.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + (i + 1));
- p.addChild(t);
- }
+ protected String getItemEntityName() {
+ return ALIAS_ENTITY;
}
- static Map<String, String> toMap(String[][] attributes) {
- Map<String,String> map = new HashMap<String, String>();
- for (int i = 0; i < attributes.length; i++) {
- map.put(attributes[i][0], attributes[i][1]);
- }
- return map;
- }
-
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/IPropertyConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/IPropertyConverter.java 2008-06-10 13:26:05 UTC (rev 8678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/IPropertyConverter.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.model.converters;
import org.jboss.tools.common.model.XModelObject;
@@ -2,2 +12,5 @@
+/**
+ * @author Viacheslav Kabanovich
+ */
public interface IPropertyConverter {
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.converters;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.impl.AnyElementObjectImpl;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public abstract class ListConverter implements IPropertyConverter {
+
+ public ListConverter() {}
+
+ protected abstract String getPropertyName();
+
+ protected abstract String getItemEntityName();
+
+ public void toSpecific(XModelObject basicAction, XModelObject specificAction) {
+ XModelObject p = basicAction.getChildByPath(getPropertyName());
+ if(p == null) return;
+ XModelObject[] as = p.getChildren();
+ for (int i = 0; i < as.length; i++) {
+ if(as[i] instanceof AnyElementObjectImpl) {
+ String tag = as[i].getAttributeValue("tag");
+ Map<String, String> attr = toMap(((AnyElementObjectImpl)as[i]).getAttributes());
+
+ XModelObject a = specificAction.getModel().createModelObject(getItemEntityName(), null);
+ if(a == null || tag == null || !tag.equals(a.getModelEntity().getXMLSubPath())) {
+ continue;
+ }
+
+ XModelEntity entity = a.getModelEntity();
+ XAttribute[] attrs = entity.getAttributes();
+ for (int j = 0; j < attrs.length; j++) {
+ String name = attrs[j].getName();
+ String xml = attrs[j].getXMLName();
+ if(xml == null || xml.length() == 0) continue;
+ String value = attr.get(xml);
+ if(value == null || value.length() == 0) {
+ value = attrs[j].getDefaultValue();
+ }
+ if(value != null) {
+ a.setAttributeValue(name, value);
+ }
+ }
+ if(a.getModelEntity().getChild("AnyElement") != null) {
+ XModelObject[] cs = as[i].getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ a.addChild(cs[j].copy());
+ }
+ }
+ specificAction.addChild(a);
+ }
+ }
+ p.removeFromParent();
+ }
+
+ public void toBasic(XModelObject basicAction, XModelObject specificAction) {
+ XModelObject[] as = specificAction.getChildren(getItemEntityName());
+ if(as.length == 0) return;
+ XModelObject p = basicAction.getModel().createModelObject(ESBConstants.ENT_ESB_PROPERTY, null);
+ p.setAttributeValue(ESBConstants.ATTR_NAME, getPropertyName());
+ for (int i = 0; i < as.length; i++) {
+ XModelObject t = basicAction.getModel().createModelObject("AnyElement", null);
+ t.setAttributeValue("tag", as[i].getModelEntity().getXMLSubPath());
+ StringBuffer sb = new StringBuffer();
+ XModelEntity entity = as[i].getModelEntity();
+ XAttribute[] attrs = entity.getAttributes();
+ for (int j = 0; j < attrs.length; j++) {
+ String name = attrs[j].getName();
+ String xml = attrs[j].getXMLName();
+ if(xml == null || xml.length() == 0) continue;
+ String value = as[i].getAttributeValue(name);
+ if(value == null || value.length() == 0 || value.equals(attrs[j].getDefaultValue())) {
+ if(!"always".equals(attrs[j].getProperty("save"))) continue;
+ }
+ if(sb.length() > 0) {
+ sb.append(';');
+ }
+ sb.append(xml).append('=').append(value);
+ }
+ String attributes = sb.toString();
+ t.setAttributeValue("attributes", attributes);
+ t.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + (i + 1));
+ if(as[i].getModelEntity().getChild("AnyElement") != null) {
+ XModelObject[] cs = as[i].getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ t.addChild(cs[j].copy());
+ }
+ }
+ p.addChild(t);
+ }
+ basicAction.addChild(p);
+ }
+
+ static Map<String, String> toMap(String[][] attributes) {
+ Map<String,String> map = new HashMap<String, String>();
+ for (int i = 0; i < attributes.length; i++) {
+ map.put(attributes[i][0], attributes[i][1]);
+ }
+ return map;
+ }
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/NotificationConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/NotificationConverter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/NotificationConverter.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.converters;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class NotificationConverter extends ListConverter {
+ static final String NOTIFICATION_ENTITY = "ESBPreNotificationList";
+ static final String DESTINATIONS = "destinations";
+
+ protected String getPropertyName() {
+ return DESTINATIONS;
+ }
+
+ protected String getItemEntityName() {
+ return NOTIFICATION_ENTITY;
+ }
+
+}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/RouteToConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/RouteToConverter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/RouteToConverter.java 2008-06-10 13:54:56 UTC (rev 8679)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.converters;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class RouteToConverter extends ListConverter {
+ static final String ROUTE_TO_ENTITY = "ESBPreRouteTo";
+ static final String DESTINATIONS = "destinations";
+
+ protected String getPropertyName() {
+ return DESTINATIONS;
+ }
+
+ protected String getItemEntityName() {
+ return ROUTE_TO_ENTITY;
+ }
+
+}
17 years, 10 months
JBoss Tools SVN: r8678 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model: helpers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-10 09:26:05 -0400 (Tue, 10 Jun 2008)
New Revision: 8678
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddExceptionHandler.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/RenameViewSupport.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramStructureHelper.java
Log:
JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddExceptionHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddExceptionHandler.java 2008-06-10 13:18:48 UTC (rev 8677)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/AddExceptionHandler.java 2008-06-10 13:26:05 UTC (rev 8678)
@@ -18,7 +18,7 @@
XModelObject created = (XModelObject)prop.get("created");
if(created == null) return;
String path = created.getPathPart();
- XModelObject item = SeamPagesDiagramStructureHelper.getInstance().getProcess(object).getChildByPath(path);
+ XModelObject item = SeamPagesDiagramStructureHelper.getInstance().getDiagram(object).getChildByPath(path);
String shape = getShape(prop);
if(item != null && shape != null) {
item.setAttributeValue("shape", shape);
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/RenameViewSupport.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/RenameViewSupport.java 2008-06-10 13:18:48 UTC (rev 8677)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/RenameViewSupport.java 2008-06-10 13:26:05 UTC (rev 8678)
@@ -76,7 +76,7 @@
Properties p = extractStepData(0);
String path = AddViewSupport.revalidatePath(p.getProperty(ATTR_VIEW_ID));
if(initialPath.equals(path)) return;
- SeamPagesDiagramHelper h = SeamPagesDiagramHelper.getHelper(SeamPagesDiagramStructureHelper.instance.getProcess(item));
+ SeamPagesDiagramHelper h = SeamPagesDiagramHelper.getHelper(SeamPagesDiagramStructureHelper.instance.getDiagram(item));
h.addUpdateLock(this);
try {
replace(item, initialPath, path);
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2008-06-10 13:18:48 UTC (rev 8677)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2008-06-10 13:26:05 UTC (rev 8678)
@@ -62,7 +62,7 @@
//or should we return object itself, if params are displayed by diagram?
return getItemOnDiagram(object.getParent());
}
- XModelObject diagram = SeamPagesDiagramStructureHelper.instance.getProcess(object);
+ XModelObject diagram = SeamPagesDiagramStructureHelper.instance.getDiagram(object);
return (diagram == null) ? null : getItemOnDiagram(diagram, object);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramStructureHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramStructureHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramStructureHelper.java 2008-06-10 13:26:05 UTC (rev 8678)
@@ -15,6 +15,10 @@
return instance;
}
+ public XModelObject getDiagram(XModelObject object) {
+ return getProcess(object);
+ }
+
public XModelObject getParentProcess(XModelObject element) {
XModelObject p = element;
while(p != null && p.getFileType() == XModelObject.NONE &&
17 years, 10 months
JBoss Tools SVN: r8677 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse: console and 23 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-06-10 09:18:48 -0400 (Tue, 10 Jun 2008)
New Revision: 8677
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
Removed:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/Messages.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/messages.properties
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/builder/HibernateBuilder.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConsolePreferencesConstants.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ExtensionManager.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePerspectiveFactory.java
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/HibernateConsoleSaveParticipant.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearHQLEditorAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseQueryPageAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigurationBasedAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java
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/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java
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/RefreshAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IReverseEngineeringDefinition.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.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
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ReverseEngineeringDefinitionImpl.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/preferences/HibernateConsolePreferencePage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/AutoResizeTableLayout.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/xpl/DialogSelectionHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
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/QueryPageTabView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
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/QueryParametersView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/ClearPlaceHolderJob.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/PendingNode.java
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/EntityPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFileWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewReverseEngineeringFileWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterCellModifier.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterLabelProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
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
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingLabelProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BeanPropertyDescriptor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ValueWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInput.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInputFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorStorage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaditorInputFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/actions/ToggleLayoutAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/NodeHeaderFigure.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/PersistentClassFigure.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/TableFigure.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/AssociationViewAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/GraphNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/InheritanceViewAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/CompletionHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCodeScanner.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorActionContributor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInput.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInputFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorStorage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLPartitionScanner.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLTextHover.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLPreferenceConstants.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTabGroup.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterFactoryPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/GeneralExceptionStatusHandler.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ICodeGenerationLaunchConstants.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/IConsoleConfigurationLaunchConstants.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/LaunchMenuDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/OpenHibernateToolsConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java
Log:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-500
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/builder/HibernateBuilder.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/builder/HibernateBuilder.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/builder/HibernateBuilder.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -37,7 +37,7 @@
*/
public class HibernateBuilder extends IncrementalProjectBuilder {
- public static final String BUILDER_ID = HibernateConsolePlugin.ID + ".hibernateBuilder";
+ public static final String BUILDER_ID = HibernateConsolePlugin.ID + ".hibernateBuilder"; //$NON-NLS-1$
protected IProject[] build(int kind, Map args, final IProgressMonitor monitor)
throws CoreException {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -8,6 +8,7 @@
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -36,23 +37,23 @@
private ToolBarManager tbm;
private ExecuteQueryAction execAction = null;
final private QueryInputModel queryInputModel;
-
+
private String defPartName;
private Image defTitleImage;
private Image connectedTitleImage;
-
+
// to enable execution of queries from files - hack for HBX-744
private String consoleConfigurationName;
-
+
public AbstractQueryEditor() {
queryInputModel = new QueryInputModel();
}
-
+
final public boolean askUserForConfiguration(String name) {
+ String out = NLS.bind(HibernateConsoleMessages.AbstractQueryEditor_do_you_want_open_session_factory, name);
return MessageDialog.openQuestion( HibernateConsolePlugin.getDefault()
.getWorkbench().getActiveWorkbenchWindow().getShell(),
- "Open Session factory",
- "Do you want to open the session factory for " + name + " ?" );
+ HibernateConsoleMessages.AbstractQueryEditor_open_session_factory, out );
}
final public ConsoleConfiguration getConsoleConfiguration() {
@@ -66,7 +67,7 @@
QueryEditorInput hei = (QueryEditorInput) getEditorInput();
return hei.getConsoleConfigurationName();
} else {
- return consoleConfigurationName;
+ return consoleConfigurationName;
}
}
@@ -78,13 +79,13 @@
hei.resetName();
}
this.consoleConfigurationName = name;
-
+
showEditorInput( getEditorInput() );
}
-
+
protected void updateExecButton(){
/*if (getSourceViewer() != null ){
- execAction.setEnabled(getConsoleConfigurationName().trim().length() != 0
+ execAction.setEnabled(getConsoleConfigurationName().trim().length() != 0
&& getSourceViewer().getDocument().get().trim().length() > 0);
} else {
execAction.setEnabled(false);
@@ -101,7 +102,7 @@
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(
- "Could not show query editor input", e );
+ HibernateConsoleMessages.AbstractQueryEditor_could_not_show_query_editor_input, e );
}
}
@@ -113,9 +114,9 @@
}
performSave( false, progressMonitor );
}
-
+
protected void doSetInput(IEditorInput input) throws CoreException {
- super.doSetInput(input);
+ super.doSetInput(input);
}
final public String getQueryString() {
@@ -127,7 +128,7 @@
/**
* Dispose of resources held by this editor.
- *
+ *
* @see IWorkbenchPart#dispose()
*/
final public void dispose() {
@@ -147,25 +148,25 @@
public void textChanged(TextEvent event) {
System.out.println(event.getText());
-
+
}});*/
ActionContributionItem item = new ActionContributionItem(
execAction );
tbm.add( item );
- ControlContribution cc = new ConfigurationCombo( "hql-target", this );
+ ControlContribution cc = new ConfigurationCombo( "hql-target", this ); //$NON-NLS-1$
tbm.add( cc );
tbm.add( new Separator() );
-
- cc = new ComboContribution("maxResults") {
+ cc = new ComboContribution("maxResults") { //$NON-NLS-1$
+
SelectionAdapter selectionAdapter = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
Integer maxResults = null;
-
+
try {
maxResults = new Integer(getText());
}
@@ -176,25 +177,25 @@
}
};
-
+
protected Control createControl(Composite parent) {
Control control = super.createControl( parent );
-
+
comboControl.addModifyListener( new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
Integer maxResults = null;
-
+
try {
maxResults = new Integer(getText());
}
catch (NumberFormatException e1) {
maxResults = null;
}
- queryInputModel.setMaxResults( maxResults );
- }
+ queryInputModel.setMaxResults( maxResults );
+ }
} );
return control;
}
@@ -202,37 +203,37 @@
return 75;
}
protected String getLabelText() {
- return "Max results:";
+ return HibernateConsoleMessages.AbstractQueryEditor_max_results;
}
-
+
protected boolean isReadOnly() {
return false;
}
-
+
protected SelectionListener getSelectionAdapter() {
- return selectionAdapter;
+ return selectionAdapter;
}
void populateComboBox() {
comboControl.getDisplay().syncExec( new Runnable() {
-
+
public void run() {
- String[] items = new String[] { "", "10", "20", "30", "50"};
+ String[] items = new String[] { "", "10", "20", "30", "50"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
comboControl.setItems( items );
}
-
+
} );
-
-
+
+
}
-
+
};
tbm.add(cc);
-
+
tbm.update( true );
}
-
+
protected void initializeKeyBindingScopes() {
setKeyBindingScopes(new String[] { "org.hibernate.eclipse.console.hql" }); //$NON-NLS-1$
}
@@ -240,17 +241,17 @@
public QueryInputModel getQueryInputModel() {
return queryInputModel;
}
-
+
public void showConnected(IEditorPart editor){
defPartName = getPartName();
defTitleImage = getTitleImage();
- setPartName(defPartName + "->" + editor.getTitle());
+ setPartName(defPartName + "->" + editor.getTitle()); //$NON-NLS-1$
if (connectedTitleImage == null){
connectedTitleImage = HibernateConsolePlugin.getImageDescriptor(getConnectedImageFilePath()).createImage();
}
setTitleImage(connectedTitleImage);
}
-
+
public void showDisconnected(){
setPartName(defPartName);
if (defTitleImage != null && !defTitleImage.isDisposed()){
@@ -260,6 +261,6 @@
}
connectedTitleImage.dispose();
}
-
+
protected abstract String getConnectedImageFilePath();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -21,7 +21,7 @@
String getText() {
if(comboControl.isDisposed()) {
- return "";
+ return ""; //$NON-NLS-1$
} else {
return comboControl.getText();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -71,7 +71,7 @@
names[i] = configurations[i].getName();
}
- final String name = editor.getConsoleConfigurationName()==null?"":editor.getConsoleConfigurationName();
+ final String name = editor.getConsoleConfigurationName()==null?"":editor.getConsoleConfigurationName(); //$NON-NLS-1$
comboControl.getDisplay().syncExec( new Runnable() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConsolePreferencesConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConsolePreferencesConstants.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConsolePreferencesConstants.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,8 +24,8 @@
public interface ConsolePreferencesConstants {
- String PREFIX = HibernateConsolePlugin.ID + ".";
+ String PREFIX = HibernateConsolePlugin.ID + "."; //$NON-NLS-1$
- String ENTITY_MODEL_LAYOUT = PREFIX + "view.entitygraph.manuallayout";
+ String ENTITY_MODEL_LAYOUT = PREFIX + "view.entitygraph.manuallayout"; //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseConsoleConfigurationPreferences.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Collections;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -39,6 +38,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.preferences.AbstractConsoleConfigurationPreferences;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
@@ -52,7 +52,7 @@
/**
* @author max
- *
+ *
*/
public class EclipseConsoleConfigurationPreferences extends AbstractConsoleConfigurationPreferences {
@@ -60,15 +60,15 @@
private IPath propertyFilename;
private IPath[] mappings = new IPath[0];
private IPath[] customClasspath = new IPath[0];
-
+
public EclipseConsoleConfigurationPreferences(String configName, ConfigurationMode cmode, String projectName, boolean useProjectClasspath, String entityResolver, IPath cfgFile, IPath propertyFilename, IPath[] mappings, IPath[] classpaths, String persistenceUnitName, String namingStrategy) {
- super(configName, cmode, projectName, useProjectClasspath, entityResolver, persistenceUnitName, namingStrategy);
+ super(configName, cmode, projectName, useProjectClasspath, entityResolver, persistenceUnitName, namingStrategy);
this.cfgFile = cfgFile;
this.propertyFilename = propertyFilename;
this.mappings = mappings;
- this.customClasspath = classpaths;
-
+ this.customClasspath = classpaths;
+
}
/**
@@ -77,33 +77,33 @@
public IPath getCfgFile() {
return cfgFile;
}
-
+
/**
* @return Returns the propertyFilename.
*/
public IPath getPropertyFilename() {
return propertyFilename;
}
-
+
/**
* @return Returns the mappings.
*/
public IPath[] getMappings() {
return mappings;
}
-
+
/**
* @return Returns the customClasspath.
*/
public IPath[] getCustomClasspath() {
return customClasspath;
}
-
+
protected EclipseConsoleConfigurationPreferences() {
-
+
}
-
+
public URL[] getCustomClassPathURLS() {
try {
IJavaProject project = ProjectUtils.findJavaProject( getProjectName() );
@@ -113,31 +113,31 @@
additonal = JavaRuntime.computeDefaultRuntimeClassPath(project);
}
catch (CoreException e) {
- throw new HibernateConsoleRuntimeException("Could not compute default classpath from project " + project );
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_could_not_compute_def_classpath + project );
}
-
+
}
URL[] rawLocationsURLForResources = ClassLoaderHelper.getRawLocationsURLForResources(customClasspath);
URL[] result = new URL[rawLocationsURLForResources.length+additonal.length];
for (int i = 0; i < rawLocationsURLForResources.length; i++) {
- result[i] = rawLocationsURLForResources[i];
+ result[i] = rawLocationsURLForResources[i];
}
for (int i = 0; i < additonal.length; i++) {
String url = additonal[i];
- result[i+rawLocationsURLForResources.length] = new File(url).toURL();
+ result[i+rawLocationsURLForResources.length] = new File(url).toURL();
}
return result;
} catch (MalformedURLException mue) {
- throw new HibernateConsoleRuntimeException("Could not resolve classpaths", mue);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_could_not_resolve_classpaths, mue);
}
}
public File[] getMappingFiles() {
- File[] files = new File[mappings.length];
+ File[] files = new File[mappings.length];
for (int i = 0; i < mappings.length; i++) {
IPath path = mappings[i];
files[i] = pathToFile(path);
-
+
}
return files;
}
@@ -145,7 +145,7 @@
private File pathToFile(IPath path) {
if(path==null) return null;
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
-
+
return pathToFile(path.toString(), resource);
}
@@ -156,8 +156,8 @@
return rawLocation.toFile();
}
}
-
- throw new HibernateConsoleRuntimeException("Could not resolve " + path + " to a file");
+ String out = NLS.bind(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_could_not_resolve_to_file, path);
+ throw new HibernateConsoleRuntimeException(out);
}
public File getConfigXMLFile() {
@@ -165,7 +165,7 @@
}
public File getPropertyFile() {
- return pathToFile(propertyFilename);
+ return pathToFile(propertyFilename);
}
public void writeStateTo(Element node) {
@@ -176,8 +176,8 @@
this.cfgFile = cfgFile==null?null:new Path(cfgFile);
}
-
-
+
+
protected void setPropertyFile(String cfgFile) {
this.propertyFilename = cfgFile==null?null:new Path(cfgFile);
}
@@ -185,7 +185,7 @@
this.mappings = new IPath[mappings.length];
for (int i = 0; i < mappings.length; i++) {
String str = mappings[i];
- this.mappings[i] = new Path(mappings[i]);
+ this.mappings[i] = new Path(mappings[i]);
}
}
@@ -193,35 +193,35 @@
this.customClasspath = new IPath[mappings.length];
for (int i = 0; i < mappings.length; i++) {
//String str = mappings[i];
- this.customClasspath[i] = new Path(mappings[i]);
+ this.customClasspath[i] = new Path(mappings[i]);
}
}
-
+
public static EclipseConsoleConfigurationPreferences[] readStateFrom(File f) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder parser;
try {
parser = factory.newDocumentBuilder();
-
+
Document doc = parser.parse(f);
-
+
Element root = doc.getDocumentElement();
-
+
NodeList elementsByTagName = root.getElementsByTagName(CONFIGURATION_TAG); //TODO: only get nearest children.
EclipseConsoleConfigurationPreferences[] result = new EclipseConsoleConfigurationPreferences[elementsByTagName.getLength()];
-
+
for(int i = 0; i < elementsByTagName.getLength(); i++) {
result[i] = new EclipseConsoleConfigurationPreferences();
result[i].readStateFrom( (Element)elementsByTagName.item(i) );
}
return result;
} catch(SAXException sa) {
- throw new HibernateConsoleRuntimeException("Errors while parsing " + f,sa);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_errors_while_parsing + f,sa);
} catch (ParserConfigurationException e) {
- throw new HibernateConsoleRuntimeException("Errors while parsing " + f,e);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_errors_while_parsing + f,e);
} catch (IOException e) {
- throw new HibernateConsoleRuntimeException("Errors while parsing " + f,e);
- }
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseConsoleConfigurationPreferences_errors_while_parsing + f,e);
+ }
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
@@ -27,27 +28,27 @@
import org.w3c.dom.Element;
public class EclipseLaunchConsoleConfigurationPreferences implements ConsoleConfigurationPreferences {
-
+
private final ILaunchConfiguration launchConfiguration;
public EclipseLaunchConsoleConfigurationPreferences(ILaunchConfiguration configuration) {
this.launchConfiguration = configuration;
}
-
+
private File strToFile(String epath) {
if(epath==null) return null;
IPath path = new Path(epath);
return pathToFile( path );
}
-
+
private File pathToFile(IPath path) {
if(path==null) return null;
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
-
+
return pathToFile(path.toString(), resource);
}
-
+
private File pathToFile(String path, IResource resource) {
if(resource != null) {
IPath rawLocation = resource.getRawLocation();
@@ -55,8 +56,8 @@
return rawLocation.toFile();
}
}
-
- throw new HibernateConsoleRuntimeException("Could not resolve " + path + " to a file");
+ String out = NLS.bind(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_could_not_resolve_to_file, path);
+ throw new HibernateConsoleRuntimeException(out);
}
@@ -69,14 +70,14 @@
throw new HibernateConsoleRuntimeException(e);
}
}
-
+
public File getConfigXMLFile() {
String file = getAttribute( IConsoleConfigurationLaunchConstants.CFG_XML_FILE, null );
- return strToFile( file );
+ return strToFile( file );
}
public ConfigurationMode getConfigurationMode() {
- return ConfigurationMode.parse( getAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, "" ) );
+ return ConfigurationMode.parse( getAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, "" ) ); //$NON-NLS-1$
}
public URL[] getCustomClassPathURLS() {
@@ -87,17 +88,17 @@
String str = classpath[i];
cp[i] = new File(str).toURL();
}
- return cp;
+ return cp;
}
catch (CoreException e) {
- throw new HibernateConsoleRuntimeException("Could not compute classpath", e);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_could_not_compute_classpath, e);
}
catch (MalformedURLException e) {
- throw new HibernateConsoleRuntimeException("Could not compute classpath", e);
- }
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_could_not_compute_classpath, e);
+ }
}
-
+
public String getEntityResolverName() {
return getAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, null );
}
@@ -110,13 +111,13 @@
Iterator iter = mappings.iterator();
while ( iter.hasNext() ) {
String element = (String) iter.next();
- result[i++] = strToFile( element );
+ result[i++] = strToFile( element );
}
return result;
}
catch (CoreException e) {
throw new HibernateConsoleRuntimeException(e);
- }
+ }
}
public String getName() {
@@ -137,10 +138,10 @@
try {
Properties p = new Properties();
p.load(new FileInputStream(propFile) );
- return p;
- }
+ return p;
+ }
catch(IOException io) {
- throw new HibernateConsoleRuntimeException("Could not load property file " + propFile, io);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_could_not_load_property_file + propFile, io);
}
}
@@ -149,20 +150,20 @@
}
public void readStateFrom(Element element) {
- throw new IllegalStateException("Cannot read from xml");
+ throw new IllegalStateException(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_cannot_read_from_xml);
}
public void setName(String name) {
- throw new IllegalStateException(getName() + " cannot be renamed");
+ throw new IllegalStateException(getName() + HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed);
}
public void writeStateTo(Element node) {
- throw new IllegalStateException("Cannot write to xml");
+ throw new IllegalStateException(HibernateConsoleMessages.EclipseLaunchConsoleConfigurationPreferences_cannot_write_to_xml);
}
-
-
-
-
+
+
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ExtensionManager.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ExtensionManager.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ExtensionManager.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -53,7 +53,7 @@
public class ExtensionManager
{
- public static final String EXPORTERS_EXTENSION_ID = "org.hibernate.eclipse.console.exporters";
+ public static final String EXPORTERS_EXTENSION_ID = "org.hibernate.eclipse.console.exporters"; //$NON-NLS-1$
private static IExtension[] findExtensions (String extensionId)
{
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -0,0 +1,510 @@
+package org.hibernate.eclipse.console;
+
+import org.eclipse.osgi.util.NLS;
+
+public class HibernateConsoleMessages extends NLS {
+ public static final String BUNDLE_NAME = "org.hibernate.eclipse.console.HibernateConsoleMessages"; //$NON-NLS-1$
+
+ //
+ public static String popup_copy_text;
+ public static String popup_paste_text;
+ public static String popup_select_all;
+ public static String find_replace_action_label;
+ public static String find_replace_action_tooltip;
+ public static String find_replace_action_image;
+ public static String find_replace_action_description;
+ //
+ public static String AbstractQueryEditor_could_not_show_query_editor_input;
+ public static String AbstractQueryEditor_do_you_want_open_session_factory;
+ public static String AbstractQueryEditor_max_results;
+ public static String AbstractQueryEditor_open_session_factory;
+ public static String EclipseConsoleConfigurationPreferences_could_not_compute_def_classpath;
+ public static String EclipseConsoleConfigurationPreferences_could_not_resolve_to_file;
+ public static String EclipseConsoleConfigurationPreferences_could_not_resolve_classpaths;
+ public static String EclipseConsoleConfigurationPreferences_errors_while_parsing;
+ public static String EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed;
+ public static String EclipseLaunchConsoleConfigurationPreferences_cannot_read_from_xml;
+ public static String EclipseLaunchConsoleConfigurationPreferences_cannot_write_to_xml;
+ public static String EclipseLaunchConsoleConfigurationPreferences_could_not_compute_classpath;
+ public static String EclipseLaunchConsoleConfigurationPreferences_could_not_load_property_file;
+ public static String EclipseLaunchConsoleConfigurationPreferences_could_not_resolve_to_file;
+ public static String HibernateConsolePlugin_could_not_delete_launch_config_for;
+ public static String HibernateConsolePlugin_could_not_open_criteria_editor_for_console;
+ public static String HibernateConsolePlugin_could_not_open_hql_editor_for_console;
+ public static String HibernateConsolePlugin_error_while_reading_console_config;
+ public static String HibernateConsolePlugin_hibernate_console;
+ public static String HibernateConsolePlugin_no_message_1;
+ public static String HibernateConsolePlugin_no_message_2;
+ public static String HibernateConsolePlugin_problem_to_get_flag;
+ //
+ public static String AddConfigurationAction_add_config;
+ public static String AddConfigurationAction_hibernate;
+ public static String AddConfigurationAction_problem_add_console_config;
+ public static String BuildSessionFactoryAction_build_session_factory;
+ public static String BuildSessionFactoryAction_close_sessionfactory;
+ public static String BuildSessionFactoryAction_create_sessionfactory;
+ public static String BuildSessionFactoryAction_exception_while_start_hibernate;
+ public static String BuildSessionFactoryAction_start_hibernate_resulted;
+ public static String ClearAction_clear_editor;
+ public static String CloseQueryPageAction_close_query_page;
+ public static String ConsoleConfigurationBasedAction_problem_while_executing;
+ public static String CriteriaEditorAction_hibernate_criteria_editor;
+ public static String CriteriaEditorAction_open_hibernate_criteria_editor;
+ public static String DeleteConfigurationAction_delete_config;
+ public static String DeleteConfigurationAction_delete_console_config;
+ public static String DeleteConfigurationAction_do_you_wish_del_selected_config;
+ public static String DeleteConfigurationAction_str_1;
+ public static String DeleteConfigurationAction_str_2;
+ public static String DeleteConfigurationAction_str_3;
+ public static String EditConsoleConfiguration_could_not_find_launch_cfg;
+ public static String EditConsoleConfiguration_edit_config;
+ public static String EditConsoleConfiguration_exception_while_edit_config;
+ public static String EditConsoleConfiguration_no_launch_cfg_matched;
+ public static String EditConsoleConfiguration_problem_adding_console_cfg;
+ public static String ExecuteQueryAction_run_hql;
+ public static String HQLScratchpadAction_hql_editor;
+ public static String HQLScratchpadAction_open_hql_editor;
+ public static String JTidyFormatAction_do_you_want_format_xml_files_with_jtidy;
+ public static String JTidyFormatAction_error_while_running_jtidy;
+ public static String JTidyFormatAction_format_with_jtidy;
+ public static String OpenFileActionUtils_problems_while_get_project_package_fragment_roots;
+ public static String OpenMappingAction_cannot_find_mapping_file;
+ public static String OpenMappingAction_cannot_open_mapping_file;
+ public static String OpenMappingAction_mapping_file_for_property_not_found;
+ public static String OpenMappingAction_mapping_for_not_found;
+ public static String OpenMappingAction_open_mapping_file;
+ public static String OpenMappingAction_selection_not_found;
+ public static String OpenQueryEditorAction_exception_open_hql_editor;
+ public static String OpenSourceAction_cannot_find_source_file;
+ public static String OpenSourceAction_cannot_open_source_file;
+ public static String OpenSourceAction_open_source_file;
+ public static String OpenSourceAction_source_file_for_class_not_found;
+ public static String RefreshAction_refresh;
+ //
+ public static String ExporterDefinition_problem_creating_exporter_class;
+ public static String ExporterFactory_output_dir_in_does_not_exist;
+ public static String ExporterFactory_template_dir_in_does_not_exist;
+ public static String ExporterProperty_generate_ejb3_annotations;
+ public static String ExporterProperty_use_java5_syntax;
+ //
+ public static String HibernateConsolePreferencePage_choice_1;
+ public static String HibernateConsolePreferencePage_choice_2;
+ public static String HibernateConsolePreferencePage_choice1;
+ public static String HibernateConsolePreferencePage_choice2;
+ public static String HibernateConsolePreferencePage_def_value;
+ public static String HibernateConsolePreferencePage_demo_of_pref_page_impl;
+ public static String HibernateConsolePreferencePage_dir_preference;
+ public static String HibernateConsolePreferencePage_example_of_bool_pref;
+ public static String HibernateConsolePreferencePage_example_of_multichoise_pref;
+ public static String HibernateConsolePreferencePage_text_pref;
+ //
+ public static String HibernatePropertyPage_default_hibernate_console_config;
+ public static String HibernatePropertyPage_enable_hibernate3_support;
+ public static String HibernatePropertyPage_open_url;
+ public static String HibernatePropertyPage_unable_open_webbrowser_for_url;
+ //
+ public static String AutoResizeTableLayout_unknown_column_layout_data;
+ public static String ClassLoaderHelper_could_not_determine_physical_location_for;
+ public static String LaunchHelper_launch_cfg_type_cannot_be_null;
+ public static String ProjectUtils_could_not_activate_hibernate_nature_on_project;
+ public static String ProjectUtils_could_not_save_changes_to_preferences;
+ //
+ public static String DialogSelectionHelper_used_entries_must_be_notnull;
+ //
+ public static String ConsoleConfigurationPropertySource_additional_mapping_files;
+ public static String ConsoleConfigurationPropertySource_config_file;
+ public static String ConsoleConfigurationPropertySource_error;
+ public static String ConsoleConfigurationPropertySource_name;
+ public static String ConsoleConfigurationPropertySource_properties_file;
+ public static String DynamicSQLPreviewView_caused_by;
+ public static String DynamicSQLPreviewView_empty_hql_query;
+ public static String DynamicSQLPreviewView_manipulation_of;
+ public static String DynamicSQLPreviewView_no_console_conf_associated;
+ public static String DynamicSQLPreviewView_no_hql_query_editor;
+ public static String DynamicSQLPreviewView_no_hql_query_editor_selected;
+ public static String DynamicSQLPreviewView_no_sql_generated;
+ public static String DynamicSQLPreviewView_session_factory_not_created;
+ public static String QueryPageViewer_error;
+ public static String QueryPageViewer_exception_while_executing_hql_query;
+ public static String QueryPageViewer_unknown_value;
+ public static String QueryParametersPage_format;
+ public static String QueryParametersPage_name;
+ public static String QueryParametersPage_null;
+ public static String QueryParametersPage_type;
+ public static String QueryParametersPage_value;
+ public static String QueryParametersView_no_hql_editor_open;
+ public static String ReloadConfigurationAction_exception_while_start_hibernate;
+ public static String ReloadConfigurationAction_rebuild_configuration;
+ public static String ReloadConfigurationAction_starting_hibernate_resulted_exception;
+ public static String SchemaExportAction_errornum_while_performing_schemaexport;
+ public static String SchemaExportAction_error_while_performing_schemaexport;
+ public static String SchemaExportAction_exception_running_schemaexport;
+ public static String SchemaExportAction_run_schemaexport;
+ public static String SchemaExportAction_sure_run_schemaexport;
+ //
+ public static String ClearPlaceHolderJob_removing_place_holder;
+ public static String PendingNode_error_getting_images;
+ public static String PendingNode_pending;
+ //
+ public static String EntityPropertySource_identifier;
+ public static String EntityPropertySource_properties;
+ public static String QueryPagePropertySource_console_configuration;
+ public static String QueryPagePropertySource_millisec;
+ public static String QueryPagePropertySource_query_run_time;
+ public static String QueryPagePropertySource_query_size;
+ public static String QueryPagePropertySource_query_string;
+ public static String QueryPagePropertySource_sec;
+ public static String QueryPagePropertySource_unknown;
+ //
+ public static String ConsoleConfigurationCreationWizard_configuring_hibernate_console;
+ public static String ConsoleConfigurationCreationWizard_enable_hibernate_features;
+ public static String ConsoleConfigurationCreationWizard_error_finishing;
+ public static String ConsoleConfigurationCreationWizard_missing_classes;
+ public static String ConsoleConfigurationCreationWizard_the_project;
+ public static String ConsoleConfigurationCreationWizard_the_project_named;
+ public static String ConsoleConfigurationCreationWizard_the_project_named_have;
+ public static String ConsoleConfigurationWizardPage_27;
+ public static String ConsoleConfigurationWizardPage_28;
+ public static String ConsoleConfigurationWizardPage_35;
+ public static String ConsoleConfigurationWizardPage_add_classpath_entry;
+ public static String ConsoleConfigurationWizardPage_add_directory_zip_jar;
+ public static String ConsoleConfigurationWizardPage_add_external_jars;
+ public static String ConsoleConfigurationWizardPage_add_hbmxml_file;
+ public static String ConsoleConfigurationWizardPage_add_hibernate_mapping_file;
+ public static String ConsoleConfigurationWizardPage_add_jar_dir;
+ public static String ConsoleConfigurationWizardPage_additional_classpath;
+ public static String ConsoleConfigurationWizardPage_additional_mapping_files;
+ public static String ConsoleConfigurationWizardPage_annotations;
+ public static String ConsoleConfigurationWizardPage_browse;
+ public static String ConsoleConfigurationWizardPage_choose_file_to_use;
+ public static String ConsoleConfigurationWizardPage_choose_file_to_use_hibcfgxml_file;
+ public static String ConsoleConfigurationWizardPage_classpath;
+ public static String ConsoleConfigurationWizardPage_config_file;
+ public static String ConsoleConfigurationWizardPage_config_name_already_exist;
+ public static String ConsoleConfigurationWizardPage_config_page;
+ public static String ConsoleConfigurationWizardPage_configuration_file;
+ public static String ConsoleConfigurationWizardPage_core;
+ public static String ConsoleConfigurationWizardPage_create_hibernate_console_config;
+ public static String ConsoleConfigurationWizardPage_does_not_exist;
+ public static String ConsoleConfigurationWizardPage_entity_resolver;
+ public static String ConsoleConfigurationWizardPage_general;
+ public static String ConsoleConfigurationWizardPage_include_default_classpath;
+ public static String ConsoleConfigurationWizardPage_is_not_a_file;
+ public static String ConsoleConfigurationWizardPage_jpa;
+ public static String ConsoleConfigurationWizardPage_mappings;
+ public static String ConsoleConfigurationWizardPage_name;
+ public static String ConsoleConfigurationWizardPage_name_must_specified;
+ public static String ConsoleConfigurationWizardPage_naming_strategy;
+ public static String ConsoleConfigurationWizardPage_need_to_specify_classpath;
+ public static String ConsoleConfigurationWizardPage_need_to_specify_project;
+ public static String ConsoleConfigurationWizardPage_persistence_unit;
+ public static String ConsoleConfigurationWizardPage_problem_while_initializing_cc;
+ public static String ConsoleConfigurationWizardPage_problem_while_locating_jdbc_drivers;
+ public static String ConsoleConfigurationWizardPage_project;
+ public static String ConsoleConfigurationWizardPage_property_file_1;
+ public static String ConsoleConfigurationWizardPage_property_file_2;
+ public static String ConsoleConfigurationWizardPage_select_entity_resolver_class;
+ public static String ConsoleConfigurationWizardPage_select_hibcfgxml_file;
+ public static String ConsoleConfigurationWizardPage_select_java_project;
+ public static String ConsoleConfigurationWizardPage_select_java_project_to_classpath;
+ public static String ConsoleConfigurationWizardPage_select_naming_strategy_class;
+ public static String ConsoleConfigurationWizardPage_select_property_file;
+ public static String ConsoleConfigurationWizardPage_the_java_project_does_not_exist;
+ public static String ConsoleConfigurationWizardPage_this_wizard_allows;
+ public static String ConsoleConfigurationWizardPage_type;
+ public static String NewConfigurationWizard_create_hibernate_cfg_file;
+ public static String NewConfigurationWizard_create_new_hibernate_cfg_xml;
+ public static String NewConfigurationWizard_creating;
+ public static String NewConfigurationWizard_error;
+ public static String NewConfigurationWizard_open_file_for_editing;
+ public static String NewConfigurationWizard_problems_converting_to_utf8;
+ public static String NewConfigurationWizardPage_connection_url;
+ public static String NewConfigurationWizardPage_container;
+ public static String NewConfigurationWizardPage_create_console_configuration;
+ public static String NewConfigurationWizardPage_database_dialect;
+ public static String NewConfigurationWizardPage_default_catalog;
+ public static String NewConfigurationWizardPage_default_schema;
+ public static String NewConfigurationWizardPage_driver_class;
+ public static String NewConfigurationWizardPage_file_already_exist;
+ public static String NewConfigurationWizardPage_file_container_must_be_specified;
+ public static String NewConfigurationWizardPage_file_container_must_exist;
+ public static String NewConfigurationWizardPage_file_extension_must_be_cfgxml;
+ public static String NewConfigurationWizardPage_file_name;
+ public static String NewConfigurationWizardPage_file_name_must_be_specified;
+ public static String NewConfigurationWizardPage_file_name_must_be_valid;
+ public static String NewConfigurationWizardPage_hibernate_config_file;
+ public static String NewConfigurationWizardPage_password;
+ public static String NewConfigurationWizardPage_project_must_be_writable;
+ public static String NewConfigurationWizardPage_session_factory_name;
+ public static String NewConfigurationWizardPage_this_wizard_creates;
+ public static String NewConfigurationWizardPage_user_name;
+ public static String NewHibernateMappingFilePage_browse;
+ public static String NewHibernateMappingFilePage_class_to_map;
+ public static String NewHibernateMappingFilePage_container;
+ public static String NewHibernateMappingFilePage_file_container_must_be_specified;
+ public static String NewHibernateMappingFilePage_file_container_must_exist;
+ public static String NewHibernateMappingFilePage_file_name;
+ public static String NewHibernateMappingFilePage_file_name_must_be_specified;
+ public static String NewHibernateMappingFilePage_file_name_must_be_valid;
+ public static String NewHibernateMappingFilePage_hibernate_xml_mapping_file;
+ public static String NewHibernateMappingFilePage_project_must_be_writable;
+ public static String NewHibernateMappingFilePage_select_class_to_map;
+ public static String NewHibernateMappingFilePage_select_new_file_container;
+ public static String NewHibernateMappingFilePage_the_class_will_be_used_when;
+ public static String NewHibernateMappingFilePage_this_wizard_creates;
+ public static String NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file;
+ public static String NewHibernateMappingFileWizard_create_new_xml_mapping_file;
+ public static String NewHibernateMappingFileWizard_creating;
+ public static String NewHibernateMappingFileWizard_opening_file_for_editing;
+ public static String NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file;
+ public static String NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml;
+ public static String NewReverseEngineeringFileWizard_creating;
+ public static String NewReverseEngineeringFileWizard_error;
+ public static String NewReverseEngineeringFileWizard_opening_file_for_editing;
+ public static String NewReverseEngineeringFileWizard_problems_converting_to_utf8;
+ public static String TableFilterView_catalog;
+ public static String TableFilterView_do_you_want_to_remove_all_filters;
+ public static String TableFilterView_exclude;
+ public static String TableFilterView_include;
+ public static String TableFilterView_not_known_button;
+ public static String TableFilterView_remove_all_filters;
+ public static String TableFilterView_schema;
+ public static String TableFilterView_sign;
+ public static String TableFilterView_table;
+ public static String TableFilterWizardPage_configure_table_filters;
+ public static String TableFilterWizardPage_console_configuration;
+ public static String TableFilterWizardPage_specify_which_catalog;
+ public static String TableFilterWizardPage_table_filters_contains_duplicates;
+ public static String TreeToTableComposite_database_schema;
+ public static String TreeToTableComposite_down;
+ public static String TreeToTableComposite_exclude;
+ public static String TreeToTableComposite_include;
+ public static String TreeToTableComposite_incorrect_initial_value;
+ public static String TreeToTableComposite_incorrect_state_count;
+ public static String TreeToTableComposite_invalid_value;
+ public static String TreeToTableComposite_refresh;
+ public static String TreeToTableComposite_remove;
+ public static String TreeToTableComposite_remove_all;
+ public static String TreeToTableComposite_table_filters;
+ public static String TreeToTableComposite_up;
+ public static String UpDownListComposite_add;
+ public static String UpDownListComposite_down;
+ public static String UpDownListComposite_remove;
+ public static String UpDownListComposite_test;
+ public static String UpDownListComposite_up;
+ //
+ public static String BasicWorkbenchAdapter_error_while_expanding;
+ public static String BasicWorkbenchAdapter_hibernate_configuration_error;
+ public static String ConfigurationWorkbenchAdapter_configuration;
+ public static String ConsoleConfigurationWorkbenchAdapter_empty_configuration;
+ public static String KnownConfigurationsWorkbenchAdapter_configurations;
+ public static String LazyDatabaseSchemaWorkbenchAdapter_database;
+ public static String LazyDatabaseSchemaWorkbenchAdapter_problem_while_reading_database_schema;
+ public static String LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema;
+ public static String LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error;
+ public static String LazyDatabaseSchemaWorkbenchAdapter_schema_not_available;
+ public static String LazySessionFactoryAdapter_problems_while_creating_sessionfactory;
+ public static String LazySessionFactoryAdapter_session_factory;
+ public static String LazySessionFactoryAdapter_sessionfactory_error;
+ public static String PrimaryKeyWorkbenchAdapter_composite_primary_key;
+ public static String TableContainerWorkbenchAdapter_default;
+ public static String ValueWorkbenchAdapter_value;
+ //
+ public static String AnyAdaptableLabelProvider_unknown;
+ //
+ public static String CriteriaEditorInput_criteria;
+ public static String CriteriaEditorInput_none;
+ public static String CriteriaEditorStorage_criteria;
+ public static String CriteriaEditorStorage_none;
+ public static String JavaCompletionProcessor_error;
+ public static String JavaCompletionProcessor_error_while_performing_code_completion;
+ public static String JavaCompletionProcessor_no_console_configuration_found;
+ public static String JavaCompletionProcessor_session_session;
+ //
+ public static String HibernateConfigurationPartFactory_not_known_by_factory;
+ //
+ public static String ToggleLayoutAction_auto_layout;
+ public static String ToggleLayoutAction_auto_layout_active;
+ public static String ToggleLayoutAction_enable_auto_layout;
+ public static String ToggleLayoutAction_enable_manual_layout;
+ public static String ToggleLayoutAction_manual_layout_active;
+ //
+ public static String AssociationViewAdapter_association_target_source;
+ public static String InheritanceViewAdapter_inheritance;
+ public static String InheritanceViewAdapter_subclass_must_not_be_equal_to_superclass;
+ public static String InheritanceViewAdapter_subclass_must_not_null;
+ public static String InheritanceViewAdapter_superclass_must_not_null;
+ //
+ public static String CompletionHelper_could_not_complete_java_types;
+ public static String CompletionHelper_error_unknown_completion_proposal_class;
+ public static String HQLCompletionProcessor_could_not_get_document_contents;
+ public static String HQLCompletionProcessor_error_while_performing_hql_completion;
+ public static String HQLCompletionProcessor_no_hql_completions_available;
+ public static String HQLCompletionProcessor_no_start_word_found;
+ public static String HQLEditorInput_none;
+ public static String HQLEditorStorage_none;
+ public static String HQLTextHover_empty_selection;
+ public static String LoadConsoleCFGCompletionProposal_could_not_load_configuration;
+ public static String LoadConsoleCFGCompletionProposal_load_console_cfg;
+ public static String LoadConsoleCFGCompletionProposal_no_open_console_cfg_found;
+ //
+ public static String HQLEditorPreferencePage_colors_for_hql_editor_highlighting;
+ public static String HQLEditorPreferencePage_default;
+ public static String HQLEditorPreferencePage_identifier;
+ public static String HQLEditorPreferencePage_keyword;
+ public static String HQLEditorPreferencePage_string_literal;
+ //
+ public static String AddPropertyDialog_add_exporter_property;
+ public static String AddPropertyDialog_add_property_to;
+ public static String AddPropertyDialog_name;
+ public static String AddPropertyDialog_the_property_is_already_set;
+ public static String AddPropertyDialog_the_property_name_may_not_contain_whitespaces;
+ public static String AddPropertyDialog_the_property_name_must_be_chosen_or_entered;
+ public static String AddPropertyDialog_the_property_value_must_be_non_empty;
+ public static String AddPropertyDialog_value;
+ public static String CodeGenerationLaunchDelegate_console_configuration_not_found_in;
+ public static String CodeGenerationLaunchDelegate_console_configuration_name_is_empty_in;
+ public static String CodeGenerationLaunchDelegate_could_not_create_or_find_with_default_noarg_constructor;
+ public static String CodeGenerationLaunchDelegate_could_not_create_or_find_with_one_argument_delegate_constructor;
+ public static String CodeGenerationLaunchDelegate_error_while_running;
+ public static String CodeGenerationLaunchDelegate_error_while_setting_up;
+ public static String CodeGenerationLaunchDelegate_exception_during_java_format;
+ public static String CodeGenerationLaunchDelegate_formate_generated_code;
+ public static String CodeGenerationLaunchDelegate_generating_code_for;
+ public static String CodeGenerationLaunchDelegate_java_format_cancelled;
+ public static String CodeGenerationLaunchDelegate_output_has_to_be_specified_in;
+ public static String CodeGenerationLaunchDelegate_reading_jdbc_metadata;
+ public static String CodeGenerationLaunchDelegate_received_noclassdeffounderror;
+ public static String CodeGenerationSettingsTab_browse;
+ public static String CodeGenerationSettingsTab_choose_dir_custom_templates;
+ public static String CodeGenerationSettingsTab_choose_dir_for_generated_files;
+ public static String CodeGenerationSettingsTab_choose_file_read_reverse_settings;
+ public static String CodeGenerationSettingsTab_choose_reverse_engineering_strategy;
+ public static String CodeGenerationSettingsTab_console_cfg_must_be_specified;
+ public static String CodeGenerationSettingsTab_console_configuration;
+ public static String CodeGenerationSettingsTab_create_new;
+ public static String CodeGenerationSettingsTab_detect_many_to_many_tables;
+ public static String CodeGenerationSettingsTab_detect_optimistic_lock_columns;
+ public static String CodeGenerationSettingsTab_do_you_want_create_reveng_xml;
+ public static String CodeGenerationSettingsTab_does_not_exist;
+ public static String CodeGenerationSettingsTab_filesystem;
+ public static String CodeGenerationSettingsTab_generate_basic_typed_composite_ids;
+ public static String CodeGenerationSettingsTab_main;
+ public static String CodeGenerationSettingsTab_must_be_file;
+ public static String CodeGenerationSettingsTab_output_dir;
+ public static String CodeGenerationSettingsTab_output_directory;
+ public static String CodeGenerationSettingsTab_package;
+ public static String CodeGenerationSettingsTab_problems_when_reading;
+ public static String CodeGenerationSettingsTab_reveng_strategy;
+ public static String CodeGenerationSettingsTab_reveng_xml_1;
+ public static String CodeGenerationSettingsTab_reveng_xml_2;
+ public static String CodeGenerationSettingsTab_reveng_xml_3;
+ public static String CodeGenerationSettingsTab_reverse_engineer_from_jdbc_connection;
+ public static String CodeGenerationSettingsTab_select_output_dir;
+ public static String CodeGenerationSettingsTab_select_reverse_engineering_settings_file;
+ public static String CodeGenerationSettingsTab_select_template_dir;
+ public static String CodeGenerationSettingsTab_setup;
+ public static String CodeGenerationSettingsTab_setup_reverse_engineering;
+ public static String CodeGenerationSettingsTab_template_dir;
+ public static String CodeGenerationSettingsTab_template_directory;
+ public static String CodeGenerationSettingsTab_use_custom_templates;
+ public static String CodeGenerationSettingsTab_use_existing;
+ public static String CodeGenerationSettingsTab_workspace;
+ public static String ConsoleConfigurationLaunchDelegate_direct_launch_not_supported;
+ public static String ConsoleConfigurationMainTab_annotations;
+ public static String ConsoleConfigurationMainTab_cfg_xml;
+ public static String ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_cfg_xml;
+ public static String ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_properties;
+ public static String ConsoleConfigurationMainTab_configuration_file;
+ public static String ConsoleConfigurationMainTab_configuration_file_2;
+ public static String ConsoleConfigurationMainTab_core;
+ public static String ConsoleConfigurationMainTab_create_hibernate_properties_file;
+ public static String ConsoleConfigurationMainTab_create_new;
+ public static String ConsoleConfigurationMainTab_create_new_properties_file;
+ public static String ConsoleConfigurationMainTab_create_property_file;
+ public static String ConsoleConfigurationMainTab_do_you_want_to_create_new_cfgxml;
+ public static String ConsoleConfigurationMainTab_do_you_want_to_create_new_property_file;
+ public static String ConsoleConfigurationMainTab_does_not_exist;
+ public static String ConsoleConfigurationMainTab_is_not_file;
+ public static String ConsoleConfigurationMainTab_java_project_to_determine_default_classpath;
+ public static String ConsoleConfigurationMainTab_jpa;
+ public static String ConsoleConfigurationMainTab_main;
+ public static String ConsoleConfigurationMainTab_path_for_project_must_have_only_one_segment;
+ public static String ConsoleConfigurationMainTab_persistence_unit;
+ public static String ConsoleConfigurationMainTab_project;
+ public static String ConsoleConfigurationMainTab_properties;
+ public static String ConsoleConfigurationMainTab_property_file;
+ public static String ConsoleConfigurationMainTab_property_file_2;
+ public static String ConsoleConfigurationMainTab_select_java_project;
+ public static String ConsoleConfigurationMainTab_select_propertyfile;
+ public static String ConsoleConfigurationMainTab_setup_configuration_file;
+ public static String ConsoleConfigurationMainTab_setup_property_file;
+ public static String ConsoleConfigurationMainTab_select_hibernate_cfg_xml_file;
+ public static String ConsoleConfigurationMainTab_the_java_project_does_not_exist;
+ public static String ConsoleConfigurationMainTab_type;
+ public static String ConsoleConfigurationMainTab_use_existing;
+ public static String ConsoleConfigurationMainTab_wizard_page;
+ public static String ConsoleConfigurationMappingsTab_add_hbm_xml_file;
+ public static String ConsoleConfigurationMappingsTab_add_hibernate_mapping_file;
+ public static String ConsoleConfigurationMappingsTab_additional_mapping_files;
+ public static String ConsoleConfigurationMappingsTab_mappings;
+ public static String ConsoleConfigurationOptionsTab_entity_resolver;
+ public static String ConsoleConfigurationOptionsTab_naming_strategy;
+ public static String ConsoleConfigurationOptionsTab_options;
+ public static String ConsoleConfigurationOptionsTab_select_entity_resolver_class;
+ public static String ConsoleConfigurationOptionsTab_select_naming_strategy_class;
+ public static String ConsoleConfigurationTab_browse;
+ public static String ConsoleConfigurationTab_create_new;
+ public static String ConsoleConfigurationTab_setup;
+ public static String ConsoleConfigurationTabGroup_classpath_must_be_set_or_restored_to_default;
+ public static String DirectoryBrowseField_filesystem;
+ public static String DirectoryBrowseField_workspace;
+ public static String ExporterAttributes_could_not_locate_exporter_for_in;
+ public static String ExporterSettingsTab_add;
+ public static String ExporterSettingsTab_add_exporter;
+ public static String ExporterSettingsTab_at_least_one_exporter_option_must_be_selected;
+ public static String ExporterSettingsTab_console_configuration_must_be_specified;
+ public static String ExporterSettingsTab_description;
+ public static String ExporterSettingsTab_deselect_all;
+ public static String ExporterSettingsTab_does_not_exist;
+ public static String ExporterSettingsTab_exporters;
+ public static String ExporterSettingsTab_exporters_2;
+ public static String ExporterSettingsTab_general_settings;
+ public static String ExporterSettingsTab_generate_ejb3annotations;
+ public static String ExporterSettingsTab_has_to_be_folder_or_project;
+ public static String ExporterSettingsTab_must_be_file;
+ public static String ExporterSettingsTab_output_directory_for;
+ public static String ExporterSettingsTab_problem_when_reading_hibernate_tools_launch_configuration;
+ public static String ExporterSettingsTab_project_for_is_closed;
+ public static String ExporterSettingsTab_properties;
+ public static String ExporterSettingsTab_remove;
+ public static String ExporterSettingsTab_select_all;
+ public static String ExporterSettingsTab_select_exporter_you_want_to_add;
+ public static String ExporterSettingsTab_template_directory_for;
+ public static String ExporterSettingsTab_use_java5_syntax;
+ public static String GeneralExceptionStatusHandler_exception_while_generating_code;
+ public static String GeneralExceptionStatusHandler_generating_code;
+ public static String PathHelper_does_not_exist;
+ public static String PathHelper_has_invalid_variable_references;
+ public static String PathHelper_has_to_be_folder_or_project;
+ public static String PathHelper_project_for_is_closed;
+ //
+ public static String HibernateRefactoringUtil_error_during_refactoring;
+ public static String HibernateRefactoringUtil_error_occured_while_updating_classpath;
+ public static String LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg;
+ public static String MoveResourceParticipant_launch_configurations_updates;
+ public static String RenameResourceParticipant_launch_configurations_updates;
+ //
+ public static String HibernateNature_error_while_performing_background_reading_of_database_schema;
+ public static String HibernateNature_exception_when_trying_to_locate_hibernate_nature;
+ public static String HibernateNature_reading_database_metadata;
+ public static String HibernateNature_reading_database_metadata_for;
+ //
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, HibernateConsoleMessages.class);
+ }
+
+ private HibernateConsoleMessages() {
+ }
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties 2008-06-10 13:18:48 UTC (rev 8677)
@@ -0,0 +1,492 @@
+popup_copy_text=Copy
+popup_paste_text=Paste
+popup_select_all=Select All
+find_replace_action_label=Find/Replace
+find_replace_action_tooltip=Find/Replace
+find_replace_action_image=
+find_replace_action_description=Find & Replace
+AbstractQueryEditor_could_not_show_query_editor_input=Could not show query editor input
+AbstractQueryEditor_do_you_want_open_session_factory=Do you want to open the session factory for {0} ?
+AbstractQueryEditor_max_results=Max results:
+AbstractQueryEditor_open_session_factory=Open Session factory
+EclipseConsoleConfigurationPreferences_could_not_compute_def_classpath=Could not compute default classpath from project
+EclipseConsoleConfigurationPreferences_could_not_resolve_to_file=Could not resolve {0} to a file
+EclipseConsoleConfigurationPreferences_could_not_resolve_classpaths=Could not resolve classpaths
+EclipseConsoleConfigurationPreferences_errors_while_parsing=Errors while parsing
+EclipseLaunchConsoleConfigurationPreferences_cannot_be_renamed=\ cannot be renamed
+EclipseLaunchConsoleConfigurationPreferences_cannot_read_from_xml=Cannot read from xml
+EclipseLaunchConsoleConfigurationPreferences_cannot_write_to_xml=Cannot write to xml
+EclipseLaunchConsoleConfigurationPreferences_could_not_compute_classpath=Could not compute classpath
+EclipseLaunchConsoleConfigurationPreferences_could_not_load_property_file=Could not load property file
+EclipseLaunchConsoleConfigurationPreferences_could_not_resolve_to_file=Could not resolve {0} to a file
+HibernateConsolePlugin_could_not_delete_launch_config_for=Could not delete launch configuration for:
+HibernateConsolePlugin_could_not_open_criteria_editor_for_console=Could not open Criteria editor for console:
+HibernateConsolePlugin_could_not_open_hql_editor_for_console=Could not open HQL editor for console:
+HibernateConsolePlugin_error_while_reading_console_config=Error while reading console configuration
+HibernateConsolePlugin_hibernate_console=Hibernate Console
+HibernateConsolePlugin_no_message_1=: <no message>
+HibernateConsolePlugin_no_message_2=<No message>
+HibernateConsolePlugin_problem_to_get_flag=Problem to get flag
+
+AddConfigurationAction_add_config=Add Configuration...
+AddConfigurationAction_hibernate=hibernate
+AddConfigurationAction_problem_add_console_config=Problem adding a console configuration
+BuildSessionFactoryAction_build_session_factory=Build SessionFactory
+BuildSessionFactoryAction_close_sessionfactory=Close SessionFactory
+BuildSessionFactoryAction_create_sessionfactory=Create SessionFactory
+BuildSessionFactoryAction_exception_while_start_hibernate=Exception while connecting/starting Hibernate
+BuildSessionFactoryAction_start_hibernate_resulted=Starting Hibernate resulted in a UnsupportedClassVersionError.\nThis can occur if you are running eclipse with JDK 1.4 and your domain classes require JDK 1.5. \n\nResolution: Run eclipse with JDK 1.5.
+ClearAction_clear_editor=Clear editor
+CloseQueryPageAction_close_query_page=Close query page
+ConsoleConfigurationBasedAction_problem_while_executing=Problem while executing {0} ({1})
+CriteriaEditorAction_hibernate_criteria_editor=Hibernate Criteria Editor
+CriteriaEditorAction_open_hibernate_criteria_editor=Open Hibernate Criteria Editor
+DeleteConfigurationAction_delete_config=Delete Configuration
+DeleteConfigurationAction_delete_console_config=Delete console configuration
+DeleteConfigurationAction_do_you_wish_del_selected_config=Do you wish to delete the selected console configuration
+DeleteConfigurationAction_str_1=s
+DeleteConfigurationAction_str_2=s
+DeleteConfigurationAction_str_3=?
+EditConsoleConfiguration_could_not_find_launch_cfg=Could not find launch configuration for '{0}'
+EditConsoleConfiguration_edit_config=Edit Configuration
+EditConsoleConfiguration_exception_while_edit_config=Exception while trying to edit configuration
+EditConsoleConfiguration_no_launch_cfg_matched=No launch configuration matched the configuration named
+EditConsoleConfiguration_problem_adding_console_cfg=Problem adding a console configuration
+ExecuteQueryAction_run_hql=Run HQL
+HQLScratchpadAction_hql_editor=HQL Editor
+HQLScratchpadAction_open_hql_editor=Open HQL Editor
+JTidyFormatAction_do_you_want_format_xml_files_with_jtidy=Do you want to format {0} xml files with JTidy?
+JTidyFormatAction_error_while_running_jtidy=Error while running JTidy
+JTidyFormatAction_format_with_jtidy=Format with JTidy
+OpenFileActionUtils_problems_while_get_project_package_fragment_roots=Problems while getting project package fragment roots
+OpenMappingAction_cannot_find_mapping_file=Can't find mapping file.
+OpenMappingAction_cannot_open_mapping_file=Can't open mapping file.
+OpenMappingAction_mapping_file_for_property_not_found=Mapping file for property '{0}' not found.
+OpenMappingAction_mapping_for_not_found=Mapping for {0} not found.
+OpenMappingAction_open_mapping_file=Open Mapping File
+OpenMappingAction_selection_not_found=Selection not found.
+OpenQueryEditorAction_exception_open_hql_editor=Exception while trying to open HQL editor
+OpenSourceAction_cannot_find_source_file=Can't find source file.
+OpenSourceAction_cannot_open_source_file=Can't open source file.
+OpenSourceAction_open_source_file=Open Source File
+OpenSourceAction_source_file_for_class_not_found=Source file for class '{0}' not found.
+RefreshAction_refresh=Refresh
+
+ExporterDefinition_problem_creating_exporter_class=Problem while creating exporter class
+ExporterFactory_output_dir_in_does_not_exist=Output directory '{0}' in {1} does not exist.
+ExporterFactory_template_dir_in_does_not_exist=Template directory '{0}' in {1} does not exist.
+ExporterProperty_generate_ejb3_annotations=Generate EJB3 annotations
+ExporterProperty_use_java5_syntax=Use Java 5 syntax
+
+HibernateConsolePreferencePage_choice_1=&Choice 1
+HibernateConsolePreferencePage_choice_2=C&hoice 2
+HibernateConsolePreferencePage_choice1=choice1
+HibernateConsolePreferencePage_choice2=choice2
+HibernateConsolePreferencePage_def_value=Default value
+HibernateConsolePreferencePage_demo_of_pref_page_impl=A demonstration of a preference page implementation
+HibernateConsolePreferencePage_dir_preference=&Directory preference:
+HibernateConsolePreferencePage_example_of_bool_pref=&An example of a boolean preference
+HibernateConsolePreferencePage_example_of_multichoise_pref=An example of a multiple-choice preference
+HibernateConsolePreferencePage_text_pref=A &text preference:
+
+HibernatePropertyPage_default_hibernate_console_config=Default Hibernate Console configuration:
+HibernatePropertyPage_enable_hibernate3_support=Enable Hibernate 3 support
+HibernatePropertyPage_open_url=Open URL
+HibernatePropertyPage_unable_open_webbrowser_for_url=Unable to open webbrowser for url:
+
+AutoResizeTableLayout_unknown_column_layout_data=Unknown column layout data
+ClassLoaderHelper_could_not_determine_physical_location_for=Could not determine physical location for
+LaunchHelper_launch_cfg_type_cannot_be_null=Launch configuration type cannot be null
+ProjectUtils_could_not_activate_hibernate_nature_on_project=Could not activate Hibernate nature on project
+ProjectUtils_could_not_save_changes_to_preferences=Could not save changes to preferences
+
+DialogSelectionHelper_used_entries_must_be_notnull=used entries must be not-null
+
+ConsoleConfigurationPropertySource_additional_mapping_files=Additional mapping files
+ConsoleConfigurationPropertySource_config_file=Configuration file
+ConsoleConfigurationPropertySource_error=Error:
+ConsoleConfigurationPropertySource_name=Name
+ConsoleConfigurationPropertySource_properties_file=Properties file
+DynamicSQLPreviewView_caused_by=\nCaused by:\n
+DynamicSQLPreviewView_empty_hql_query=Empty HQL query.
+DynamicSQLPreviewView_manipulation_of=Manipulation of
+DynamicSQLPreviewView_no_console_conf_associated=No Console configuration associated with HQL Editor
+DynamicSQLPreviewView_no_hql_query_editor=No HQL Query editor
+DynamicSQLPreviewView_no_hql_query_editor_selected=No HQL Query editor selected
+DynamicSQLPreviewView_no_sql_generated=HQL was valid, but no SQL generated. Your configuration most likely does not have any mappings defined.
+DynamicSQLPreviewView_session_factory_not_created=Session factory not created for configuration:
+QueryPageViewer_error=<error:{0}>
+QueryPageViewer_exception_while_executing_hql_query=Exception while executing HQL Query
+QueryPageViewer_unknown_value=<Unknown value>
+QueryParametersPage_format=Format:
+QueryParametersPage_name=Name
+QueryParametersPage_null=null?
+QueryParametersPage_type=Type
+QueryParametersPage_value=Value
+QueryParametersView_no_hql_editor_open=No HQL editor open
+ReloadConfigurationAction_exception_while_start_hibernate=Exception while connecting/starting Hibernate
+ReloadConfigurationAction_rebuild_configuration=Rebuild configuration
+ReloadConfigurationAction_starting_hibernate_resulted_exception=Starting Hibernate resulted in a UnsupportedClassVersionError.\nThis can occur if you are running eclipse with JDK 1.4 and your domain classes require JDK 1.5. \n\nResolution: Run eclipse with JDK 1.5.
+SchemaExportAction_errornum_while_performing_schemaexport=Error \# {0} while performing SchemaExport
+SchemaExportAction_error_while_performing_schemaexport=\ error(s) while performing SchemaExport, see Error Log for details
+SchemaExportAction_exception_running_schemaexport=Exception while running SchemaExport
+SchemaExportAction_run_schemaexport=Run SchemaExport
+SchemaExportAction_sure_run_schemaexport=Are you sure you want to run SchemaExport on '{0}'?
+
+ClearPlaceHolderJob_removing_place_holder=Removing place holder for pending node
+PendingNode_error_getting_images=Error while getting images
+PendingNode_pending=Pending
+
+EntityPropertySource_identifier=Identifier
+EntityPropertySource_properties=Properties
+QueryPagePropertySource_console_configuration=Console configuration
+QueryPagePropertySource_millisec=\ millisec
+QueryPagePropertySource_query_run_time=Query run time
+QueryPagePropertySource_query_size=Query size
+QueryPagePropertySource_query_string=Query string
+QueryPagePropertySource_sec=\ sec
+QueryPagePropertySource_unknown=(unknown)
+
+ConsoleConfigurationCreationWizard_configuring_hibernate_console=Configuring Hibernate Console
+ConsoleConfigurationCreationWizard_enable_hibernate_features=Enable Hibernate features for project
+ConsoleConfigurationCreationWizard_error_finishing=Error while finishing Wizard
+ConsoleConfigurationCreationWizard_missing_classes=Probably missing classes or errors with classloading
+ConsoleConfigurationCreationWizard_the_project=The project named '{0}' does not have Hibernate features enabled. Should it be updated to use {1} ?
+ConsoleConfigurationCreationWizard_the_project_named=The project named {0} does not have a default Hibernate configuration specified. Should it be updated to use {1} ?
+ConsoleConfigurationCreationWizard_the_project_named_have=The project named {0} have the {1} specified. Should it be updated to use {2} ?
+ConsoleConfigurationWizardPage_27=.jar
+ConsoleConfigurationWizardPage_28=.zip
+ConsoleConfigurationWizardPage_35=hbm.xml
+ConsoleConfigurationWizardPage_add_classpath_entry=Add classpath entry
+ConsoleConfigurationWizardPage_add_directory_zip_jar=Add a directory, .zip or .jar file
+ConsoleConfigurationWizardPage_add_external_jars=Add External JARS...
+ConsoleConfigurationWizardPage_add_hbmxml_file=Add hbm.xml file
+ConsoleConfigurationWizardPage_add_hibernate_mapping_file=Add a Hibernate Mapping file
+ConsoleConfigurationWizardPage_add_jar_dir=Add JAR/Dir...
+ConsoleConfigurationWizardPage_additional_classpath=Additional classpath (Hibernate jars not necessary\!)
+ConsoleConfigurationWizardPage_additional_mapping_files=Additional mapping files (not listed in cfg.xml)
+ConsoleConfigurationWizardPage_annotations=Annotations (jdk 1.5+)
+ConsoleConfigurationWizardPage_browse=Browse...
+ConsoleConfigurationWizardPage_choose_file_to_use=Choose file to use as hibernate.properties
+ConsoleConfigurationWizardPage_choose_file_to_use_hibcfgxml_file=Choose file to use as hibernate.cfg.xml
+ConsoleConfigurationWizardPage_classpath=Classpath
+ConsoleConfigurationWizardPage_config_file=&Configuration file:
+ConsoleConfigurationWizardPage_config_name_already_exist=A configuration with that name already exists\!
+ConsoleConfigurationWizardPage_config_page=configurationPage
+ConsoleConfigurationWizardPage_configuration_file=Configuration file
+ConsoleConfigurationWizardPage_core=Core
+ConsoleConfigurationWizardPage_create_hibernate_console_config=Create Hibernate Console Configuration
+ConsoleConfigurationWizardPage_does_not_exist=\ does not exist
+ConsoleConfigurationWizardPage_entity_resolver=&Entity resolver:
+ConsoleConfigurationWizardPage_general=General
+ConsoleConfigurationWizardPage_include_default_classpath=Include default classpath from project
+ConsoleConfigurationWizardPage_is_not_a_file=\ is not a file
+ConsoleConfigurationWizardPage_jpa=JPA (jdk 1.5+)
+ConsoleConfigurationWizardPage_mappings=Mappings
+ConsoleConfigurationWizardPage_name=&Name:
+ConsoleConfigurationWizardPage_name_must_specified=A name must be specified
+ConsoleConfigurationWizardPage_naming_strategy=&Naming strategy:
+ConsoleConfigurationWizardPage_need_to_specify_classpath=Need to specify a classpath when not using a project classpath
+ConsoleConfigurationWizardPage_need_to_specify_project=Need to specify a project or setup a classpath
+ConsoleConfigurationWizardPage_persistence_unit=&Persistence unit:
+ConsoleConfigurationWizardPage_problem_while_initializing_cc=Problem while initializing ConsoleConfigurationWizardPage
+ConsoleConfigurationWizardPage_problem_while_locating_jdbc_drivers=Problem while locating jdbc drivers
+ConsoleConfigurationWizardPage_project=Pro&ject:
+ConsoleConfigurationWizardPage_property_file_1=Property file
+ConsoleConfigurationWizardPage_property_file_2=&Property file:
+ConsoleConfigurationWizardPage_select_entity_resolver_class=Select entity resolver class
+ConsoleConfigurationWizardPage_select_hibcfgxml_file=Select hibernate.cfg.xml file
+ConsoleConfigurationWizardPage_select_java_project=Select java project
+ConsoleConfigurationWizardPage_select_java_project_to_classpath=The (optional) java project is used to determine the default classpath
+ConsoleConfigurationWizardPage_select_naming_strategy_class=Select naming strategy class
+ConsoleConfigurationWizardPage_select_property_file=Select property file
+ConsoleConfigurationWizardPage_the_java_project_does_not_exist=The Java project {0} does not exist.
+ConsoleConfigurationWizardPage_this_wizard_allows=This wizard allows you to create a configuration for Hibernate Console.
+ConsoleConfigurationWizardPage_type=Type:
+NewConfigurationWizard_create_hibernate_cfg_file=Create Hibernate Configuration file (cfg.xml)
+NewConfigurationWizard_create_new_hibernate_cfg_xml=Create a new hibernate.cfg.xml.
+NewConfigurationWizard_creating=Creating
+NewConfigurationWizard_error=Error
+NewConfigurationWizard_open_file_for_editing=Opening file for editing...
+NewConfigurationWizard_problems_converting_to_utf8=Problems converting to UTF-8
+NewConfigurationWizardPage_connection_url=Connection &URL:
+NewConfigurationWizardPage_container=&Container:
+NewConfigurationWizardPage_create_console_configuration=Create a console configuration
+NewConfigurationWizardPage_database_dialect=&Database dialect:
+NewConfigurationWizardPage_default_catalog=Default Catalog:
+NewConfigurationWizardPage_default_schema=Default Schema:
+NewConfigurationWizardPage_driver_class=&Driver class:
+NewConfigurationWizardPage_file_already_exist=File already exists
+NewConfigurationWizardPage_file_container_must_be_specified=File container must be specified
+NewConfigurationWizardPage_file_container_must_exist=File container must exist
+NewConfigurationWizardPage_file_extension_must_be_cfgxml=File extension must be "cfg.xml"
+NewConfigurationWizardPage_file_name=&File name:
+NewConfigurationWizardPage_file_name_must_be_specified=File name must be specified
+NewConfigurationWizardPage_file_name_must_be_valid=File name must be valid
+NewConfigurationWizardPage_hibernate_config_file=Hibernate Configuration File (cfg.xml)
+NewConfigurationWizardPage_password=&Password:
+NewConfigurationWizardPage_project_must_be_writable=Project must be writable
+NewConfigurationWizardPage_session_factory_name=&Session factory name:
+NewConfigurationWizardPage_this_wizard_creates=This wizard creates a new configuration file to use with Hibernate.
+NewConfigurationWizardPage_user_name=User&name:
+NewHibernateMappingFilePage_browse=Browse...
+NewHibernateMappingFilePage_class_to_map=Class to &map:
+NewHibernateMappingFilePage_container=&Container:
+NewHibernateMappingFilePage_file_container_must_be_specified=File container must be specified
+NewHibernateMappingFilePage_file_container_must_exist=File container must exist
+NewHibernateMappingFilePage_file_name=&File name:
+NewHibernateMappingFilePage_file_name_must_be_specified=File name must be specified
+NewHibernateMappingFilePage_file_name_must_be_valid=File name must be valid
+NewHibernateMappingFilePage_hibernate_xml_mapping_file=Hibernate XML Mapping file
+NewHibernateMappingFilePage_project_must_be_writable=Project must be writable
+NewHibernateMappingFilePage_select_class_to_map=Select class to map
+NewHibernateMappingFilePage_select_new_file_container=Select new file container
+NewHibernateMappingFilePage_the_class_will_be_used_when=The class will be used when generating the hbm.xml file
+NewHibernateMappingFilePage_this_wizard_creates=This wizard creates a new Hibernate XML Mapping file
+NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file=Create Hibernate XML Mapping file (hbm.xml)
+NewHibernateMappingFileWizard_create_new_xml_mapping_file=Create a new XML Mapping file.
+NewHibernateMappingFileWizard_creating=Creating
+NewHibernateMappingFileWizard_opening_file_for_editing=Opening file for editing...
+NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file=Create Hibernate Reverse Engineering file (reveng.xml)
+NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml=Create a new hibernate.reveng.xml.
+NewReverseEngineeringFileWizard_creating=Creating
+NewReverseEngineeringFileWizard_error=Error
+NewReverseEngineeringFileWizard_opening_file_for_editing=Opening file for editing...
+NewReverseEngineeringFileWizard_problems_converting_to_utf8=Problems converting to UTF-8
+TableFilterView_catalog=Catalog
+TableFilterView_do_you_want_to_remove_all_filters=Do you want to remove all filters ?
+TableFilterView_exclude=Exclude...
+TableFilterView_include=Include...
+TableFilterView_not_known_button=\ not a known button
+TableFilterView_remove_all_filters=Remove all filters
+TableFilterView_schema=Schema
+TableFilterView_sign=\!
+TableFilterView_table=Table
+TableFilterWizardPage_configure_table_filters=Configure Table filters
+TableFilterWizardPage_console_configuration=Console &configuration:
+TableFilterWizardPage_specify_which_catalog=Specify which catalog/schema/tables should be included or excluded from the reverse engineering.
+TableFilterWizardPage_table_filters_contains_duplicates=Table filters contains duplicates.
+TreeToTableComposite_database_schema=Database schema:
+TreeToTableComposite_down=Down
+TreeToTableComposite_exclude=Exclude...
+TreeToTableComposite_include=Include...
+TreeToTableComposite_incorrect_initial_value=incorrect initial value
+TreeToTableComposite_incorrect_state_count=incorrect state count
+TreeToTableComposite_invalid_value=invalid value
+TreeToTableComposite_refresh=Refresh
+TreeToTableComposite_remove=Remove
+TreeToTableComposite_remove_all=Remove All
+TreeToTableComposite_table_filters=Table filters:
+TreeToTableComposite_up=Up
+UpDownListComposite_add=Add...
+UpDownListComposite_down=Down
+UpDownListComposite_remove=Remove
+UpDownListComposite_test=\ test
+UpDownListComposite_up=Up
+
+BasicWorkbenchAdapter_error_while_expanding=Error while expanding
+BasicWorkbenchAdapter_hibernate_configuration_error=Hibernate Configuration error
+ConfigurationWorkbenchAdapter_configuration=Configuration
+ConsoleConfigurationWorkbenchAdapter_empty_configuration=<Empty Configuration>
+KnownConfigurationsWorkbenchAdapter_configurations=Configurations
+LazyDatabaseSchemaWorkbenchAdapter_database=Database
+LazyDatabaseSchemaWorkbenchAdapter_problem_while_reading_database_schema=Problem while reading database schema
+LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema=Problems while reading database schema
+LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error=<Reading schema error: {0} >
+LazyDatabaseSchemaWorkbenchAdapter_schema_not_available=<Schema not available>
+LazySessionFactoryAdapter_problems_while_creating_sessionfactory=Problems while creating sessionfactory
+LazySessionFactoryAdapter_session_factory=Session Factory
+LazySessionFactoryAdapter_sessionfactory_error=<Sessionfactory error: {0} >
+PrimaryKeyWorkbenchAdapter_composite_primary_key=Composite primary key
+TableContainerWorkbenchAdapter_default=<default>
+ValueWorkbenchAdapter_value=value
+
+AnyAdaptableLabelProvider_unknown=Unknown: {0} ({1})
+
+CriteriaEditorInput_criteria=Criteria:
+CriteriaEditorInput_none=<None>
+CriteriaEditorStorage_criteria=Criteria:
+CriteriaEditorStorage_none=<None>
+JavaCompletionProcessor_error=Error
+JavaCompletionProcessor_error_while_performing_code_completion=Error while performing code completion
+JavaCompletionProcessor_no_console_configuration_found=No console configuration found
+JavaCompletionProcessor_session_session=Session session;
+
+HibernateConfigurationPartFactory_not_known_by_factory=\ not known by factory
+
+ToggleLayoutAction_auto_layout=Automatic Layout
+ToggleLayoutAction_auto_layout_active=Automatic layout active
+ToggleLayoutAction_enable_auto_layout=Enable automatic layout
+ToggleLayoutAction_enable_manual_layout=Enable manual layout
+ToggleLayoutAction_manual_layout_active=Manual layout active
+
+AssociationViewAdapter_association_target_source=Association target: {0} source: {1}
+InheritanceViewAdapter_inheritance=Inheritance
+InheritanceViewAdapter_subclass_must_not_be_equal_to_superclass=subclass must not be equal to superclass
+InheritanceViewAdapter_subclass_must_not_null=subclass must not null
+InheritanceViewAdapter_superclass_must_not_null=superclass must not null
+
+CompletionHelper_could_not_complete_java_types=Could not complete java types
+CompletionHelper_error_unknown_completion_proposal_class=ERROR: unknown CompletionProposal class.
+HQLCompletionProcessor_could_not_get_document_contents=Could not get document contents
+HQLCompletionProcessor_error_while_performing_hql_completion=Error while performing HQL completion
+HQLCompletionProcessor_no_hql_completions_available=No HQL completions available.
+HQLCompletionProcessor_no_start_word_found=No start word found.
+HQLEditorInput_none=<None>
+HQLEditorStorage_none=<None>
+HQLTextHover_empty_selection=Empty Selection
+LoadConsoleCFGCompletionProposal_could_not_load_configuration=Could not load configuration
+LoadConsoleCFGCompletionProposal_load_console_cfg=Load Console Configuration
+LoadConsoleCFGCompletionProposal_no_open_console_cfg_found=No open console configuration found.\nThis will attempt to open the console configuration\nto enable better code completion.
+
+HQLEditorPreferencePage_colors_for_hql_editor_highlighting=Colors for HQL editor syntax highlighting
+HQLEditorPreferencePage_default=Default:
+HQLEditorPreferencePage_identifier=Identifier:
+HQLEditorPreferencePage_keyword=Keyword:
+HQLEditorPreferencePage_string_literal=String literal:
+
+AddPropertyDialog_add_exporter_property=Add exporter property
+AddPropertyDialog_add_property_to=Add property to
+AddPropertyDialog_name=Name:
+AddPropertyDialog_the_property_is_already_set=The property {0} is already set, pressing ok will overwrite the current value
+AddPropertyDialog_the_property_name_may_not_contain_whitespaces=The property name may not contain whitespaces
+AddPropertyDialog_the_property_name_must_be_chosen_or_entered=The property name must be chosen or entered
+AddPropertyDialog_the_property_value_must_be_non_empty=The property value must be non-empty
+AddPropertyDialog_value=Value:
+CodeGenerationLaunchDelegate_console_configuration_not_found_in=Console configuration {0} not found in {1}
+CodeGenerationLaunchDelegate_console_configuration_name_is_empty_in=Console configuration name is empty in
+CodeGenerationLaunchDelegate_could_not_create_or_find_with_default_noarg_constructor=Could not create or find {0} with default no-arg constructor
+CodeGenerationLaunchDelegate_could_not_create_or_find_with_one_argument_delegate_constructor=Could not create or find {0} with one argument delegate constructor
+CodeGenerationLaunchDelegate_error_while_running=Error while running
+CodeGenerationLaunchDelegate_error_while_setting_up=Error while setting up
+CodeGenerationLaunchDelegate_exception_during_java_format=exception during java format
+CodeGenerationLaunchDelegate_formate_generated_code=Formate generated code
+CodeGenerationLaunchDelegate_generating_code_for=Generating code for
+CodeGenerationLaunchDelegate_java_format_cancelled=java format cancelled
+CodeGenerationLaunchDelegate_output_has_to_be_specified_in=Output has to be specified in
+CodeGenerationLaunchDelegate_reading_jdbc_metadata=reading jdbc metadata
+CodeGenerationLaunchDelegate_received_noclassdeffounderror=Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class
+CodeGenerationSettingsTab_browse=&Browse...
+CodeGenerationSettingsTab_choose_dir_custom_templates=Choose directory containing custom templates
+CodeGenerationSettingsTab_choose_dir_for_generated_files=Choose directory in which the generated files will be stored
+CodeGenerationSettingsTab_choose_file_read_reverse_settings=Choose file from which settings for the reverse engineering will be read
+CodeGenerationSettingsTab_choose_reverse_engineering_strategy=Choose a reverse engineering strategy
+CodeGenerationSettingsTab_console_cfg_must_be_specified=Console configuration must be specified
+CodeGenerationSettingsTab_console_configuration=Console &configuration:
+CodeGenerationSettingsTab_create_new=Create &new...
+CodeGenerationSettingsTab_detect_many_to_many_tables=Detect many-to-many tables
+CodeGenerationSettingsTab_detect_optimistic_lock_columns=Detect optimistic lock columns
+CodeGenerationSettingsTab_do_you_want_create_reveng_xml=Do you want to create a new reveng.xml or use an existing file ?
+CodeGenerationSettingsTab_does_not_exist=\ does not exist
+CodeGenerationSettingsTab_filesystem=&Filesystem...
+CodeGenerationSettingsTab_generate_basic_typed_composite_ids=Generate basic typed composite ids
+CodeGenerationSettingsTab_main=Main
+CodeGenerationSettingsTab_must_be_file=\ must be a file
+CodeGenerationSettingsTab_output_dir=Output &directory:
+CodeGenerationSettingsTab_output_directory=Output directory
+CodeGenerationSettingsTab_package=&Package:
+CodeGenerationSettingsTab_problems_when_reading=Problem when reading hibernate tools launch configuration
+CodeGenerationSettingsTab_reveng_strategy=reveng. s&trategy:
+CodeGenerationSettingsTab_reveng_xml_1=reveng.xml
+CodeGenerationSettingsTab_reveng_xml_2=reveng.&xml:
+CodeGenerationSettingsTab_reveng_xml_3=reveng.xml
+CodeGenerationSettingsTab_reverse_engineer_from_jdbc_connection=Reverse engineer from JDBC Connection
+CodeGenerationSettingsTab_select_output_dir=Select output directory
+CodeGenerationSettingsTab_select_reverse_engineering_settings_file=Select reverse engineering settings file
+CodeGenerationSettingsTab_select_template_dir=Select template directory
+CodeGenerationSettingsTab_setup=&Setup...
+CodeGenerationSettingsTab_setup_reverse_engineering=Setup reverse engineering
+CodeGenerationSettingsTab_template_dir=template directory
+CodeGenerationSettingsTab_template_directory=Template &directory:
+CodeGenerationSettingsTab_use_custom_templates=Use custom templates (for custom file generation)
+CodeGenerationSettingsTab_use_existing=Use &existing...
+CodeGenerationSettingsTab_workspace=&Workspace...
+ConsoleConfigurationLaunchDelegate_direct_launch_not_supported=Direct launch not supported
+ConsoleConfigurationMainTab_annotations=Annotations (jdk 1.5+)
+ConsoleConfigurationMainTab_cfg_xml=cfg.xml
+ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_cfg_xml=Choose file to use as hibernate.cfg.xml
+ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_properties=Choose file to use as hibernate.properties
+ConsoleConfigurationMainTab_configuration_file=Configuration file:
+ConsoleConfigurationMainTab_configuration_file_2=Configuration file
+ConsoleConfigurationMainTab_core=Core
+ConsoleConfigurationMainTab_create_hibernate_properties_file=Create Hibernate Properties file (.properties)
+ConsoleConfigurationMainTab_create_new=Create &new...
+ConsoleConfigurationMainTab_create_new_properties_file=Create a new properties file
+ConsoleConfigurationMainTab_create_property_file=Create Property File
+ConsoleConfigurationMainTab_do_you_want_to_create_new_cfgxml=Do you want to create a new *.cfg.xml or use an existing one ?
+ConsoleConfigurationMainTab_do_you_want_to_create_new_property_file=Do you want to create a new property file or use an existing one ?
+ConsoleConfigurationMainTab_does_not_exist=\ does not exist
+ConsoleConfigurationMainTab_is_not_file=\ is not a file
+ConsoleConfigurationMainTab_java_project_to_determine_default_classpath=The (optional) java project is used to determine the default classpath
+ConsoleConfigurationMainTab_jpa=JPA (jdk 1.5+)
+ConsoleConfigurationMainTab_main=Main
+ConsoleConfigurationMainTab_path_for_project_must_have_only_one_segment=Path for project must have only one segment.
+ConsoleConfigurationMainTab_persistence_unit=Persistence unit:
+ConsoleConfigurationMainTab_project=Project:
+ConsoleConfigurationMainTab_properties=properties
+ConsoleConfigurationMainTab_property_file=Property file:
+ConsoleConfigurationMainTab_property_file_2=Property file
+ConsoleConfigurationMainTab_select_java_project=Select java project
+ConsoleConfigurationMainTab_select_propertyfile=Select property file
+ConsoleConfigurationMainTab_setup_configuration_file=Setup configuration file
+ConsoleConfigurationMainTab_setup_property_file=Setup property file
+ConsoleConfigurationMainTab_select_hibernate_cfg_xml_file=Select hibernate.cfg.xml file
+ConsoleConfigurationMainTab_the_java_project_does_not_exist=The Java project {0} does not exist.
+ConsoleConfigurationMainTab_type=Type:
+ConsoleConfigurationMainTab_use_existing=Use &existing...
+ConsoleConfigurationMainTab_wizard_page=wizardPage
+ConsoleConfigurationMappingsTab_add_hbm_xml_file=Add hbm.xml file
+ConsoleConfigurationMappingsTab_add_hibernate_mapping_file=Add a Hibernate Mapping file
+ConsoleConfigurationMappingsTab_additional_mapping_files=Additonal mapping files (not listed in cfg.xml)
+ConsoleConfigurationMappingsTab_mappings=Mappings
+ConsoleConfigurationOptionsTab_entity_resolver=Entity resolver:
+ConsoleConfigurationOptionsTab_naming_strategy=Naming strategy:
+ConsoleConfigurationOptionsTab_options=Options
+ConsoleConfigurationOptionsTab_select_entity_resolver_class=Select entity resolver class
+ConsoleConfigurationOptionsTab_select_naming_strategy_class=Select naming strategy class
+ConsoleConfigurationTab_browse=Browse...
+ConsoleConfigurationTab_create_new=Create New
+ConsoleConfigurationTab_setup=Setup...
+ConsoleConfigurationTabGroup_classpath_must_be_set_or_restored_to_default=Classpath must be set or restored to default
+DirectoryBrowseField_filesystem=Filesystem...
+DirectoryBrowseField_workspace=Workspace..
+ExporterAttributes_could_not_locate_exporter_for_in=Could not locate exporter for '{0}' in {1}
+ExporterSettingsTab_add=Add...
+ExporterSettingsTab_add_exporter=Add exporter
+ExporterSettingsTab_at_least_one_exporter_option_must_be_selected=At least one exporter option must be selected
+ExporterSettingsTab_console_configuration_must_be_specified=Console configuration must be specified
+ExporterSettingsTab_description=Description
+ExporterSettingsTab_deselect_all=Deselect all
+ExporterSettingsTab_does_not_exist=\ does not exist
+ExporterSettingsTab_exporters=Exporters:
+ExporterSettingsTab_exporters_2=Exporters
+ExporterSettingsTab_general_settings=General settings:
+ExporterSettingsTab_generate_ejb3annotations=Generate EJB3 annotations
+ExporterSettingsTab_has_to_be_folder_or_project=\ has to be a folder or project
+ExporterSettingsTab_must_be_file=\ must be a file
+ExporterSettingsTab_output_directory_for=Output directory for
+ExporterSettingsTab_problem_when_reading_hibernate_tools_launch_configuration=Problem when reading hibernate tools launch configuration
+ExporterSettingsTab_project_for_is_closed=Project for {0} is closed
+ExporterSettingsTab_properties=Properties:
+ExporterSettingsTab_remove=Remove...
+ExporterSettingsTab_select_all=Select all
+ExporterSettingsTab_select_exporter_you_want_to_add=Select the exporter(s) you want to add
+ExporterSettingsTab_template_directory_for=Template directory for
+ExporterSettingsTab_use_java5_syntax=Use Java 5 syntax
+GeneralExceptionStatusHandler_exception_while_generating_code=Exception while generating code
+GeneralExceptionStatusHandler_generating_code=Generating code
+PathHelper_does_not_exist={0} does not exist [{1}]
+PathHelper_has_invalid_variable_references={0} has invalid variable references [{1}]
+PathHelper_has_to_be_folder_or_project={0} has to be a folder or project [{1}]
+PathHelper_project_for_is_closed=Project for {0} is closed [{1}]
+
+HibernateRefactoringUtil_error_during_refactoring=Error during refactoring
+HibernateRefactoringUtil_error_occured_while_updating_classpath=Error occured while updating classpath.
+LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg=Update resource path in launch configuration
+MoveResourceParticipant_launch_configurations_updates=Launch Configurations updates
+RenameResourceParticipant_launch_configurations_updates=Launch Configurations updates
+
+HibernateNature_error_while_performing_background_reading_of_database_schema=Error while performing background reading of database schema
+HibernateNature_exception_when_trying_to_locate_hibernate_nature=Exception when trying to locate Hibernate Nature
+HibernateNature_reading_database_metadata=Reading database metadata
+HibernateNature_reading_database_metadata_for=Reading database metadata for
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePerspectiveFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePerspectiveFactory.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePerspectiveFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -34,16 +34,16 @@
*/
public class HibernateConsolePerspectiveFactory implements IPerspectiveFactory {
- static public final String ID_CONSOLE_PERSPECTIVE = "org.hibernate.eclipse.console.HibernateConsolePerspective";
+ static public final String ID_CONSOLE_PERSPECTIVE = "org.hibernate.eclipse.console.HibernateConsolePerspective"; //$NON-NLS-1$
// Folders
- private static final String ID_CONFIGURATION_VIEW = "org.hibernate.eclipse.console.views.KnownConfigurationsView";
- private static final String ID_QUERYRESULTS_VIEW = "org.hibernate.eclipse.console.views.QueryPageTabView";
- private static final String ID_PROPERTY_SHEET_VIEW = "org.eclipse.ui.views.PropertySheet";
- private static final String ID_DYNAMIC_QUERY_TRANSLATOR_VIEW = "org.hibernate.eclipse.console.views.DynamicSQLPreviewView";
+ private static final String ID_CONFIGURATION_VIEW = "org.hibernate.eclipse.console.views.KnownConfigurationsView"; //$NON-NLS-1$
+ private static final String ID_QUERYRESULTS_VIEW = "org.hibernate.eclipse.console.views.QueryPageTabView"; //$NON-NLS-1$
+ private static final String ID_PROPERTY_SHEET_VIEW = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
+ private static final String ID_DYNAMIC_QUERY_TRANSLATOR_VIEW = "org.hibernate.eclipse.console.views.DynamicSQLPreviewView"; //$NON-NLS-1$
//private static final String ID_ENTITY_MODEL_VIEW = "org.hibernate.eclipse.graph.EntityGraphView";
- private static final String ID_CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView"; //TODO: could not find constant for it in eclipse
+ private static final String ID_CONSOLE_VIEW = "org.eclipse.ui.console.ConsoleView"; //TODO: could not find constant for it in eclipse //$NON-NLS-1$
- private static final String ID_QUERY_PARAMETERS = "org.hibernate.eclipse.console.views.QueryParametersView";
+ private static final String ID_QUERY_PARAMETERS = "org.hibernate.eclipse.console.views.QueryParametersView"; //$NON-NLS-1$
/* (non-Javadoc)
@@ -57,20 +57,20 @@
folder.addView(JavaUI.ID_PACKAGES);
folder.addPlaceholder(IPageLayout.ID_RES_NAV);
- IFolderLayout propertiesFolder= layout.createFolder("leftBottom", IPageLayout.BOTTOM, (float)0.75, "left"); //$NON-NLS-1$
+ IFolderLayout propertiesFolder= layout.createFolder("leftBottom", IPageLayout.BOTTOM, (float)0.75, "left"); //$NON-NLS-1$ //$NON-NLS-2$
propertiesFolder.addView(ID_PROPERTY_SHEET_VIEW);
layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$
- outputfolder.addView("org.eclipse.pde.runtime.LogView");
+ outputfolder.addView("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$
outputfolder.addView(ID_QUERYRESULTS_VIEW);
outputfolder.addView(ID_DYNAMIC_QUERY_TRANSLATOR_VIEW);
//outputfolder.addView(ID_ENTITY_MODEL_VIEW);
outputfolder.addView(ID_CONSOLE_VIEW);
outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
- IFolderLayout outlines = layout.createFolder("outlines", IPageLayout.RIGHT, 0.75f, editorArea);
+ IFolderLayout outlines = layout.createFolder("outlines", IPageLayout.RIGHT, 0.75f, editorArea); //$NON-NLS-1$
outlines.addView(ID_QUERY_PARAMETERS);
outlines.addView(IPageLayout.ID_OUTLINE);
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsolePlugin.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -76,13 +76,13 @@
* The main plugin class to be used in the desktop.
*/
public class HibernateConsolePlugin extends AbstractUIPlugin implements PluginLogger {
-
- public static final String ID = "org.hibernate.eclipse.console";
-
- static public final String LAST_USED_CONFIGURATION_PREFERENCE = "lastusedconfig";
+ public static final String ID = "org.hibernate.eclipse.console"; //$NON-NLS-1$
+
+ static public final String LAST_USED_CONFIGURATION_PREFERENCE = "lastusedconfig"; //$NON-NLS-1$
+
public static final int PERFORM_SYNC_EXEC = 1;
-
+
//The shared instance.
private static HibernateConsolePlugin plugin;
//Resource bundle.
@@ -93,7 +93,7 @@
private ILaunchConfigurationListener icl;
private KnownConfigurationsListener kcl;
-
+
/**
* The constructor.
*/
@@ -102,8 +102,8 @@
plugin = this;
}
-
-
+
+
/**
* This method is called upon plug-in activation
*/
@@ -112,56 +112,56 @@
logger=new EclipseLogger(context.getBundle());
//HibernateConsoleSaveParticipant participant = new HibernateConsoleSaveParticipant();
//participant.doStart(this);
-
+
IAdapterManager adapterManager = Platform.getAdapterManager();
ConfigurationAdapterFactory fact = new ConfigurationAdapterFactory();
fact.registerAdapters(adapterManager);
-
+
loadExistingConfigurations();
-
- listenForConfigurations();
-
+
+ listenForConfigurations();
+
}
private void listenForConfigurations() {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
+
kcl = new KnownConfigurationsListener() {
-
+
public void sessionFactoryClosing(ConsoleConfiguration configuration,
SessionFactory closingFactory) {
// TODO Auto-generated method stub
-
+
}
-
+
public void sessionFactoryBuilt(ConsoleConfiguration ccfg,
SessionFactory builtFactory) {
// TODO Auto-generated method stub
-
+
}
-
+
public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
try {
removeConfiguration(root.getName());
} catch (CoreException e) {
if(!forUpdate) {
- logErrorMessage("Could not delete launch configuration for: " + root.getName(), e);
+ logErrorMessage(HibernateConsoleMessages.HibernateConsolePlugin_could_not_delete_launch_config_for + root.getName(), e);
}
}
-
+
}
-
+
public void configurationAdded(ConsoleConfiguration root) {
// TODO Auto-generated method stub
-
+
}
-
+
};
-
+
KnownConfigurations.getInstance().addConsoleConfigurationListener(kcl);
-
+
icl = new ILaunchConfigurationListener() {
-
+
boolean isConsoleConfiguration(ILaunchConfiguration configuration) {
try {
return configuration.getType().getIdentifier().equals(ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID);
@@ -172,14 +172,14 @@
}
return false;
}
-
- public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
+
+ public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
ConsoleConfiguration cfg = KnownConfigurations.getInstance().find( configuration.getName() );
if(cfg!=null) {
KnownConfigurations.getInstance().removeConfiguration( cfg, false );
}
}
-
+
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
if(configuration.isWorkingCopy() || isTemporary(configuration)) {
return;
@@ -188,21 +188,21 @@
KnownConfigurations instance = KnownConfigurations.getInstance();
ConsoleConfiguration oldcfg = instance.find( configuration.getName() );
if(oldcfg!=null) {
- oldcfg.reset(); // reset it no matter what.
+ oldcfg.reset(); // reset it no matter what.
} else { // A new one!
ConsoleConfigurationPreferences adapter = buildConfigurationPreferences(configuration);
instance.addConfiguration(new ConsoleConfiguration(adapter), true);
}
}
}
-
+
private ConsoleConfigurationPreferences buildConfigurationPreferences(ILaunchConfiguration configuration) {
return new EclipseLaunchConsoleConfigurationPreferences(configuration);
}
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
if(isConsoleConfiguration( configuration )) {
-
+
ILaunchConfiguration movedFrom = launchManager.getMovedFrom( configuration );
if(movedFrom!=null && isConsoleConfiguration( movedFrom )) {
KnownConfigurations instance = KnownConfigurations.getInstance();
@@ -210,17 +210,17 @@
if(oldcfg!=null) {
oldcfg.reset(); // reset it no matter what.
instance.removeConfiguration(oldcfg, false);
- }
+ }
}
-
+
KnownConfigurations instance = KnownConfigurations.getInstance();
ConsoleConfigurationPreferences adapter = buildConfigurationPreferences(configuration);
- boolean temporary = isTemporary(configuration);
-
+ boolean temporary = isTemporary(configuration);
+
if(!temporary) {
instance.addConfiguration(new ConsoleConfiguration(adapter), true);
}
-
+
}
}
@@ -229,14 +229,14 @@
try {
temporary = configuration.getAttribute(AddConfigurationAction.TEMPORARY_CONFIG_FLAG, false);
} catch (CoreException e) {
- HibernateConsolePlugin.getDefault().showError( getShell(), "Problem to get flag", e);
+ HibernateConsolePlugin.getDefault().showError( getShell(), HibernateConsoleMessages.HibernateConsolePlugin_problem_to_get_flag, e);
}
return temporary;
- }
+ }
};
launchManager.addLaunchConfigurationListener( icl );
-
-
+
+
}
private void stopListeningForConfigurations() {
@@ -245,20 +245,20 @@
KnownConfigurations.getInstance().removeConfigurationListener(kcl);
}
-
+
private void loadExistingConfigurations() throws CoreException {
final ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
-
+
ILaunchConfigurationType lct = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( lct );
for (int i = 0; i < launchConfigurations.length; i++) {
- KnownConfigurations.getInstance().addConfiguration(
+ KnownConfigurations.getInstance().addConfiguration(
new ConsoleConfiguration(new EclipseLaunchConsoleConfigurationPreferences(launchConfigurations[i])), false );
- }
+ }
}
-
+
private void removeConfiguration(String name) throws CoreException {
ILaunchConfiguration findLaunchConfig = findLaunchConfig(name);
if (findLaunchConfig != null) {
@@ -297,9 +297,9 @@
resourceBundle = null;
}
-
+
/**
* Returns the shared instance.
*/
@@ -326,41 +326,41 @@
public ResourceBundle getResourceBundle() {
try {
if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.hibernate.eclipse.console.HibernateConsolePluginResources");
+ resourceBundle = ResourceBundle.getBundle("org.hibernate.eclipse.console.HibernateConsolePluginResources"); //$NON-NLS-1$
} catch (MissingResourceException x) {
resourceBundle = null;
}
return resourceBundle;
}
-
+
/**
* Logs the specified status with this plug-in's log.
- *
+ *
* @param status status to log
*/
public void log(IStatus status) {
logger.log(status);
}
-
-
+
+
/**
* Logs an internal info with the specified message.
- *
+ *
* @param message the error message to log
*/
public void log(String message) {
log(new Status(IStatus.INFO, HibernateConsolePlugin.ID, 0, message, null) );
}
-
+
/**
* Logs an internal error with the specified message.
- *
+ *
* @param message the error message to log
*/
public void logErrorMessage(String message, Throwable t) {
logMessage(IStatus.ERROR, message, t);
}
-
+
public void logMessage(int lvl, String message, Throwable t) {
if(t==null) {
log(message);
@@ -368,47 +368,47 @@
log(new MultiStatus(HibernateConsolePlugin.ID, lvl , new IStatus[] { throwableToStatus(t) }, message, null));
}
}
-
+
public static IStatus throwableToStatus(Throwable t, int code) {
List causes = new ArrayList();
Throwable temp = t;
while(temp!=null && temp.getCause()!=temp) {
- causes.add(new Status(IStatus.ERROR, ID, code, temp.getMessage()==null?temp.toString() + ": <no message>":temp.toString(), temp) );
+ causes.add(new Status(IStatus.ERROR, ID, code, temp.getMessage()==null?temp.toString() + HibernateConsoleMessages.HibernateConsolePlugin_no_message_1:temp.toString(), temp) );
temp = temp.getCause();
}
- String msg = "<No message>";
+ String msg = HibernateConsoleMessages.HibernateConsolePlugin_no_message_2;
if(t!=null && t.getMessage()!=null) {
msg = t.toString();
}
-
+
if(causes.isEmpty()) {
return new Status(IStatus.ERROR, ID, code, msg, t);
} else {
return new MultiStatus(ID, code,(IStatus[]) causes.toArray(new IStatus[causes.size()]), msg, t);
}
-
+
}
-
- public static IStatus throwableToStatus(Throwable t) {
+
+ public static IStatus throwableToStatus(Throwable t) {
return throwableToStatus(t, 150);
}
-
+
public void logErrorMessage(String message, Throwable t[]) {
IStatus[] children = new IStatus[t.length];
for (int i = 0; i < t.length; i++) {
Throwable throwable = t[i];
children[i] = throwableToStatus(throwable);
}
-
+
IStatus s = new MultiStatus(ID, 150,children, message, null);
log(s);
}
/**
* Logs an internal error with the specified throwable
- *
+ *
* @param e the exception to be logged
- */
+ */
public void log(Throwable e) {
log(new Status(IStatus.ERROR, ID, 150, "Hibernate Console Internal Error", e) ); //$NON-NLS-1$
}
@@ -416,83 +416,83 @@
void readStateFrom(File f) {
try {
EclipseConsoleConfigurationPreferences[] preferences = EclipseConsoleConfigurationPreferences.readStateFrom(f);
-
+
for (int i = 0; i < preferences.length; i++) {
ConsoleConfigurationPreferences prefs = preferences[i];
KnownConfigurations.getInstance().addConfiguration(new EclipseConsoleConfiguration(prefs), false); // TODO: do we need to broadcast every time when reading state ?
}
} catch(HibernateConsoleRuntimeException hcr) {
- logErrorMessage("Error while reading console configuration", hcr);
- }
+ logErrorMessage(HibernateConsoleMessages.HibernateConsolePlugin_error_while_reading_console_config, hcr);
+ }
}
-
+
void writeStateTo(File f) {
//System.out.println("write state to" + f);
KnownConfigurations.getInstance().writeStateTo(f);
}
/**
- *
+ *
*/
public void showError(Shell shell, String message, Throwable he) {
logErrorMessage(message, he);
IStatus warning = throwableToStatus(he);
- ErrorDialog.openError(shell,
- "Hibernate Console", message, warning);
+ ErrorDialog.openError(shell,
+ HibernateConsoleMessages.HibernateConsolePlugin_hibernate_console, message, warning);
}
-
+
public void showError(Shell shell, String message, IStatus s) {
log(s);
- ErrorDialog.openError(shell,
- "Hibernate Console", message, s);
+ ErrorDialog.openError(shell,
+ HibernateConsoleMessages.HibernateConsolePlugin_hibernate_console, message, s);
}
public IEditorPart openCriteriaEditor(String consoleName, String criteria) {
try {
IWorkbenchPage page = getActiveWorkbenchWindow().getActivePage();
-
-
- CriteriaEditorStorage storage = new CriteriaEditorStorage(consoleName, criteria==null?"":criteria);
-
+
+
+ CriteriaEditorStorage storage = new CriteriaEditorStorage(consoleName, criteria==null?"":criteria); //$NON-NLS-1$
+
final CriteriaEditorInput editorInput = new CriteriaEditorInput(storage);
- return page.openEditor(editorInput, "org.hibernate.eclipse.criteriaeditor.CriteriaEditor", true);
+ return page.openEditor(editorInput, "org.hibernate.eclipse.criteriaeditor.CriteriaEditor", true); //$NON-NLS-1$
//page.openEditor(editorInput, "org.eclipse.jdt.ui.CompilationUnitEditor", true);
} catch (PartInitException ex) {
- logErrorMessage("Could not open Criteria editor for console:" + consoleName, ex);
+ logErrorMessage(HibernateConsoleMessages.HibernateConsolePlugin_could_not_open_criteria_editor_for_console + consoleName, ex);
return null;
}
}
-
+
public IEditorPart openScratchHQLEditor(String consoleName, String hql) {
try {
- IWorkbenchPage page = getActiveWorkbenchWindow().getActivePage();
-
- HQLEditorStorage storage = new HQLEditorStorage(consoleName, hql==null?"":hql);
-
+ IWorkbenchPage page = getActiveWorkbenchWindow().getActivePage();
+
+ HQLEditorStorage storage = new HQLEditorStorage(consoleName, hql==null?"":hql); //$NON-NLS-1$
+
final HQLEditorInput editorInput = new HQLEditorInput(storage);
- return page.openEditor(editorInput, "org.hibernate.eclipse.hqleditor.HQLEditor", true);
+ return page.openEditor(editorInput, "org.hibernate.eclipse.hqleditor.HQLEditor", true); //$NON-NLS-1$
} catch (PartInitException ex) {
- logErrorMessage("Could not open HQL editor for console:" + consoleName, ex);
+ logErrorMessage(HibernateConsoleMessages.HibernateConsolePlugin_could_not_open_hql_editor_for_console + consoleName, ex);
return null;
}
}
/*public ConsoleConfiguration getLastUsedConfiguration() {
String lastUsedName = getDefault().getPreferenceStore().getString(HibernateConsolePlugin.LAST_USED_CONFIGURATION_PREFERENCE);
-
- ConsoleConfiguration lastUsed = (lastUsedName == null || lastUsedName.trim().length()==0)
- ? null
+
+ ConsoleConfiguration lastUsed = (lastUsedName == null || lastUsedName.trim().length()==0)
+ ? null
: KnownConfigurations.getInstance().find(lastUsedName);
-
+
if(lastUsed==null && KnownConfigurations.getInstance().getConfigurations().length==1) {
lastUsed = KnownConfigurations.getInstance().getConfigurations()[0];
}
-
+
return lastUsed;
}*/
-
+
/*public void setLastUsedConfiguration(ConsoleConfiguration lastUsed) {
String name;
if(lastUsed==null) {
@@ -500,13 +500,13 @@
} else {
name = lastUsed.getName();
}
-
+
HibernateConsolePlugin.getDefault().getPreferenceStore().setValue(
LAST_USED_CONFIGURATION_PREFERENCE, name );
}*/
-
+
/**
- * Convenience method for showing an error dialog
+ * Convenience method for showing an error dialog
* @param shell a valid shell or null
* @param exception the exception to be report
* @param title the title to be displayed
@@ -523,10 +523,10 @@
}
if (target instanceof Error) {
throw (Error)target;
- }
+ }
return openError(providedShell, title, message, target, flags);
}
-
+
// Determine the status to be displayed (and possibly logged)
IStatus status = null;
if (exception instanceof CoreException) {
@@ -534,16 +534,16 @@
} else if (exception != null) {
status = new MultiStatus(ID, IStatus.ERROR, new IStatus[] { throwableToStatus(exception.getCause())}, exception.toString(), exception); //$NON-NLS-1$
}
-
+
// Check for multi-status with only one child
/*if (status.isMultiStatus() && status.getChildren().length == 1) {
status = status.getChildren()[0]; // makes Status.ERROR - Status.OK
}*/
-
+
if (status.isOK()) {
return status;
}
-
+
// Create a runnable that will display the error status
final String displayTitle = title;
final String displayMessage = message;
@@ -558,16 +558,16 @@
}
};
openDialog(providedShell, openable, flags);
-
+
// return the status we display
return status;
}
-
+
/**
- * Open the dialog code provided in the IOpenableInShell, ensuring that
+ * Open the dialog code provided in the IOpenableInShell, ensuring that
* the provided whll is valid. This method will provide a shell to the
* IOpenableInShell if one is not provided to the method.
- *
+ *
* @param providedShell
* @param openable
* @param flags
@@ -582,7 +582,7 @@
flags = flags | PERFORM_SYNC_EXEC;
}
}
-
+
// Create a runnable that will display the error status
final Shell shell = providedShell;
Runnable outerRunnable = new Runnable() {
@@ -600,7 +600,7 @@
}
}
};
-
+
// Execute the above runnable as determined by the parameters
if (shell == null || (flags & PERFORM_SYNC_EXEC) > 0) {
Display display;
@@ -625,14 +625,14 @@
public interface IOpenableInShell {
public void open(Shell shell);
}
-
+
public static Shell getShell() {
if (getActiveWorkbenchWindow() != null) {
return getActiveWorkbenchWindow().getShell();
}
return null;
}
-
+
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
}
@@ -649,12 +649,12 @@
} else {
document.setDocumentPartitioner(partitioner);
partitioner.connect(document);
- }
-
+ }
+
}
};
}
-
+
return javaTextTools;
}
@@ -663,9 +663,9 @@
}
public void logWarning(HibernateException he) {
- logMessage(IStatus.WARNING, he==null?null:he.getMessage(), he);
+ logMessage(IStatus.WARNING, he==null?null:he.getMessage(), he);
}
-
-
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleSaveParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleSaveParticipant.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleSaveParticipant.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -37,7 +37,7 @@
*/
public class HibernateConsoleSaveParticipant implements ISaveParticipant {
- static final String SAVENAME = "hibernate-console.xml";
+ static final String SAVENAME = "hibernate-console.xml"; //$NON-NLS-1$
public void prepareToSave(ISaveContext context) throws CoreException {
@@ -50,7 +50,7 @@
case ISaveContext.SNAPSHOT:
// save the plug-in state
int saveNumber = context.getSaveNumber();
- String saveFileName = SAVENAME + "-" + Integer.toString(saveNumber);
+ String saveFileName = SAVENAME + "-" + Integer.toString(saveNumber); //$NON-NLS-1$
File f = HibernateConsolePlugin
.getDefault().getStateLocation().append(saveFileName)
.toFile();
@@ -81,7 +81,7 @@
// delete the old saved state since it is not necessary anymore
int previousSaveNumber = context.getPreviousSaveNumber();
- String oldFileName = SAVENAME + "-" + Integer.toString(previousSaveNumber);
+ String oldFileName = SAVENAME + "-" + Integer.toString(previousSaveNumber); //$NON-NLS-1$
File f = myPluginInstance.getStateLocation().append(oldFileName)
.toFile();
//System.out.println("delete " + f);
@@ -95,7 +95,7 @@
// since the save operation has failed, delete the saved state we have
// just written
int saveNumber = context.getSaveNumber();
- String saveFileName = SAVENAME + "-" + Integer.toString(saveNumber);
+ String saveFileName = SAVENAME + "-" + Integer.toString(saveNumber); //$NON-NLS-1$
File f = myPluginInstance.getStateLocation().append(saveFileName)
.toFile();
f.delete();
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/Messages.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/Messages.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.hibernate.eclipse.console;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages {
- public static final String BUNDLE_NAME = "org.hibernate.eclipse.console.messages"; //$NON-NLS-1$
-
-
- public static String popup_copy_text;
- public static String popup_paste_text;
- public static String popup_select_all;
- public static String find_replace_action_label;
- public static String find_replace_action_tooltip;
- public static String find_replace_action_image;
- public static String find_replace_action_description;
- public static String GenerateSeamEntities_dialog_title;
- public static String GenerateSeamEntities_dialog_message;
-
- private Messages() {
- // noop
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/QueryEditorStorage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -17,7 +17,7 @@
private String configurationName;
public QueryEditorStorage( String source ) {
- this( "", source, source );
+ this( "", source, source ); //$NON-NLS-1$
}
public QueryEditorStorage( String configurationName, String name, String source ) {
@@ -44,7 +44,7 @@
* @return contents as a string
*/
public String getContentsString() {
- String contentsString = "";
+ String contentsString = ""; //$NON-NLS-1$
InputStream contentsStream = getContents();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,7 +23,6 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
@@ -34,20 +33,15 @@
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
-import org.hibernate.eclipse.console.utils.LaunchHelper;
-import org.hibernate.eclipse.console.views.KnownConfigurationsView;
-import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
/**
- *
+ *
* Action that creates a ConsoleConfiguration
* @author max
*
@@ -56,38 +50,38 @@
/** Constant used to avoid unnecessary broadcast which is caused by the workaround for having the ClassPathTab not throwing
* and exception on unsaved configurations */
- public static final String TEMPORARY_CONFIG_FLAG = "_TEMPORARY_CONFIG_";
-
+ public static final String TEMPORARY_CONFIG_FLAG = "_TEMPORARY_CONFIG_"; //$NON-NLS-1$
+
private final IViewPart part;
public AddConfigurationAction(IViewPart part) {
this.part = part;
- setText("Add Configuration...");
+ setText(HibernateConsoleMessages.AddConfigurationAction_add_config);
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.ADD) );
}
public void run() {
doAddConfiguration();
}
-
+
protected void doAddConfiguration() {
/*ConsoleConfigurationCreationWizard wizard = new ConsoleConfigurationCreationWizard();
wizard.init(PlatformUI.getWorkbench(), null); // initializes the wizard
WizardDialog dialog = new WizardDialog(part.getSite().getShell(), wizard);
dialog.open(); // This opens a dialog
*/
-
+
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
- String launchName = launchManager.generateUniqueLaunchConfigurationNameFrom("hibernate");
+ String launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(HibernateConsoleMessages.AddConfigurationAction_hibernate);
//ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( launchConfigurationType );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null, launchName);
- wc.setAttribute(TEMPORARY_CONFIG_FLAG, true);
- ILaunchConfiguration saved = wc.doSave();
- int res = DebugUITools.openLaunchConfigurationPropertiesDialog( part.getSite().getShell(), saved, "org.eclipse.debug.ui.launchGroup.run" );
- List<ILaunchConfiguration> listTempConfigs = new ArrayList<ILaunchConfiguration>();
+ wc.setAttribute(TEMPORARY_CONFIG_FLAG, true);
+ ILaunchConfiguration saved = wc.doSave();
+ int res = DebugUITools.openLaunchConfigurationPropertiesDialog( part.getSite().getShell(), saved, "org.eclipse.debug.ui.launchGroup.run" ); //$NON-NLS-1$
+ List<ILaunchConfiguration> listTempConfigs = new ArrayList<ILaunchConfiguration>();
ILaunchConfiguration[] configs = launchManager.getLaunchConfigurations(launchConfigurationType);
for (int i = 0; i < configs.length; i++) {
boolean temporary = configs[i].getAttribute(AddConfigurationAction.TEMPORARY_CONFIG_FLAG, false);
@@ -106,11 +100,11 @@
wc.doSave();
}
}
-
+
} catch (CoreException ce) {
- HibernateConsolePlugin.getDefault().showError( part.getSite().getShell(), "Problem adding a console configuration", ce);
+ HibernateConsolePlugin.getDefault().showError( part.getSite().getShell(), HibernateConsoleMessages.AddConfigurationAction_problem_add_console_config, ce);
}
-
+
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/BuildSessionFactoryAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -26,6 +26,7 @@
import org.eclipse.jface.viewers.StructuredViewer;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
@@ -37,11 +38,11 @@
private final StructuredViewer viewer;
public BuildSessionFactoryAction(StructuredViewer viewer) {
- super("Build SessionFactory");
+ super(HibernateConsoleMessages.BuildSessionFactoryAction_build_session_factory);
this.viewer = viewer;
setEnabledWhenNoSessionFactory(true);
}
-
+
protected void doRun() {
for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
@@ -49,18 +50,18 @@
if(node instanceof ConsoleConfiguration) {
ConsoleConfiguration config = (ConsoleConfiguration) node;
if(config.isSessionFactoryCreated() ) {
- config.reset();
+ config.reset();
} else {
config.build();
config.buildSessionFactory();
}
updateState(config);
}
-
+
} catch(HibernateConsoleRuntimeException he) {
- HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(), "Exception while connecting/starting Hibernate",he);
+ HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(), HibernateConsoleMessages.BuildSessionFactoryAction_exception_while_start_hibernate,he);
} catch(UnsupportedClassVersionError ucve) {
- HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(), "Starting Hibernate resulted in a UnsupportedClassVersionError.\nThis can occur if you are running eclipse with JDK 1.4 and your domain classes require JDK 1.5. \n\nResolution: Run eclipse with JDK 1.5.",ucve);
+ HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(), HibernateConsoleMessages.BuildSessionFactoryAction_start_hibernate_resulted,ucve);
}
}
}
@@ -71,9 +72,9 @@
protected boolean updateState(ConsoleConfiguration config) {
setEnabledWhenNoSessionFactory(!config.isSessionFactoryCreated() );
if(enabledWhenNoSessionFactory) {
- setText("Create SessionFactory");
+ setText(HibernateConsoleMessages.BuildSessionFactoryAction_create_sessionfactory);
} else {
- setText("Close SessionFactory");
+ setText(HibernateConsoleMessages.BuildSessionFactoryAction_close_sessionfactory);
}
return super.updateState(config);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -28,31 +28,32 @@
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
/**
* Clears the output in a text viewer.
- *
+ *
*/
public class ClearAction extends Action {
private ITextViewer fViewer;
-
+
/**
* Constructs an action to clear the document associated with a text viewer.
- *
- * @param viewer viewer whose document this action is associated with
+ *
+ * @param viewer viewer whose document this action is associated with
*/
public ClearAction(ITextViewer viewer) {
fViewer = viewer;
-
- //setToolTipText(ConsoleMessages.ClearOutputAction_toolTipText); //$NON-NLS-1$
+
+ //setToolTipText(HibernateConsoleMessages.ClearOutputAction_toolTipText); //$NON-NLS-1$
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLEAR) );
- setToolTipText("Clear editor");
- //setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_LCL_CLEAR));
+ setToolTipText(HibernateConsoleMessages.ClearAction_clear_editor);
+ //setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_LCL_CLEAR));
//setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_CLEAR));
//setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLEAR));
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CLEAR_CONSOLE_ACTION);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CLEAR_CONSOLE_ACTION);
}
/* (non-Javadoc)
@@ -69,7 +70,7 @@
}
});
}
-
+
/**
* Returns the standard display to be used. The method first checks, if
* the thread calling this method has an associated display. If so, this
@@ -80,6 +81,6 @@
if (display == null) {
display= Display.getDefault();
}
- return display;
+ return display;
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearHQLEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearHQLEditorAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ClearHQLEditorAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -59,7 +59,7 @@
public void run(IAction action) {
IDocument document = getDocument();
if(document!=null) {
- document.set("");
+ document.set(""); //$NON-NLS-1$
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseQueryPageAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseQueryPageAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CloseQueryPageAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -29,6 +29,7 @@
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.QueryPage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
/**
@@ -38,24 +39,24 @@
public class CloseQueryPageAction extends SelectionListenerAction {
private final ISelectionProvider selectionProvider;
-
+
/**
* @param text
*/
public CloseQueryPageAction(ISelectionProvider selectionProvider) {
- super("");
+ super(""); //$NON-NLS-1$
this.selectionProvider = selectionProvider;
this.selectionProvider.addSelectionChangedListener(this);
setEnabled(!this.selectionProvider.getSelection().isEmpty() );
-
+
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE) );
setDisabledImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CLOSE_DISABLED) );
-
- setToolTipText("Close query page");
+
+ setToolTipText(HibernateConsoleMessages.CloseQueryPageAction_close_query_page);
}
public void run() {
- IStructuredSelection selection =
+ IStructuredSelection selection =
(IStructuredSelection) this.selectionProvider.getSelection();
if (!selection.isEmpty() ) {
for (Iterator i = selection.iterator(); i.hasNext(); ) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigurationBasedAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigurationBasedAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ConsoleConfigurationBasedAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,9 +24,11 @@
import java.util.Iterator;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
@@ -42,14 +44,14 @@
boolean enabledWhenNoSessionFactory) {
this.enabledWhenNoSessionFactory = enabledWhenNoSessionFactory;
}
-
+
/**
* @param supportMultiple The supportMultiple to set.
*/
public void setSupportMultiple(boolean supportMultiple) {
this.supportMultiple = supportMultiple;
}
-
+
/**
* @param text
*/
@@ -58,19 +60,20 @@
}
final public void run() {
-
+
try {
doRun();
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(null, "Problem while executing " + getText() + "(" + he + ")", he);
- }
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationBasedAction_problem_while_executing, getText(), he);
+ HibernateConsolePlugin.getDefault().showError(null, out, he);
+ }
}
-
+
abstract protected void doRun();
final protected boolean updateSelection(IStructuredSelection selection) {
boolean enabled = false;
- if(!supportMultiple && selection.size()>1) return false;
+ if(!supportMultiple && selection.size()>1) return false;
for (Iterator i = selection.iterator();
i.hasNext();
) {
@@ -78,7 +81,7 @@
if (object instanceof ConsoleConfiguration) {
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration) object;
enabled |= updateState(consoleConfiguration);
-
+
} else {
enabled = false;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,6 +25,7 @@
import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.mapping.PersistentClass;
@@ -32,34 +33,34 @@
public class CriteriaEditorAction extends OpenQueryEditorAction {
public CriteriaEditorAction() {
- super( "Hibernate Criteria Editor" );
+ super( HibernateConsoleMessages.CriteriaEditorAction_hibernate_criteria_editor );
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.CRITERIA_EDITOR));
- setToolTipText("Open Hibernate Criteria Editor");
- setEnabled( true );
+ setToolTipText(HibernateConsoleMessages.CriteriaEditorAction_open_hibernate_criteria_editor);
+ setEnabled( true );
}
protected void openQueryEditor(ConsoleConfiguration config, String query) {
HibernateConsolePlugin.getDefault().openCriteriaEditor( config==null?null:config.getName(), query );
}
-
+
/* (non-Javadoc)
* @see org.hibernate.eclipse.console.actions.OpenQueryEditorAction#generateQuery(org.eclipse.jface.viewers.TreePath)
*/
protected String generateQuery(TreePath path) {
- final String criteria = ".createCriteria({0})";
- final String alias = "\n.createCriteria(\"{0}\", \"{1}\")";
- final String projection = "\n.setProjection( Property.forName(\"{0}\").as(\"{0}\"))";
- final String sess = "session";
- String enCriteria = "";
- String propCriteria = "";
- String enName = "";
- Object node = path.getLastSegment();
+ final String criteria = ".createCriteria({0})"; //$NON-NLS-1$
+ final String alias = "\n.createCriteria(\"{0}\", \"{1}\")"; //$NON-NLS-1$
+ final String projection = "\n.setProjection( Property.forName(\"{0}\").as(\"{0}\"))"; //$NON-NLS-1$
+ final String sess = "session"; //$NON-NLS-1$
+ String enCriteria = ""; //$NON-NLS-1$
+ String propCriteria = ""; //$NON-NLS-1$
+ String enName = ""; //$NON-NLS-1$
+ Object node = path.getLastSegment();
if (node instanceof PersistentClass){
enName = ((PersistentClass)node).getEntityName();
enName = enName.substring(enName.lastIndexOf('.') + 1);
} else if (node instanceof Property){
- Property prop = (Property)node;
- String prName = prop.getName();
+ Property prop = (Property)node;
+ String prName = prop.getName();
PersistentClass pClass = ((Property)node).getPersistentClass();
if (pClass != null){
enName = pClass.getEntityName();
@@ -74,7 +75,7 @@
for (int i = path.getSegmentCount() - 1; i > 0; i--) {
if (path.getSegment(i) instanceof PersistentClass){
enName = ((PersistentClass)path.getSegment(i)).getEntityName();
- enName = enName.substring(enName.lastIndexOf('.') + 1);
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
} else if (path.getSegment(i) instanceof Property){
prName = ((Property)path.getSegment(i)).getName();
if (prop.getValue().isSimpleValue()) {
@@ -83,13 +84,13 @@
propCriteria += NLS.bind(alias, prName, prName.charAt(0));
}
//propCriteria += NLS.bind(projection, prName);
- }
+ }
}
}
} else {
- return "";
+ return ""; //$NON-NLS-1$
}
- enCriteria = NLS.bind(criteria, enName + ".class");
- return sess + enCriteria + propCriteria + "\n.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)";
+ enCriteria = NLS.bind(criteria, enName + ".class"); //$NON-NLS-1$
+ return sess + enCriteria + propCriteria + "\n.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)"; //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/DeleteConfigurationAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -31,6 +31,7 @@
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.ProjectUtils;
/**
@@ -38,36 +39,36 @@
*
*/
public class DeleteConfigurationAction extends SelectionListenerAction {
-
+
private StructuredViewer part;
public DeleteConfigurationAction(StructuredViewer selectionProvider) {
- super("Delete Configuration");
+ super(HibernateConsoleMessages.DeleteConfigurationAction_delete_config);
setEnabled(false);
this.part = selectionProvider;
}
public void run() {
List selectedNonResources = getSelectedNonResources();
- String question = "Do you wish to delete the selected console configuration";
- String title = "Delete console configuration";
+ String question = HibernateConsoleMessages.DeleteConfigurationAction_do_you_wish_del_selected_config;
+ String title = HibernateConsoleMessages.DeleteConfigurationAction_delete_console_config;
if (selectedNonResources.size() > 1){
- question += "s";
- title += "s";
+ question += HibernateConsoleMessages.DeleteConfigurationAction_str_1;
+ title += HibernateConsoleMessages.DeleteConfigurationAction_str_2;
}
- question += "?";
-
- if( MessageDialog.openConfirm( null, title, question)) {
+ question += HibernateConsoleMessages.DeleteConfigurationAction_str_3;
+
+ if( MessageDialog.openConfirm( null, title, question)) {
Iterator iter = selectedNonResources.iterator();
while (iter.hasNext() ) {
ConsoleConfiguration element = (ConsoleConfiguration) iter.next();
KnownConfigurations.getInstance().removeConfiguration(element, false);
}
-
+
part.refresh();
}
- }
-
+ }
+
protected boolean updateSelection(IStructuredSelection selection) {
if(!selection.isEmpty() ) {
Iterator iter = getSelectedNonResources().iterator();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/EditConsoleConfiguration.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,18 +27,15 @@
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.wizards.ConsoleConfigurationCreationWizard;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
/**
@@ -48,12 +45,12 @@
public class EditConsoleConfiguration extends ConsoleConfigurationBasedAction {
ConsoleConfiguration cfg = null;
-
+
/**
* @param text
*/
public EditConsoleConfiguration() {
- super("Edit Configuration");
+ super(HibernateConsoleMessages.EditConsoleConfiguration_edit_config);
}
public EditConsoleConfiguration(ConsoleConfiguration configuration) {
@@ -71,15 +68,15 @@
edit( config );
}
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(null, "Exception while trying to edit configuration", he);
+ HibernateConsolePlugin.getDefault().showError(null, HibernateConsoleMessages.EditConsoleConfiguration_exception_while_edit_config, he);
}
- }
+ }
} else {
try {
- edit(cfg);
+ edit(cfg);
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(null, "Exception while trying to edit configuration", he);
- }
+ HibernateConsolePlugin.getDefault().showError(null, HibernateConsoleMessages.EditConsoleConfiguration_exception_while_edit_config, he);
+ }
}
}
@@ -88,8 +85,8 @@
/*if(MessageDialog.openQuestion( null, "Use old dialog ?", "Use old dialog" )) {
ConsoleConfigurationCreationWizard wizard = new ConsoleConfigurationCreationWizard();
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection(config) );
-
+
WizardDialog dialog = new WizardDialog(win.getShell(), wizard);
dialog.open(); // This opens a dialog
} else {*/
@@ -101,13 +98,14 @@
for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there is no look up by name API
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
if(launchConfiguration.getName().equals(config.getName())) {
- DebugUITools.openLaunchConfigurationPropertiesDialog( win.getShell(), launchConfiguration, "org.eclipse.debug.ui.launchGroup.run" );
+ DebugUITools.openLaunchConfigurationPropertiesDialog( win.getShell(), launchConfiguration, "org.eclipse.debug.ui.launchGroup.run" ); //$NON-NLS-1$
return;
}
- }
- HibernateConsolePlugin.getDefault().showError(win.getShell(), "Could not find launch configuration for '" + config.getName() + "'", new IllegalStateException("No launch configuration matched the configuration named " + config.getName()));
+ }
+ String out = NLS.bind(HibernateConsoleMessages.EditConsoleConfiguration_could_not_find_launch_cfg, config.getName());
+ HibernateConsolePlugin.getDefault().showError(win.getShell(), out, new IllegalStateException(HibernateConsoleMessages.EditConsoleConfiguration_no_launch_cfg_matched + config.getName()));
} catch (CoreException ce) {
- HibernateConsolePlugin.getDefault().showError( win.getShell(), "Problem adding a console configuration", ce);
+ HibernateConsolePlugin.getDefault().showError( win.getShell(), HibernateConsoleMessages.EditConsoleConfiguration_problem_adding_console_cfg, ce);
}
//}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/ExecuteQueryAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -26,6 +26,7 @@
import org.eclipse.swt.widgets.Event;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -36,8 +37,8 @@
public class ExecuteQueryAction extends Action {
private QueryEditor editor;
-
- public ExecuteQueryAction() {
+
+ public ExecuteQueryAction() {
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.EXECUTE) );
initTextAndToolTip();
}
@@ -51,7 +52,7 @@
public void run() {
execute(editor );
}
-
+
public void runWithEvent(Event event) {
super.runWithEvent( event );
}
@@ -66,22 +67,22 @@
cfg.build();
}
cfg.buildSessionFactory();
- queryEditor.executeQuery(cfg);
+ queryEditor.executeQuery(cfg);
}
} else {
- queryEditor.executeQuery(cfg);
+ queryEditor.executeQuery(cfg);
}
- }
+ }
}
- finally {
+ finally {
initTextAndToolTip();
}
-
+
}
private void initTextAndToolTip() {
- setText("Run HQL");
- setToolTipText("Run HQL");
+ setText(HibernateConsoleMessages.ExecuteQueryAction_run_hql);
+ setToolTipText(HibernateConsoleMessages.ExecuteQueryAction_run_hql);
}
public void run(IAction action) {
@@ -89,7 +90,7 @@
}
public void setHibernateQueryEditor(QueryEditor editor) {
- this.editor = editor;
+ this.editor = editor;
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,6 +24,7 @@
import org.eclipse.jface.viewers.TreePath;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.mapping.PersistentClass;
@@ -31,44 +32,44 @@
public class HQLScratchpadAction extends OpenQueryEditorAction {
public HQLScratchpadAction() {
- super( "HQL Editor" );
+ super( HibernateConsoleMessages.HQLScratchpadAction_hql_editor );
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.HQL_EDITOR));
- setToolTipText("Open HQL Editor");
+ setToolTipText(HibernateConsoleMessages.HQLScratchpadAction_open_hql_editor);
setEnabled( true );
}
protected void openQueryEditor(ConsoleConfiguration config, String query) {
- HibernateConsolePlugin.getDefault().openScratchHQLEditor(config==null?null:config.getName(), query);
+ HibernateConsolePlugin.getDefault().openScratchHQLEditor(config==null?null:config.getName(), query);
}
-
+
/* (non-Javadoc)
* @see org.hibernate.eclipse.console.actions.OpenQueryEditorAction#generateQuery(org.eclipse.jface.viewers.TreePath)
*/
protected String generateQuery(TreePath path) {
- Object node = path.getLastSegment();
+ Object node = path.getLastSegment();
if (node instanceof PersistentClass){
String name = ((PersistentClass)node).getEntityName();
- return "from " + name;
+ return "from " + name; //$NON-NLS-1$
} else if (node instanceof Property){
- String prName = ((Property)node).getName();
+ String prName = ((Property)node).getName();
PersistentClass pClass = ((Property)node).getPersistentClass();
- String enName = "";
+ String enName = ""; //$NON-NLS-1$
if (pClass != null){
enName = pClass.getEntityName();
- enName = enName.substring(enName.lastIndexOf('.') + 1);
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
} else {
// Generate script for Component property
for (int i = path.getSegmentCount() - 2; i > 0; i--) {
if (path.getSegment(i) instanceof PersistentClass){
enName = ((PersistentClass)path.getSegment(i)).getEntityName();
- enName = enName.substring(enName.lastIndexOf('.') + 1);
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
} else if (path.getSegment(i) instanceof Property){
- prName = ((Property)path.getSegment(i)).getName() + "." + prName;
- }
+ prName = ((Property)path.getSegment(i)).getName() + "." + prName; //$NON-NLS-1$
+ }
}
}
- return "select o." + prName + " from " + enName + " o";
+ return "select o." + prName + " from " + enName + " o"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
- return "";
+ return ""; //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/JTidyFormatAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -33,25 +33,27 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.PluginAction;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.tool.hbm2x.XMLPrettyPrinter;
public class JTidyFormatAction implements IObjectActionDelegate {
private IWorkbenchPart targetPart;
-
+
/**
* Constructor for Action1.
*/
public JTidyFormatAction() {
super();
-
-
-
+
+
+
}
/**
@@ -66,8 +68,10 @@
*/
public void run(IAction action) {
IStructuredSelection selection = (IStructuredSelection) ( (PluginAction)action).getSelection();
-
- if(selection!=null && MessageDialog.openQuestion(targetPart.getSite().getShell(), "Format with JTidy", "Do you want to format " + selection.size() + " xml files with JTidy ?") ) {
+
+ String out = NLS.bind(HibernateConsoleMessages.JTidyFormatAction_do_you_want_format_xml_files_with_jtidy, selection.size());
+ if(selection!=null && MessageDialog.openQuestion(targetPart.getSite().getShell(),
+ HibernateConsoleMessages.JTidyFormatAction_format_with_jtidy, out) ) {
Iterator iterator = selection.iterator();
try {
while(iterator.hasNext() ) {
@@ -84,13 +88,13 @@
} finally {
if(stream!=null) stream.close();
if(bos!=null) bos.close();
- if(contents!=null) contents.close();
+ if(contents!=null) contents.close();
}
}
} catch (CoreException e) {
- HibernateConsolePlugin.getDefault().showError(targetPart.getSite().getShell(), "Error while running JTidy", e);
+ HibernateConsolePlugin.getDefault().showError(targetPart.getSite().getShell(), HibernateConsoleMessages.JTidyFormatAction_error_while_running_jtidy, e);
} catch (IOException io) {
- HibernateConsolePlugin.getDefault().showError(targetPart.getSite().getShell(), "Error while running JTidy", io);
+ HibernateConsolePlugin.getDefault().showError(targetPart.getSite().getShell(), HibernateConsoleMessages.JTidyFormatAction_error_while_running_jtidy, io);
}
}
}
@@ -100,7 +104,7 @@
*/
public void selectionChanged(IAction action, ISelection selection) {
// TODO Auto-generated method stub
-
+
}
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,6 +27,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.ide.IDE;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;
@@ -38,7 +39,7 @@
public class OpenFileActionUtils {
private static XMLHelper helper = new XMLHelper();
-
+
private static final String HIBERNATE_TAG_CLASS = "class"; //$NON-NLS-1$
private static final String HIBERNATE_TAG_TABLE = "table"; //$NON-NLS-1$
private static final String HIBERNATE_TAG_SUBCLASS = "subclass"; //$NON-NLS-1$
@@ -55,22 +56,22 @@
public static IEditorPart openEditor(IWorkbenchPage page, IResource resource) throws PartInitException {
return IDE.openEditor(page, (IFile) resource);
}
-
+
public static boolean rootClassHasAnnotations(ConsoleConfiguration consoleConfiguration, java.io.File configXMLFile, PersistentClass rootClass) {
if (configXMLFile == null) return true;
Document doc = getDocument(consoleConfiguration, configXMLFile);
return getElements(doc, HIBERNATE_TAG_MAPPING, HIBERNATE_TAG_CLASS, getPersistentClassName(rootClass)).hasNext();
}
-
+
static String getPersistentClassName(PersistentClass rootClass) {
if (rootClass == null) {
return ""; //$NON-NLS-1$
- } else {
+ } else {
return rootClass.getEntityName() != null ? rootClass.getEntityName() : rootClass.getClassName();
}
}
-
+
private static String getTableName(String catalog, String schema, String name) {
return (catalog != null ? catalog + '.' : "") + (schema != null ? schema + '.' : "") + name; //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -135,15 +136,15 @@
if (schemaAttr == null) schemaAttr = doc.getRootElement().attribute(HIBERNATE_TAG_SCHEMA);
if (
getTableName(
- (catalogAttr != null ? catalogAttr.getValue() : null),
- (schemaAttr != null ? schemaAttr.getValue() : null),
+ (catalogAttr != null ? catalogAttr.getValue() : null),
+ (schemaAttr != null ? schemaAttr.getValue() : null),
tableAttr.getValue()
).equals(getTableName(table))
) {
return true;
}
-
+
}
Attribute classNameAttr = element.attribute( HIBERNATE_TAG_NAME );
@@ -178,11 +179,11 @@
}
static class LVS extends VisitorSupport {
- private String nodeName;
- private String attrName;
+ private String nodeName;
+ private String attrName;
private String attrValue;
private List ret = new ArrayList();
-
+
public LVS(String nodeName, String attrName, String attrValue) {
super();
this.nodeName = nodeName;
@@ -194,21 +195,21 @@
if (nodeName == null) {
if (attrName != null && attrValue != null) {
if (attrIsCorrect(element, attrName, attrValue)) {
- ret.add(element);
+ ret.add(element);
}
}
} else {
if (nodeName.equals(element.getName())) {
if (attrName != null) {
if (attrIsCorrect(element, attrName, attrValue)) {
- ret.add(element);
+ ret.add(element);
}
} else {
- ret.add(element);
+ ret.add(element);
}
}
}
-
+
}
public Iterator iterator() {
@@ -268,20 +269,20 @@
if (file != null) {
IPackageFragmentRoot[] packageFragmentRoots;
try {
- packageFragmentRoots = proj.getAllPackageFragmentRoots();
+ packageFragmentRoots = proj.getAllPackageFragmentRoots();
for (int i = 0; i < packageFragmentRoots.length && resource == null; i++) {
//search in source folders.
if (packageFragmentRoots[i].getClass() == PackageFragmentRoot.class) {
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
IPath path = packageFragmentRoot.getPath().append(file.getValue());
- resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
}
}
if (resource != null &&
elementInResource(consoleConfiguration, resource, element)) return resource;
resource = null;
} catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problems while getting project package fragment roots", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenFileActionUtils_problems_while_get_project_package_fragment_roots, e);
}
}
}
@@ -299,5 +300,5 @@
return null;
}
-
+
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,12 +27,14 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.osgi.util.NLS;
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.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.mapping.Component;
@@ -47,43 +49,43 @@
*/
public class OpenMappingAction extends SelectionListenerAction {
-
- private static final String HIBERNATE_TAG_NAME = "name";
- private static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name";
- private String imageFilePath = "icons/images/mapping.gif";
+ private static final String HIBERNATE_TAG_NAME = "name"; //$NON-NLS-1$
+ private static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name"; //$NON-NLS-1$
+ private String imageFilePath = "icons/images/mapping.gif"; //$NON-NLS-1$
+
public OpenMappingAction() {
- super("Open Mapping File");
- setToolTipText("Open Mapping File");
+ super(HibernateConsoleMessages.OpenMappingAction_open_mapping_file);
+ setToolTipText(HibernateConsoleMessages.OpenMappingAction_open_mapping_file);
setEnabled( true );
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath ));
}
public void run() {
IStructuredSelection sel = getStructuredSelection();
- if (sel instanceof TreeSelection){
+ if (sel instanceof TreeSelection){
for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
TreePath path = ((TreeSelection)sel).getPaths()[i];
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
try {
run(path, consoleConfiguration);
} catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
} catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open mapping file.", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_open_mapping_file, e);
} catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find mapping file.", e);
- }
- }
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
+ }
+ }
}
}
-
+
public static void run(TreePath path, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
boolean isPropertySel = (path.getLastSegment().getClass() == Property.class);
if (isPropertySel){
Property propertySel = (Property)path.getLastSegment();
PersistentClass persClass = propertySel.getPersistentClass();
- if ( persClass == null
+ if ( persClass == null
|| (RootClass.class.isAssignableFrom(persClass.getClass())
&& persClass.getClass() != RootClass.class)){
Property parentProp = (Property)path.getParentPath().getLastSegment();
@@ -93,14 +95,14 @@
}
run(path.getLastSegment(), consoleConfiguration);
}
-
+
/**
* @param selection
* @param consoleConfiguration
- * @throws JavaModelException
- * @throws PartInitException
- * @throws PresistanceClassNotFoundException
- * @throws FileNotFoundException
+ * @throws JavaModelException
+ * @throws PartInitException
+ * @throws PresistanceClassNotFoundException
+ * @throws FileNotFoundException
*/
public static IEditorPart run(Object selection, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
IEditorPart editorPart = null;
@@ -121,19 +123,19 @@
if (resource != null){
editorPart = openMapping(resource);
if (editorPart != null){
- applySelectionToEditor(selection, editorPart);
+ applySelectionToEditor(selection, editorPart);
}
return editorPart;
- }
-
- //try to find hibernate-annotations
+ }
+
+ //try to find hibernate-annotations
PersistentClass rootClass = null;
if (selection instanceof PersistentClass) {
rootClass = (PersistentClass)selection;
} else if (selection instanceof Property) {
Property p = (Property)selection;
if (p.getPersistentClass() == null) return null;
- rootClass = (PersistentClass)p.getPersistentClass();
+ rootClass = (PersistentClass)p.getPersistentClass();
}
if (rootClass != null){
if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
@@ -142,19 +144,20 @@
return editorPart;
}
} else {
- throw new FileNotFoundException("Mapping for " + selection + " not found.");
+ String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_for_not_found, selection);
+ throw new FileNotFoundException(out);
}
- return null;
+ return null;
}
-
+
/**
* @param compositeProperty
* @param parentProperty
* @param consoleConfiguration
- * @throws JavaModelException
- * @throws PartInitException
- * @throws FileNotFoundException
- * @throws BadLocationException
+ * @throws JavaModelException
+ * @throws PartInitException
+ * @throws FileNotFoundException
+ * @throws BadLocationException
*/
public static IEditorPart run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
if (parentProperty.getPersistentClass() == null) return null;
@@ -174,10 +177,10 @@
ITextEditor textEditor = null;
for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
textEditor = textEditors[i];
- findAdapter = getFindDocAdapter(textEditor);
+ findAdapter = getFindDocAdapter(textEditor);
}
if (findAdapter == null) return null;
-
+
IRegion parentRegion = findSelection(parentProperty, findAdapter);
if (parentRegion == null) return editorPart;
IRegion propRegion = null;
@@ -185,30 +188,30 @@
propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), generatePattern(compositeProperty), true, true, false, true);
if (propRegion == null){
// try to use key-property
- String pattern = generatePattern(compositeProperty).replaceFirst("property", "key-property");
+ String pattern = generatePattern(compositeProperty).replaceFirst("property", "key-property"); //$NON-NLS-1$ //$NON-NLS-2$
propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
}
/*if (propRegion == null){
// try to find name = "<name>"
- String pattern = HIBERNATE_TAG_NAME + "[\\s]*=[\\s]*\"" + property.getNodeName() + '\"';
+ String pattern = HIBERNATE_TAG_NAME + "[\\s]*=[\\s]*\"" + property.getNodeName() + '\"';
propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
}*/
} catch (BadLocationException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Selection not found.", e);
- }
-
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_selection_not_found, e);
+ }
+
if (propRegion != null){
int length = compositeProperty.getNodeName().length();
- int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
+ int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
propRegion = new Region(offset, length);
textEditor.selectAndReveal(propRegion.getOffset(), propRegion.getLength());
return editorPart;
}
}
return editorPart;
- }
-
- if (parentProperty.getPersistentClass() != null && parentProperty.isComposite()){
+ }
+
+ if (parentProperty.getPersistentClass() != null && parentProperty.isComposite()){
PersistentClass rootClass = parentProperty.getPersistentClass();
if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
String fullyQualifiedName =((Component)((Property) parentProperty).getValue()).getComponentClassName();
@@ -217,7 +220,8 @@
}
}
if (editorPart == null) {
- throw new FileNotFoundException("Mapping file for property '" + compositeProperty.getNodeName() + "' not found.");
+ String out = NLS.bind(HibernateConsoleMessages.OpenMappingAction_mapping_file_for_property_not_found, compositeProperty.getNodeName());
+ throw new FileNotFoundException(out);
}
return null;
}
@@ -234,10 +238,10 @@
ITextEditor textEditor = null;
for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
textEditor = textEditors[i];
- findAdapter = getFindDocAdapter(textEditor);
+ findAdapter = getFindDocAdapter(textEditor);
}
- if (findAdapter == null) return false;
- IRegion selectRegion = null;
+ if (findAdapter == null) return false;
+ IRegion selectRegion = null;
if (selection instanceof RootClass
|| selection instanceof Subclass){
@@ -245,7 +249,7 @@
} else if (selection instanceof Property){
selectRegion = findSelection((Property)selection, findAdapter);
}
-
+
if (selectRegion != null){
textEditor.selectAndReveal(selectRegion.getOffset(), selectRegion.getLength());
return true;
@@ -267,16 +271,16 @@
FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
return findAdapter;
}
-
+
static public IEditorPart openMapping(IResource resource) {
if (resource != null && resource instanceof IFile){
try {
return OpenFileActionUtils.openEditor(HibernateConsolePlugin.getDefault().getActiveWorkbenchWindow().getActivePage(), (IFile) resource);
} catch (PartInitException e) {
-
- }
+
+ }
} else {
- HibernateConsolePlugin.getDefault().log("Can't open mapping file " + resource);
+ HibernateConsolePlugin.getDefault().log(HibernateConsoleMessages.OpenMappingAction_cannot_open_mapping_file + resource);
}
return null;
}
@@ -292,22 +296,22 @@
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 = findSelection(property.getPersistentClass(), findAdapter);
if (classRegion == null) return null;
- IRegion finalRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), "</class", true, true, false, false);
+ IRegion finalRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), "</class", true, true, false, false); //$NON-NLS-1$
IRegion propRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), generatePattern(property), true, true, false, true);
if (propRegion == null) return null;
- if (finalRegion != null
+ if (finalRegion != null
&& propRegion.getOffset() > finalRegion.getOffset()){
return null;
} else {
@@ -318,7 +322,7 @@
} catch (BadLocationException e) {
return null;
}
-
+
}
public static IRegion findSelection(PersistentClass persClass,
FindReplaceDocumentAdapter findAdapter) {
@@ -330,13 +334,13 @@
}
if (classRegion == null) return null;
int length = persClass.getNodeName().length();
- int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
+ int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
return new Region(offset, length);
} catch (BadLocationException e) {
return null;
}
}
-
+
private static String[] generatePatterns(PersistentClass persClass){
String fullClassName = null;
String shortClassName = null;
@@ -346,80 +350,80 @@
fullClassName = persClass.getClassName();
}
shortClassName = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
-
+
Cfg2HbmTool tool = new Cfg2HbmTool();
String[] patterns = new String[4];
- StringBuffer pattern = new StringBuffer("<");
+ StringBuffer pattern = new StringBuffer("<"); //$NON-NLS-1$
pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*");
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
pattern.append(shortClassName);
pattern.append('\"');
patterns[0] = pattern.toString();
-
- pattern = new StringBuffer("<");
+
+ pattern = new StringBuffer("<"); //$NON-NLS-1$
pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*");
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
pattern.append(fullClassName);
pattern.append('\"');
patterns[1] = pattern.toString();
-
- pattern = new StringBuffer("<");
+
+ pattern = new StringBuffer("<"); //$NON-NLS-1$
pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*");
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
pattern.append(HIBERNATE_TAG_ENTITY_NAME);
- pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
pattern.append(shortClassName);
pattern.append('\"');
patterns[2] = pattern.toString();
-
- pattern = new StringBuffer("<");
+
+ pattern = new StringBuffer("<"); //$NON-NLS-1$
pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*");
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
pattern.append(HIBERNATE_TAG_ENTITY_NAME);
- pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
pattern.append(fullClassName);
pattern.append('\"');
patterns[3] = pattern.toString();
return patterns;
}
-
+
private static String generatePattern(Property property){
Cfg2HbmTool tool = new Cfg2HbmTool();
- StringBuffer pattern = new StringBuffer("<");
+ StringBuffer pattern = new StringBuffer("<"); //$NON-NLS-1$
if(property.getPersistentClass() != null &&
property.getPersistentClass().getIdentifierProperty()==property) {
if (property.isComposite()){
- pattern.append("composite-id");
+ pattern.append("composite-id"); //$NON-NLS-1$
} else {
- pattern.append("id");
+ pattern.append("id"); //$NON-NLS-1$
}
} else{
pattern.append(tool.getTag(property));
}
- pattern.append("[\\s]+[.[^>]]*");
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\"");
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
pattern.append(property.getNodeName());
- pattern.append('\"');
+ pattern.append('\"');
return pattern.toString();
}
-
+
/**
* Method gets all ITextEditors from IEditorPart.
* Never returns null.
* @param editorPart
* @return
- */
+ */
public static ITextEditor[] getTextEditors(IEditorPart editorPart) {
/*
* if EditorPart is MultiPageEditorPart then get ITextEditor from it.
*/
if (editorPart instanceof MultiPageEditorPart) {
- List testEditors = new ArrayList();
+ List testEditors = new ArrayList();
IEditorPart[] editors = ((MultiPageEditorPart) editorPart).findEditors(editorPart.getEditorInput());
for (int i = 0; i < editors.length; i++) {
if (editors[i] instanceof ITextEditor){
@@ -431,5 +435,5 @@
return new ITextEditor[]{(ITextEditor) editorPart};
}
return new ITextEditor[0];
- }
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -7,6 +7,7 @@
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
@@ -25,7 +26,7 @@
showed = doRun(paths);
}
if(!showed) {
- openQueryEditor( null, "" );
+ openQueryEditor( null, "" ); //$NON-NLS-1$
}
}
@@ -38,14 +39,14 @@
openQueryEditor( config, generateQuery(path) );
showed = true;
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(null, "Exception while trying to open HQL editor", he);
+ HibernateConsolePlugin.getDefault().showError(null, HibernateConsoleMessages.OpenQueryEditorAction_exception_open_hql_editor, he);
}
}
- return showed;
+ return showed;
}
protected abstract void openQueryEditor(final ConsoleConfiguration config, String query);
-
+
/**
* Generates default query for selected element.
* @param selection
Modified: 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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -22,10 +22,12 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.osgi.util.NLS;
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.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.mapping.Component;
@@ -38,15 +40,15 @@
public class OpenSourceAction extends SelectionListenerAction {
- private String imageFilePath = "icons/images/java.gif";
+ private String imageFilePath = "icons/images/java.gif"; //$NON-NLS-1$
- public OpenSourceAction() {
- super("Open Source File");
- setToolTipText("Open Source File");
+ public OpenSourceAction() {
+ super(HibernateConsoleMessages.OpenSourceAction_open_source_file);
+ setToolTipText(HibernateConsoleMessages.OpenSourceAction_open_source_file);
setEnabled( true );
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath));
}
-
+
public void run() {
IStructuredSelection sel = getStructuredSelection();
if (sel instanceof TreeSelection){
@@ -56,7 +58,7 @@
PersistentClass persClass = getPersistentClass(lastSegment);
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
-
+
String fullyQualifiedName = null;
if (lastSegment instanceof Property){
Object prevSegment = path.getParentPath().getLastSegment();
@@ -72,13 +74,13 @@
try {
run(lastSegment, proj, fullyQualifiedName);
} catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenSourceAction_cannot_find_source_file, e);
} catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't open source file.", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenSourceAction_cannot_open_source_file, e);
} catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Can't find source file.", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenSourceAction_cannot_find_source_file, e);
}
- }
+ }
}
}
@@ -86,29 +88,29 @@
* @param selection
* @param proj
* @param fullyQualifiedName
- * @throws JavaModelException
- * @throws PartInitException
- * @throws FileNotFoundException
+ * @throws JavaModelException
+ * @throws PartInitException
+ * @throws FileNotFoundException
*/
public IEditorPart run(Object selection, IJavaProject proj,
String fullyQualifiedName) throws JavaModelException, PartInitException, FileNotFoundException {
if (fullyQualifiedName == null) return null;
String remainder = null;
IType type = null;
- if (fullyQualifiedName.indexOf("$") > 0) {
- remainder = fullyQualifiedName.substring(fullyQualifiedName.indexOf("$") + 1);
- fullyQualifiedName = fullyQualifiedName.substring(0, fullyQualifiedName.indexOf("$"));
+ if (fullyQualifiedName.indexOf("$") > 0) { //$NON-NLS-1$
+ remainder = fullyQualifiedName.substring(fullyQualifiedName.indexOf("$") + 1); //$NON-NLS-1$
+ fullyQualifiedName = fullyQualifiedName.substring(0, fullyQualifiedName.indexOf("$")); //$NON-NLS-1$
type = proj.findType(fullyQualifiedName);
- while ( remainder.indexOf("$") > 0 ){
- String subtype = remainder.substring(0, fullyQualifiedName.indexOf("$"));
+ while ( remainder.indexOf("$") > 0 ){ //$NON-NLS-1$
+ String subtype = remainder.substring(0, fullyQualifiedName.indexOf("$")); //$NON-NLS-1$
type = type.getType(subtype);
- remainder = remainder.substring(fullyQualifiedName.indexOf("$") + 1);
+ remainder = remainder.substring(fullyQualifiedName.indexOf("$") + 1); //$NON-NLS-1$
}
type = type.getType(remainder);
} else {
type = proj.findType(fullyQualifiedName);
}
-
+
IEditorPart editorPart = JavaUI.openInEditor(type);
if (editorPart instanceof JavaEditor) {
IJavaElement jElement = null;
@@ -116,18 +118,19 @@
jElement = type.getField(((Property)selection).getName());
} else {
jElement = type;
- }
+ }
JavaEditor jEditor = (JavaEditor) editorPart;
- selectionToEditor(jElement, jEditor);
- }
+ selectionToEditor(jElement, jEditor);
+ }
if (editorPart == null) {
- throw new FileNotFoundException("Source file for class '" + fullyQualifiedName + "' not found.");
+ String out = NLS.bind(HibernateConsoleMessages.OpenSourceAction_source_file_for_class_not_found, fullyQualifiedName);
+ throw new FileNotFoundException(out);
}
return editorPart;
-
+
}
-
+
private PersistentClass getPersistentClass(Object selection){
if (selection instanceof Property){
return ((Property)selection).getPersistentClass();
@@ -144,7 +147,7 @@
}
}
- /*
+ /*
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
@Override
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/RefreshAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -26,6 +26,7 @@
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.ui.actions.SelectionListenerAction;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
@@ -35,21 +36,21 @@
public class RefreshAction extends SelectionListenerAction {
private final StructuredViewer viewer;
- private String imageFilePath = "icons/images/refresh_run.gif";
+ private String imageFilePath = "icons/images/refresh_run.gif"; //$NON-NLS-1$
public RefreshAction(StructuredViewer viewer) {
- super("Refresh");
+ super(HibernateConsoleMessages.RefreshAction_refresh);
this.viewer = viewer;
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath ));
}
-
+
public void run() {
List selectedNonResources = getSelectedNonResources();
-
+
Iterator iter = selectedNonResources.iterator();
while (iter.hasNext() ) {
Object element = iter.next();
- viewer.refresh(element);
+ viewer.refresh(element);
}
}
Deleted: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/messages.properties 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/messages.properties 2008-06-10 13:18:48 UTC (rev 8677)
@@ -1,25 +0,0 @@
-popup_copy_text=Copy
-popup_paste_text=Paste
-popup_select_all=Select All
-find_replace_action_label=Find/Replace
-find_replace_action_tooltip=Find/Replace
-find_replace_action_image=
-find_replace_action_description=Find & Replace
-
-ContentAssistProposal.label =Co&ntent Assist@Ctrl+SPACE
-ContentAssistProposal.tooltip =Content Assist
-ContentAssistProposal.image =
-ContentAssistProposal.description =Content Assist
-
-ContentAssistTip.label =Content Tip@Ctrl+SHIFT+SPACE
-ContentAssistTip.tooltip =Content Tip
-ContentAssistTip.image =
-ContentAssistTip.description =Content Tip
-
-ContentFormat.label =F&ormat HQL@Ctrl+SHIFT+F
-ContentFormat.tooltip =Format HQL
-ContentFormat.image =
-ContentFormat.description =Format HQL source
-
-GenerateSeamEntities_dialog_title = Select output directory
-GenerateSeamEntities_dialog_message = Choose directory in which the generated files will be stored
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IReverseEngineeringDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IReverseEngineeringDefinition.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/IReverseEngineeringDefinition.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,9 +25,9 @@
public interface IReverseEngineeringDefinition {
- public static final String TABLEFILTER_STRUCTURE = "tableFilterStructure";
- public static final String TYPEMAPPING_STRUCTURE = "typeMappingStructure";
- public static final String TABLES_STRUCTURE = "tablesStructure";
+ public static final String TABLEFILTER_STRUCTURE = "tableFilterStructure"; //$NON-NLS-1$
+ public static final String TYPEMAPPING_STRUCTURE = "typeMappingStructure"; //$NON-NLS-1$
+ public static final String TABLES_STRUCTURE = "tablesStructure"; //$NON-NLS-1$
void addPropertyChangeListener(PropertyChangeListener pcl);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterDefinition.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -54,16 +54,17 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.HibernatePlugin;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.tool.hbm2x.Exporter;
import org.hibernate.util.ReflectHelper;
-/**
+/**
* Represents what is specified in plugin.xml about possible exporters.
*
*/
public class ExporterDefinition {
-
+
final private String classname;
final private String description;
@@ -75,11 +76,11 @@
final private Map properties;
public ExporterDefinition(IConfigurationElement element) {
- this(element.getAttribute( "classname" ),
- element.getAttribute( "description" ),
- element.getAttribute( "id" ),
+ this(element.getAttribute( "classname" ), //$NON-NLS-1$
+ element.getAttribute( "description" ), //$NON-NLS-1$
+ element.getAttribute( "id" ), //$NON-NLS-1$
createProperties( element ),
- createIcon( element ));
+ createIcon( element ));
}
public ExporterDefinition(String className, String description, String id, Map properties, ImageDescriptor icon) {
@@ -91,9 +92,9 @@
}
static private ImageDescriptor createIcon(IConfigurationElement element) {
- if ( element.getAttribute( "icon" ) != null ) {
+ if ( element.getAttribute( "icon" ) != null ) { //$NON-NLS-1$
return AbstractUIPlugin.imageDescriptorFromPlugin(
- element.getNamespace(), element.getAttribute( "icon" ) );
+ element.getNamespace(), element.getAttribute( "icon" ) ); //$NON-NLS-1$
} else {
return null;
}
@@ -103,19 +104,19 @@
Map properties = new HashMap();
IConfigurationElement propertyElements[] = element
- .getChildren( "property" );
+ .getChildren( "property" ); //$NON-NLS-1$
for (int i = 0; i < propertyElements.length; i++) {
ExporterProperty property = new ExporterProperty(
- propertyElements[i].getAttribute("name"),
- propertyElements[i].getAttribute("description"),
- propertyElements[i].getAttribute("value"),
- Boolean.valueOf(propertyElements[i].getAttribute("required")).booleanValue());
+ propertyElements[i].getAttribute("name"), //$NON-NLS-1$
+ propertyElements[i].getAttribute("description"), //$NON-NLS-1$
+ propertyElements[i].getAttribute("value"), //$NON-NLS-1$
+ Boolean.valueOf(propertyElements[i].getAttribute("required")).booleanValue()); //$NON-NLS-1$
properties.put(property.getName(),property);
}
return properties;
}
-
+
public Exporter createExporterInstance() {
Exporter exporter = null;
@@ -123,13 +124,13 @@
exporter = (Exporter) ReflectHelper.classForName( classname ).newInstance();
}
catch (InstantiationException e) {
- throw new HibernateConsoleRuntimeException("Problem while creating exporter class " + classname);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname);
}
catch (IllegalAccessException e) {
- throw new HibernateConsoleRuntimeException("Problem while creating exporter class " + classname); }
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname); }
catch (ClassNotFoundException e) {
- throw new HibernateConsoleRuntimeException("Problem while creating exporter class " + classname);
- }
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ExporterDefinition_problem_creating_exporter_class + classname);
+ }
return exporter;
}
@@ -162,10 +163,10 @@
return enabled;
}
-
+
public String getId() {
return id;
}
-
+
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -13,8 +13,10 @@
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.HibernateConsoleRuntimeException;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.hibernate.eclipse.launch.PathHelper;
import org.hibernate.tool.hbm2x.ArtifactCollector;
@@ -36,7 +38,7 @@
private boolean enabled = true;
private final String exporterId;
-
+
public ExporterFactory(ExporterDefinition definition, String exporterId) {
this.definition = definition;
this.exporterId = exporterId;
@@ -46,10 +48,10 @@
public Map getDefaultExporterProperties() {
return definition.getExporterProperties();
}
-
+
public String setProperty(String key, String value) {
- return (String) inputProperties.put( key, value );
+ return (String) inputProperties.put( key, value );
}
public void removeProperty(String propertyName) {
@@ -66,7 +68,7 @@
} else {
return null;
}
- }
+ }
}
public boolean isEnabled() {
@@ -74,7 +76,7 @@
}
public void setEnabled(boolean b) {
- enabled = b;
+ enabled = b;
}
public ExporterDefinition getExporterDefinition() {
@@ -83,7 +85,7 @@
// todo: move to ExporterAttributes together with isEnabled functionallity...
String getLaunchAttributePrefix(String exporterId) {
- return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId;
+ return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId; //$NON-NLS-1$
}
public boolean isEnabled(ILaunchConfiguration configuration) {
@@ -91,7 +93,7 @@
try {
if(configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, (List)null)==null) {
- enabled = configuration.getAttribute( getId(), false );
+ enabled = configuration.getAttribute( getId(), false );
} else {
enabled = configuration.getAttribute( getLaunchAttributePrefix( getId() ), false );
}
@@ -99,7 +101,7 @@
// ignore; assume false
enabled=false;
}
-
+
setEnabled( enabled );
return isEnabled();
}
@@ -112,9 +114,9 @@
configuration.setAttribute( getLaunchAttributePrefix( getId() ), isEnabled());
}
}
-
+
public void setEnabled(ILaunchConfigurationWorkingCopy configuration, boolean enabled) {
-
+
boolean oldSettings = true;
try {
if(configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, (List)null)==null) {
@@ -139,7 +141,7 @@
public void setProperties(Map props) {
inputProperties.clear();
- inputProperties.putAll( props );
+ inputProperties.putAll( props );
}
public ExporterProperty getExporterProperty(String key) {
@@ -150,62 +152,67 @@
return inputProperties.containsKey( string );
}
- /** Method that resolves an expression through eclipses built-in variable manager.
+ /** Method that resolves an expression through eclipses built-in variable manager.
* @throws CoreException if expression could not be evaluated. */
private String resolve(String expression) throws CoreException {
if(expression==null) return null;
IStringVariableManager variableManager = VariablesPlugin.getDefault().getStringVariableManager();
-
- return variableManager.performStringSubstitution(expression, false);
+
+ return variableManager.performStringSubstitution(expression, false);
}
-
+
/**
* Creates exporter with the specified settings; also resolves any relevant properties via Eclipse VariablesPlugin.
- * @param collector
+ * @param collector
* @throws CoreException in case of resolve variables issues.
*/
public Exporter createConfiguredExporter(Configuration cfg, String defaultOutputDirectory,
String customTemplatePath, Properties globalProperties, Set outputDirectories, ArtifactCollector collector) throws CoreException {
-
+
Exporter exporter = getExporterDefinition().createExporterInstance();
-
-
+
+
Properties props = new Properties();
props.putAll(globalProperties);
props.putAll(getProperties());
-
+
exporter.setProperties(props);
exporter.setArtifactCollector(collector);
-
+
String outputPath = defaultOutputDirectory;
- if(props.containsKey("outputdir")) {
- outputPath = props.getProperty("outputdir");
- props.remove("outputdir"); // done to avoid validation check in hibernate tools templates
+ if(props.containsKey("outputdir")) { //$NON-NLS-1$
+ outputPath = props.getProperty("outputdir"); //$NON-NLS-1$
+ // done to avoid validation check in hibernate tools templates
+ props.remove("outputdir"); //$NON-NLS-1$
}
-
+
String resolvedOutputDir = resolve(outputPath);
String loc = PathHelper.getLocationAsStringPath(resolvedOutputDir);
if(outputPath != null && loc == null) {
- throw new HibernateConsoleRuntimeException("Output directory '" + resolvedOutputDir + "' in " + getExporterDefinition().getDescription() + " does not exist.");
+ String out = NLS.bind(HibernateConsoleMessages.ExporterFactory_output_dir_in_does_not_exist,
+ resolvedOutputDir, getExporterDefinition().getDescription());
+ throw new HibernateConsoleRuntimeException(out);
}
-
+
if(StringHelper.isNotEmpty(loc)) { // only set if something valid found
outputDirectories.add(loc);
exporter.setOutputDirectory(new File(loc));
}
-
+
exporter.setConfiguration(cfg);
-
+
List templatePathList = new ArrayList();
- if(props.containsKey("template_path")) {
- String resolveTemplatePath = resolve(props.getProperty("template_path"));
+ if(props.containsKey("template_path")) { //$NON-NLS-1$
+ String resolveTemplatePath = resolve(props.getProperty("template_path")); //$NON-NLS-1$
String locationAsStringPath = PathHelper.getLocationAsStringPath(resolveTemplatePath);
if(locationAsStringPath==null) {
- throw new HibernateConsoleRuntimeException("Template directory '" + resolveTemplatePath + "' in " + getExporterDefinition().getDescription() + " does not exist.");
+ String out = NLS.bind(HibernateConsoleMessages.ExporterFactory_output_dir_in_does_not_exist,
+ resolvedOutputDir, getExporterDefinition().getDescription());
+ throw new HibernateConsoleRuntimeException(out);
} else {
templatePathList.add(locationAsStringPath);
- }
- props.remove("template_path"); // done to avoid validation check in hibernate tools templates
+ }
+ props.remove("template_path"); // done to avoid validation check in hibernate tools templates //$NON-NLS-1$
}
if (StringHelper.isNotEmpty(customTemplatePath)){
String resolvedCustomTemplatePath = resolve(customTemplatePath);
@@ -213,24 +220,26 @@
if(locationAsStringPath != null) {
templatePathList.add(locationAsStringPath);
} else {
- throw new HibernateConsoleRuntimeException("Template directory '" + resolvedCustomTemplatePath + "' in " + getExporterDefinition().getDescription() + " does not exist.");
+ String out = NLS.bind(HibernateConsoleMessages.ExporterFactory_template_dir_in_does_not_exist,
+ resolvedCustomTemplatePath, getExporterDefinition().getDescription());
+ throw new HibernateConsoleRuntimeException(out);
}
}
-
+
exporter.setTemplatePath((String[]) templatePathList.toArray(new String[templatePathList.size()]));
-
-
+
+
// special handling for GenericExporter (TODO: be delegated via plugin.xml)
- if(getExporterDefinition().getId().equals("org.hibernate.tools.hbmtemplate")) {
+ if(getExporterDefinition().getId().equals("org.hibernate.tools.hbmtemplate")) { //$NON-NLS-1$
GenericExporter ge = (GenericExporter) exporter;
-
- ge.setFilePattern(props.getProperty("file_pattern", null));
- props.remove("file_pattern");
- ge.setTemplateName(props.getProperty("template_name",null));
- props.remove("template_name");
- ge.setForEach(props.getProperty("for_each",null));
- props.remove("for_each");
-
+
+ ge.setFilePattern(props.getProperty("file_pattern", null)); //$NON-NLS-1$
+ props.remove("file_pattern"); //$NON-NLS-1$
+ ge.setTemplateName(props.getProperty("template_name",null)); //$NON-NLS-1$
+ props.remove("template_name"); //$NON-NLS-1$
+ ge.setForEach(props.getProperty("for_each",null)); //$NON-NLS-1$
+ props.remove("for_each"); //$NON-NLS-1$
+
}
return exporter;
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ExporterProperty.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -21,18 +21,20 @@
*/
package org.hibernate.eclipse.console.model.impl;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
+
public class ExporterProperty
{
private static ExporterProperty[] globalProperties = new ExporterProperty[] {
- new ExporterProperty ("jdk5", "Use Java 5 syntax", "false", false),
- new ExporterProperty ("ejb3", "Generate EJB3 annotations", "false", false)
+ new ExporterProperty ("jdk5", HibernateConsoleMessages.ExporterProperty_use_java5_syntax, "false", false), //$NON-NLS-1$ //$NON-NLS-2$
+ new ExporterProperty ("ejb3", HibernateConsoleMessages.ExporterProperty_generate_ejb3_annotations, "false", false) //$NON-NLS-1$ //$NON-NLS-2$
};
-
+
private String defaultValue;
private String description;
private String name;
private boolean required;
-
+
public ExporterProperty () { }
public ExporterProperty (String name, String description, String defaultValue, boolean required)
{
@@ -41,7 +43,7 @@
this.defaultValue = defaultValue;
this.required = required;
}
-
+
public String getDefaultValue() {
return defaultValue;
}
@@ -65,12 +67,12 @@
public void setName(String name) {
this.name = name;
}
-
+
public static ExporterProperty[] getGlobalProperties ()
{
return globalProperties;
}
-
+
public boolean equals(Object object) {
if (object instanceof ExporterProperty)
{
@@ -79,11 +81,11 @@
}
return false;
}
-
+
public boolean isRequired() {
return required;
}
-
+
public void setRequired(boolean required) {
this.required = required;
}
@@ -91,7 +93,7 @@
if(description==null) {
return name;
} else {
- return description + " [" + name + "]";
- }
+ return description + " [" + name + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ }
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ReverseEngineeringDefinitionImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ReverseEngineeringDefinitionImpl.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/model/impl/ReverseEngineeringDefinitionImpl.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -70,7 +70,7 @@
}
protected void updateTableFilter(ITableFilter updated) {
- firePropertyChange("tableFilter", null, updated);
+ firePropertyChange("tableFilter", null, updated); //$NON-NLS-1$
}
public ITableFilter[] getTableFilters() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/preferences/HibernateConsolePreferencePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/preferences/HibernateConsolePreferencePage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/preferences/HibernateConsolePreferencePage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -29,14 +29,15 @@
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
* This class represents a preference page that
- * is contributed to the Preferences dialog. By
+ * is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
- * us to create a page that is small and knows how to
+ * us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
@@ -49,15 +50,15 @@
public class HibernateConsolePreferencePage
extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
- public static final String P_PATH = "pathPreference";
- public static final String P_BOOLEAN = "booleanPreference";
- public static final String P_CHOICE = "choicePreference";
- public static final String P_STRING = "stringPreference";
+ public static final String P_PATH = "pathPreference"; //$NON-NLS-1$
+ public static final String P_BOOLEAN = "booleanPreference"; //$NON-NLS-1$
+ public static final String P_CHOICE = "choicePreference"; //$NON-NLS-1$
+ public static final String P_STRING = "stringPreference"; //$NON-NLS-1$
public HibernateConsolePreferencePage() {
super(GRID);
setPreferenceStore(HibernateConsolePlugin.getDefault().getPreferenceStore() );
- setDescription("A demonstration of a preference page implementation");
+ setDescription(HibernateConsoleMessages.HibernateConsolePreferencePage_demo_of_pref_page_impl);
initializeDefaults();
}
/**
@@ -66,10 +67,10 @@
private void initializeDefaults() {
IPreferenceStore store = getPreferenceStore();
store.setDefault(P_BOOLEAN, true);
- store.setDefault(P_CHOICE, "choice2");
- store.setDefault(P_STRING, "Default value");
+ store.setDefault(P_CHOICE, HibernateConsoleMessages.HibernateConsolePreferencePage_choice2);
+ store.setDefault(P_STRING, HibernateConsoleMessages.HibernateConsolePreferencePage_def_value);
}
-
+
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
@@ -78,25 +79,25 @@
*/
public void createFieldEditors() {
- addField(new DirectoryFieldEditor(P_PATH,
- "&Directory preference:", getFieldEditorParent() ) );
+ addField(new DirectoryFieldEditor(P_PATH,
+ HibernateConsoleMessages.HibernateConsolePreferencePage_dir_preference, getFieldEditorParent() ) );
addField(
new BooleanFieldEditor(
P_BOOLEAN,
- "&An example of a boolean preference",
+ HibernateConsoleMessages.HibernateConsolePreferencePage_example_of_bool_pref,
getFieldEditorParent() ) );
addField(new RadioGroupFieldEditor(
P_CHOICE,
- "An example of a multiple-choice preference",
+ HibernateConsoleMessages.HibernateConsolePreferencePage_example_of_multichoise_pref,
1,
- new String[][] { { "&Choice 1", "choice1" }, {
- "C&hoice 2", "choice2" }
+ new String[][] { { HibernateConsoleMessages.HibernateConsolePreferencePage_choice_1, HibernateConsoleMessages.HibernateConsolePreferencePage_choice1 }, {
+ HibernateConsoleMessages.HibernateConsolePreferencePage_choice_2, HibernateConsoleMessages.HibernateConsolePreferencePage_choice2 }
}, getFieldEditorParent() ) );
addField(
- new StringFieldEditor(P_STRING, "A &text preference:", getFieldEditorParent() ) );
+ new StringFieldEditor(P_STRING, HibernateConsoleMessages.HibernateConsolePreferencePage_text_pref, getFieldEditorParent() ) );
}
-
+
public void init(IWorkbench workbench) {
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -53,6 +53,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.utils.ProjectUtils;
@@ -60,14 +61,14 @@
import org.osgi.service.prefs.Preferences;
public class HibernatePropertyPage extends PropertyPage {
-
+
Control[] settings;
private Button enableHibernate;
private Combo selectedConfiguration;
-
+
/**
* Constructor for SamplePropertyPage.
*/
@@ -82,28 +83,28 @@
composite.setLayout(layout);
GridData data = new GridData(SWT.END,SWT.END, true, true);
-
+
composite.setLayoutData(data);
createLogoButtons(composite);
}
-
+
private void addFirstSection(Composite parent) {
Composite composite = createDefaultComposite(parent,2);
enableHibernate = new Button(composite, SWT.CHECK);
- enableHibernate.setText("Enable Hibernate 3 support");
+ enableHibernate.setText(HibernateConsoleMessages.HibernatePropertyPage_enable_hibernate3_support);
enableHibernate.addSelectionListener(new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
boolean selection = enableHibernate.getSelection();
- enableSettings(selection);
+ enableSettings(selection);
}
});
-
-
-
+
+
+
}
private void createLogoButtons(Composite composite) {
@@ -111,15 +112,15 @@
hibernateLogoButton.setImage(EclipseImages.getImage(ImageConstants.HIBERNATE_LOGO));
hibernateLogoButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- openBrowser("http://tools.hibernate.org");
+ openBrowser("http://tools.hibernate.org"); //$NON-NLS-1$
}
});
-
+
Button jbossLogoButton = new Button(composite, SWT.NULL);
jbossLogoButton.setImage(EclipseImages.getImage(ImageConstants.JBOSS_LOGO));
jbossLogoButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
- openBrowser("http://www.jboss.org/products/jbosside");
+ openBrowser("http://www.jboss.org/products/jbosside"); //$NON-NLS-1$
}
});
}
@@ -135,21 +136,21 @@
}
catch (PartInitException e) {
openWebBrowserError(href, e);
- }
+ }
}
-
+
private void openWebBrowserError(final String href, final Throwable t) {
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
- String title = "Open URL";
- String msg = "Unable to open webbrowser for url: " + href;
+ String title = HibernateConsoleMessages.HibernatePropertyPage_open_url;
+ String msg = HibernateConsoleMessages.HibernatePropertyPage_unable_open_webbrowser_for_url + href;
IStatus status = HibernateConsolePlugin.throwableToStatus(t);
ErrorDialog.openError(getShell(), title, msg, status);
}
});
}
-
+
private String urlEncode(char[] input) {
StringBuffer retu = new StringBuffer(input.length);
for (int i = 0; i < input.length; i++) {
@@ -171,10 +172,10 @@
private void addSecondSection(Composite parent) {
Composite settingsPart = createDefaultComposite(parent,2);
-
+
// Label for owner field
Label ownerLabel = new Label(settingsPart, SWT.NONE);
- ownerLabel.setText("Default Hibernate Console configuration:");
+ ownerLabel.setText(HibernateConsoleMessages.HibernatePropertyPage_default_hibernate_console_config);
selectedConfiguration = new Combo(parent, SWT.DROP_DOWN);
GridData gd = new GridData();
@@ -187,9 +188,9 @@
ConsoleConfiguration configuration = configurations[i];
selectedConfiguration.add(configuration.getName() );
}
-
+
settings = new Control[] { ownerLabel, selectedConfiguration };
-
+
}
/**
@@ -210,7 +211,7 @@
addLogoSection(composite);
loadValues();
enableSettings(enableHibernate.getSelection() );
-
+
return composite;
}
@@ -230,9 +231,9 @@
protected void performDefaults() {
enableHibernate.setSelection(false);
- selectedConfiguration.setText("");
+ selectedConfiguration.setText(""); //$NON-NLS-1$
}
-
+
private IProject getProject() {
IAdaptable adaptable= getElement();
if (adaptable != null) {
@@ -243,32 +244,32 @@
}
return null;
}
-
-
+
+
public void loadValues() {
IProject project = getProject();
IScopeContext scope = new ProjectScope(project);
-
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
-
+
+ Preferences node = scope.getNode("org.hibernate.eclipse.console"); //$NON-NLS-1$
+
if(node!=null) {
- enableHibernate.setSelection(node.getBoolean("hibernate3.enabled", false) );
- String cfg = node.get("default.configuration", project.getName() );
+ enableHibernate.setSelection(node.getBoolean("hibernate3.enabled", false) ); //$NON-NLS-1$
+ String cfg = node.get("default.configuration", project.getName() ); //$NON-NLS-1$
ConsoleConfiguration configuration = KnownConfigurations.getInstance().find(cfg);
if(configuration==null) {
- selectedConfiguration.setText("");
+ selectedConfiguration.setText(""); //$NON-NLS-1$
} else {
selectedConfiguration.setText(cfg);
- }
- }
-
+ }
+ }
+
}
public boolean performOk() {
ProjectUtils.toggleHibernateOnProject( getProject(), enableHibernate.getSelection(), selectedConfiguration.getText() );
return true;
}
-
+
private void enableSettings(boolean selection) {
for (int i = 0; i < settings.length; i++) {
Control comp = settings[i];
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/AutoResizeTableLayout.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/AutoResizeTableLayout.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/AutoResizeTableLayout.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -32,19 +32,20 @@
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class AutoResizeTableLayout extends TableLayout implements
ControlListener {
-
+
private final Table table;
private List columns = new ArrayList();
private boolean autosizing = false;
-
+
public AutoResizeTableLayout(Table table) {
this.table = table;
table.addControlListener(this);
}
-
+
public void addColumnData(ColumnLayoutData data) {
columns.add(data);
super.addColumnData(data);
@@ -64,21 +65,21 @@
autosizing = false;
}
}
-
+
private void autoSizeColumns() {
- int width = table.getClientArea().width;
+ int width = table.getClientArea().width;
if (width <= 1) {
return;
}
-
+
TableColumn[] tableColumns = table.getColumns();
- int size =
+ int size =
Math.min(columns.size(), tableColumns.length);
int[] widths = new int[size];
int fixedWidth = 0;
int numberOfWeightColumns = 0;
int totalWeight = 0;
-
+
// First calc space occupied by fixed columns.
for (int i = 0; i < size; i++) {
ColumnLayoutData col = (ColumnLayoutData)columns.get(i);
@@ -92,10 +93,10 @@
int weight = cw.weight;
totalWeight += weight;
} else {
- throw new IllegalStateException("Unknown column layout data");
+ throw new IllegalStateException(HibernateConsoleMessages.AutoResizeTableLayout_unknown_column_layout_data);
}
}
-
+
// Do we have columns that have a weight?
if (numberOfWeightColumns > 0) {
// Now, distribute the rest
@@ -112,7 +113,7 @@
widths[i] = pixels;
}
}
-
+
// Distribute any remaining pixels
// to columns with weight.
int diff = rest - totalDistributed;
@@ -127,14 +128,14 @@
}
}
}
-
+
for (int i = 0; i < size; i++) {
if (tableColumns[i].getWidth() != widths[i]) {
tableColumns[i].setWidth(widths[i]);
}
-
+
}
-
+
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ClassLoaderHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -43,6 +43,7 @@
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
import org.hibernate.console.HibernateConsoleRuntimeException;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
/**
* @author max
@@ -54,46 +55,46 @@
{
List pathElements = getProjectClassPathURLs(project);
URL urlPaths[] = (URL[]) pathElements.toArray(new URL[pathElements.size()]);
-
+
return new URLClassLoader(urlPaths, Thread.currentThread().getContextClassLoader() );
}
-
+
static public List getProjectClassPathURLs (IJavaProject project)
{
List pathElements = new ArrayList();
-
+
try {
IClasspathEntry paths[] = project.getResolvedClasspath(true);
-
+
if (paths != null)
{
for (int i = 0; i < paths.length; i++)
{
- IClasspathEntry path = paths[i];
+ IClasspathEntry path = paths[i];
if (path.getEntryKind() == IClasspathEntry.CPE_LIBRARY)
{
IPath simplePath = path.getPath();
URL url = getRawLocationURL(simplePath);
-
+
pathElements.add(url);
}
}
}
-
+
IPath location = getProjectLocation(project.getProject() );
IPath outputPath = location.append(
project.getOutputLocation().removeFirstSegments(1) );
-
+
pathElements.add(outputPath.toFile().toURL() );
} catch (JavaModelException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
-
+
return pathElements;
}
-
+
private static URL getRawLocationURL(IPath simplePath) throws MalformedURLException {
File file = getRawLocationFile(simplePath);
return file.toURL();
@@ -107,10 +108,10 @@
if(rawLocation==null) {
rawLocation = member.getLocation();
if(rawLocation==null) {
- throw new HibernateConsoleRuntimeException("Could not determine physical location for " + simplePath);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.ClassLoaderHelper_could_not_determine_physical_location_for + simplePath);
}
}
- file = rawLocation.toFile();
+ file = rawLocation.toFile();
} else {
file = simplePath.toFile();
}
@@ -140,7 +141,7 @@
}
return l;
}
-
+
static public String[] getClasspath(ILaunchConfiguration configuration) throws CoreException {
IRuntimeClasspathEntry[] entries = JavaRuntime
.computeUnresolvedRuntimeClasspath(configuration);
@@ -153,7 +154,7 @@
if (location != null) {
userEntries.add(location);
} else {
- //System.out.println("No location: " + runtimeClasspathEntry.getMemento());
+ //System.out.println("No location: " + runtimeClasspathEntry.getMemento());
}
} else {
//System.out.println("Ignored " + runtimeClasspathEntry.getMemento());
@@ -161,5 +162,5 @@
}
return (String[]) userEntries.toArray(new String[userEntries.size()]);
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/DriverClassHelpers.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,190 +42,190 @@
public DriverClassHelpers() {
// externalize this!
- dialectNames.put("DB2", "org.hibernate.dialect.DB2Dialect");
- dialectNames.put("DB2/390", "org.hibernate.dialect.DB2390Dialect");
- dialectNames.put("DB2/400", "org.hibernate.dialect.DB2400Dialect");
- dialectNames.put("Derby", "org.hibernate.dialect.DerbyDialect");
- dialectNames.put("FrontBase", "org.hibernate.dialect.FrontBaseDialect");
- //Not in 3.2 anymore dialectNames.put("Generic", "org.hibernate.dialect.GenericDialect");
- dialectNames.put("HSQL", "org.hibernate.dialect.HSQLDialect");
- dialectNames.put("H2", "org.hibernate.dialect.H2Dialect");
- dialectNames.put("Informix", "org.hibernate.dialect.InformixDialect");
- dialectNames.put("Ingres", "org.hibernate.dialect.IngresDialect");
- dialectNames.put("Interbase", "org.hibernate.dialect.InterbaseDialect");
- dialectNames.put("Firebird", "org.hibernate.dialect.FirebirdDialect");
- dialectNames.put("Mckoi SQL", "org.hibernate.dialect.MckoiDialect");
- dialectNames.put("MySQL", "org.hibernate.dialect.MySQLDialect");
- dialectNames.put("MySQL (InnoDB)", "org.hibernate.dialect.MySQLInnoDBDialect");
- dialectNames.put("MySQL (MyISAM)", "org.hibernate.dialect.MySQLMyISAMDialect");
- dialectNames.put("MySQL 5", "org.hibernate.dialect.MySQL5Dialect");
- dialectNames.put("MySQL 5 (InnoDB)", "org.hibernate.dialect.MySQL5InnoDBDialect");
- //dialectNames.put("Oracle","org.hibernate.dialect.OracleDialect");
- dialectNames.put("Oracle 8i","org.hibernate.dialect.Oracle8iDialect");
- //dialectNames.put("Oracle 9", "org.hibernate.dialect.Oracle9Dialect");
- dialectNames.put("Oracle 9i", "org.hibernate.dialect.Oracle9iDialect");
- dialectNames.put("Oracle 10g", "org.hibernate.dialect.Oracle10gDialect");
- dialectNames.put("Pointbase", "org.hibernate.dialect.PointbaseDialect");
- dialectNames.put("PostgreSQL", "org.hibernate.dialect.PostgreSQLDialect");
- dialectNames.put("Progress", "org.hibernate.dialect.ProgressDialect");
- dialectNames.put("SAP DB", "org.hibernate.dialect.SAPDBDialect");
- dialectNames.put("Sybase", "org.hibernate.dialect.SybaseDialect");
- dialectNames.put("Sybase 11", "org.hibernate.dialect.Sybase11Dialect");
- dialectNames.put("Sybase Anywhere", "org.hibernate.dialect.SybaseAnywhereDialect");
- dialectNames.put("SQL Server", "org.hibernate.dialect.SQLServerDialect");
+ dialectNames.put("DB2", "org.hibernate.dialect.DB2Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("DB2/390", "org.hibernate.dialect.DB2390Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("DB2/400", "org.hibernate.dialect.DB2400Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Derby", "org.hibernate.dialect.DerbyDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("FrontBase", "org.hibernate.dialect.FrontBaseDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ //Not in 3.2 anymore dialectNames.put("Generic", "org.hibernate.dialect.GenericDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("HSQL", "org.hibernate.dialect.HSQLDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("H2", "org.hibernate.dialect.H2Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Informix", "org.hibernate.dialect.InformixDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Ingres", "org.hibernate.dialect.IngresDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Interbase", "org.hibernate.dialect.InterbaseDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Firebird", "org.hibernate.dialect.FirebirdDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Mckoi SQL", "org.hibernate.dialect.MckoiDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("MySQL", "org.hibernate.dialect.MySQLDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("MySQL (InnoDB)", "org.hibernate.dialect.MySQLInnoDBDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("MySQL (MyISAM)", "org.hibernate.dialect.MySQLMyISAMDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("MySQL 5", "org.hibernate.dialect.MySQL5Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("MySQL 5 (InnoDB)", "org.hibernate.dialect.MySQL5InnoDBDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ //dialectNames.put("Oracle","org.hibernate.dialect.OracleDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Oracle 8i","org.hibernate.dialect.Oracle8iDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ //dialectNames.put("Oracle 9", "org.hibernate.dialect.Oracle9Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Oracle 9i", "org.hibernate.dialect.Oracle9iDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Oracle 10g", "org.hibernate.dialect.Oracle10gDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Pointbase", "org.hibernate.dialect.PointbaseDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("PostgreSQL", "org.hibernate.dialect.PostgreSQLDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Progress", "org.hibernate.dialect.ProgressDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("SAP DB", "org.hibernate.dialect.SAPDBDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Sybase", "org.hibernate.dialect.SybaseDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Sybase 11", "org.hibernate.dialect.Sybase11Dialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("Sybase Anywhere", "org.hibernate.dialect.SybaseAnywhereDialect"); //$NON-NLS-1$ //$NON-NLS-2$
+ dialectNames.put("SQL Server", "org.hibernate.dialect.SQLServerDialect"); //$NON-NLS-1$ //$NON-NLS-2$
- addDriverAndURLS("org.hibernate.dialect.HSQLDialect",
- "org.hsqldb.jdbcDriver",
+ addDriverAndURLS("org.hibernate.dialect.HSQLDialect", //$NON-NLS-1$
+ "org.hsqldb.jdbcDriver", //$NON-NLS-1$
new String[] {
- "jdbc:hsqldb:hsql://<host>",
- "jdbc:hsqldb:<dbname>",
- "jdbc:hsqldb:." }
+ "jdbc:hsqldb:hsql://<host>", //$NON-NLS-1$
+ "jdbc:hsqldb:<dbname>", //$NON-NLS-1$
+ "jdbc:hsqldb:." } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.H2Dialect",
- "org.h2.Driver",
+ addDriverAndURLS("org.hibernate.dialect.H2Dialect", //$NON-NLS-1$
+ "org.h2.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:h2:<filename>",
- "jdbc:h2:mem:",
- "jdbc:h2:mem:<databaseName>",
- "jdbc:h2:tcp://<server>[:<port>]/<databaseName>"
+ "jdbc:h2:<filename>", //$NON-NLS-1$
+ "jdbc:h2:mem:", //$NON-NLS-1$
+ "jdbc:h2:mem:<databaseName>", //$NON-NLS-1$
+ "jdbc:h2:tcp://<server>[:<port>]/<databaseName>" //$NON-NLS-1$
}
);
- addDriverAndURLS("org.hibernate.dialect.OracleDialect",
- "oracle.jdbc.driver.OracleDriver",
+ addDriverAndURLS("org.hibernate.dialect.OracleDialect", //$NON-NLS-1$
+ "oracle.jdbc.driver.OracleDriver", //$NON-NLS-1$
new String[] {
- "jdbc:oracle:thin:@localhost:1521:orcl",
- "jdbc:oracle:thin:@<host>:<port1521>:<sid>" }
+ "jdbc:oracle:thin:@localhost:1521:orcl", //$NON-NLS-1$
+ "jdbc:oracle:thin:@<host>:<port1521>:<sid>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.Oracle9Dialect",
- "oracle.jdbc.driver.OracleDriver",
+ addDriverAndURLS("org.hibernate.dialect.Oracle9Dialect", //$NON-NLS-1$
+ "oracle.jdbc.driver.OracleDriver", //$NON-NLS-1$
new String[] {
- "jdbc:oracle:thin:@localhost:1521:orcl",
- "jdbc:oracle:thin:@<host>:<port1521>:<sid>" }
+ "jdbc:oracle:thin:@localhost:1521:orcl", //$NON-NLS-1$
+ "jdbc:oracle:thin:@<host>:<port1521>:<sid>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.Oracle10gDialect",
- "oracle.jdbc.driver.OracleDriver",
+ addDriverAndURLS("org.hibernate.dialect.Oracle10gDialect", //$NON-NLS-1$
+ "oracle.jdbc.driver.OracleDriver", //$NON-NLS-1$
new String[] {
- "jdbc:oracle:thin:@localhost:1521:orcl",
- "jdbc:oracle:thin:@<host>:<port1521>:<sid>" }
+ "jdbc:oracle:thin:@localhost:1521:orcl", //$NON-NLS-1$
+ "jdbc:oracle:thin:@<host>:<port1521>:<sid>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.Oracle8iDialect",
- "oracle.jdbc.driver.OracleDriver",
+ addDriverAndURLS("org.hibernate.dialect.Oracle8iDialect", //$NON-NLS-1$
+ "oracle.jdbc.driver.OracleDriver", //$NON-NLS-1$
new String[] {
- "jdbc:oracle:thin:@localhost:1521:orcl",
- "jdbc:oracle:thin:@<host>:<port1521>:<sid>" }
+ "jdbc:oracle:thin:@localhost:1521:orcl", //$NON-NLS-1$
+ "jdbc:oracle:thin:@<host>:<port1521>:<sid>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.MySQLDialect",
- "org.gjt.mm.mysql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQLDialect", //$NON-NLS-1$
+ "org.gjt.mm.mysql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>",
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>", //$NON-NLS-1$
}
);
- addDriverAndURLS("org.hibernate.dialect.MySQLDialect",
- "com.mysql.jdbc.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQLDialect", //$NON-NLS-1$
+ "com.mysql.jdbc.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>",
- "jdbc:mysql://<host><:port>/<database>"
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>", //$NON-NLS-1$
+ "jdbc:mysql://<host><:port>/<database>" //$NON-NLS-1$
}
);
- addDriverAndURLS("org.hibernate.dialect.MySQLInnoDBDialect",
- "org.gjt.mm.mysql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQLInnoDBDialect", //$NON-NLS-1$
+ "org.gjt.mm.mysql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>" }
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.MySQLMyISAMDialect",
- "org.gjt.mm.mysql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQLMyISAMDialect", //$NON-NLS-1$
+ "org.gjt.mm.mysql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>" }
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.MySQL5Dialect",
- "org.gjt.mm.mysql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQL5Dialect", //$NON-NLS-1$
+ "org.gjt.mm.mysql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>" }
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.MySQL5InnoDBDialect",
- "org.gjt.mm.mysql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.MySQL5InnoDBDialect", //$NON-NLS-1$
+ "org.gjt.mm.mysql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:mysql://<hostname>/<database>",
- "jdbc:mysql:///test",
- "jdbc:mysql:///<name>" }
+ "jdbc:mysql://<hostname>/<database>", //$NON-NLS-1$
+ "jdbc:mysql:///test", //$NON-NLS-1$
+ "jdbc:mysql:///<name>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.PostgreSQLDialect",
- "org.postgresql.Driver",
+ addDriverAndURLS("org.hibernate.dialect.PostgreSQLDialect", //$NON-NLS-1$
+ "org.postgresql.Driver", //$NON-NLS-1$
new String[] {
- "jdbc:postgresql:template1",
- "jdbc:postgresql:<name>" }
+ "jdbc:postgresql:template1", //$NON-NLS-1$
+ "jdbc:postgresql:<name>" } //$NON-NLS-1$
);
- addDriverAndURLS("org.hibernate.dialect.ProgressDialect",
- "com.progress.sql.jdbc.JdbcProgressDriver",
+ addDriverAndURLS("org.hibernate.dialect.ProgressDialect", //$NON-NLS-1$
+ "com.progress.sql.jdbc.JdbcProgressDriver", //$NON-NLS-1$
new String[] {
- "jdbc:JdbcProgress:T:host:port:dbname;WorkArounds=536870912",
+ "jdbc:JdbcProgress:T:host:port:dbname;WorkArounds=536870912", //$NON-NLS-1$
}
);
- addDriverAndURLS("org.hibernate.dialect.DB2Dialect", "COM.ibm.db2.jdbc.app.DB2Driver",
- new String[] { "jdbc:db2:test", "jdbc:db2:<name>" });
+ addDriverAndURLS("org.hibernate.dialect.DB2Dialect", "COM.ibm.db2.jdbc.app.DB2Driver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:db2:test", "jdbc:db2:<name>" }); //$NON-NLS-1$ //$NON-NLS-2$
- addDriverAndURLS("org.hibernate.dialect.DB2400Dialect", "com.ibm.as400.access.AS400JDBCDriver",
- new String[] { "jdbc:as400://<systemname>", "jdbc:db2:<name>" });
+ addDriverAndURLS("org.hibernate.dialect.DB2400Dialect", "com.ibm.as400.access.AS400JDBCDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:as400://<systemname>", "jdbc:db2:<name>" }); //$NON-NLS-1$ //$NON-NLS-2$
- addDriverAndURLS("org.hibernate.dialect.DerbyDialect", "org.apache.derby.jdbc.EmbeddedDriver",
- new String[] { "jdbc:derby:/test;create=true" });
+ addDriverAndURLS("org.hibernate.dialect.DerbyDialect", "org.apache.derby.jdbc.EmbeddedDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:derby:/test;create=true" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SybaseDialect", "com.sybase.jdbc2.jdbc.SybDriver",
- new String[] { "jdbc:sybase:Tds:co3061835-a:5000/tempdb" });
+ addDriverAndURLS("org.hibernate.dialect.SybaseDialect", "com.sybase.jdbc2.jdbc.SybDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:sybase:Tds:co3061835-a:5000/tempdb" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.MckoiDialect", "com.mckoi.JDBCDriver",
- new String[] { "jdbc:mckoi:///", "jdbc:mckoi:local://C:/mckoi1.00/db.conf" });
+ addDriverAndURLS("org.hibernate.dialect.MckoiDialect", "com.mckoi.JDBCDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:mckoi:///", "jdbc:mckoi:local://C:/mckoi1.00/db.conf" }); //$NON-NLS-1$ //$NON-NLS-2$
- addDriverAndURLS("org.hibernate.dialect.SAPDBDialect", "com.sap.dbtech.jdbc.DriverSapDB",
- new String[] { "jdbc:sapdb://localhost/TST" });
+ addDriverAndURLS("org.hibernate.dialect.SAPDBDialect", "com.sap.dbtech.jdbc.DriverSapDB", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:sapdb://localhost/TST" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.jnetdirect.jsql.JSQLDriver",
- new String[] { "jdbc:JSQLConnect://1E1/test" });
+ addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.jnetdirect.jsql.JSQLDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:JSQLConnect://1E1/test" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.newatlanta.jturbo.driver.Driver",
- new String[] { "jdbc:JTurbo://1E1:1433/test" });
+ addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.newatlanta.jturbo.driver.Driver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:JTurbo://1E1:1433/test" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "weblogic.jdbc.mssqlserver4.Driver",
- new String[] { "jdbc:weblogic:mssqlserver4:1E1:1433" });
+ addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "weblogic.jdbc.mssqlserver4.Driver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:weblogic:mssqlserver4:1E1:1433" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.microsoft.jdbc.sqlserver.SQLServerDriver",
- new String[] { "jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor" });
+ addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "com.microsoft.jdbc.sqlserver.SQLServerDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "net.sourceforge.jtds.jdbc.Driver",
- new String[] { "jdbc:jtds:sqlserver://1E1/test" });
+ addDriverAndURLS("org.hibernate.dialect.SQLServerDialect", "net.sourceforge.jtds.jdbc.Driver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:jtds:sqlserver://1E1/test" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.InterbaseDialect", "interbase.interclient.Driver",
- new String[] { "jdbc:interbase://localhost:3060/C:/firebird/test.gdb" });
+ addDriverAndURLS("org.hibernate.dialect.InterbaseDialect", "interbase.interclient.Driver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:interbase://localhost:3060/C:/firebird/test.gdb" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.InterbaseDialect", "org.firebirdsql.jdbc.FBDriver",
- new String[] { "jdbc:interbase://localhost:3060/C:/firebird/test.gdb" });
+ addDriverAndURLS("org.hibernate.dialect.InterbaseDialect", "org.firebirdsql.jdbc.FBDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:interbase://localhost:3060/C:/firebird/test.gdb" }); //$NON-NLS-1$
- addDriverAndURLS("org.hibernate.dialect.PointbaseDialect", "com.pointbase.jdbc.jdbcUniversalDriver",
- new String[] { "jdbc:pointbase:embedded:sample" });
+ addDriverAndURLS("org.hibernate.dialect.PointbaseDialect", "com.pointbase.jdbc.jdbcUniversalDriver", //$NON-NLS-1$ //$NON-NLS-2$
+ new String[] { "jdbc:pointbase:embedded:sample" }); //$NON-NLS-1$
}
/**
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -6,18 +6,19 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class LaunchHelper {
static public ILaunchConfiguration findLaunchConfigurationByName(String launchConfigurationTypeId, String name) throws CoreException {
- Assert.isNotNull(launchConfigurationTypeId, "Launch configuration type cannot be null");
+ Assert.isNotNull(launchConfigurationTypeId, HibernateConsoleMessages.LaunchHelper_launch_cfg_type_cannot_be_null);
ILaunchManager launchManager = DebugPlugin.getDefault()
.getLaunchManager();
-
-
+
+
ILaunchConfigurationType launchConfigurationType = launchManager
.getLaunchConfigurationType(launchConfigurationTypeId);
-
+
ILaunchConfiguration[] launchConfigurations = launchManager
.getLaunchConfigurations(launchConfigurationType);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/ProjectUtils.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,6 +42,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
@@ -52,51 +53,51 @@
public class ProjectUtils {
private ProjectUtils() {
-
+
}
-
+
public static boolean toggleHibernateOnProject(IProject project, boolean enable,String defaultConsoleName) {
IScopeContext scope = new ProjectScope(project);
-
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
-
+
+ Preferences node = scope.getNode("org.hibernate.eclipse.console"); //$NON-NLS-1$
+
if(node!=null) {
- node.putBoolean("hibernate3.enabled", enable );
- node.put("default.configuration", defaultConsoleName );
+ node.putBoolean("hibernate3.enabled", enable ); //$NON-NLS-1$
+ node.put("default.configuration", defaultConsoleName ); //$NON-NLS-1$
try {
node.flush();
} catch (BackingStoreException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not save changes to preferences", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.ProjectUtils_could_not_save_changes_to_preferences, e);
return false;
}
} else {
return false;
}
-
+
try {
if(enable) {
- return ProjectUtils.addProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+ return ProjectUtils.addProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); //$NON-NLS-1$
} else {
- return ProjectUtils.removeProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() );
+ return ProjectUtils.removeProjectNature(project, "org.hibernate.eclipse.console.hibernateNature", new NullProgressMonitor() ); //$NON-NLS-1$
}
} catch(CoreException ce) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not activate Hibernate nature on project " + project.getName(), ce);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.ProjectUtils_could_not_activate_hibernate_nature_on_project + project.getName(), ce);
HibernateConsolePlugin.getDefault().log(ce.getStatus() );
return false;
}
-
+
}
-
+
/**
* Add the given project nature to the given project (if it isn't already added).
* @return true if nature where added, false if not
- * @throws OperationCanceledException if job were cancelled or CoreException if something went wrong.
+ * @throws OperationCanceledException if job were cancelled or CoreException if something went wrong.
*/
public static boolean addProjectNature(IProject project, String nature, IProgressMonitor monitor) throws CoreException {
if (monitor != null && monitor.isCanceled() ) {
throw new OperationCanceledException();
}
-
+
if (!project.hasNature(nature) ) {
IProjectDescription description = project.getDescription();
String[] prevNatures= description.getNatureIds();
@@ -116,10 +117,10 @@
if (monitor != null && monitor.isCanceled() ) {
throw new OperationCanceledException();
}
-
+
if (project.hasNature(nature) ) {
IProjectDescription description = project.getDescription();
-
+
String[] natures = description.getNatureIds();
String[] newNatures = new String[natures.length - 1];
for(int i = 0; i < natures.length; i++) {
@@ -145,18 +146,18 @@
IFile file = null;
IProject project = null;
IJavaProject jProject = null;
-
+
IFileEditorInput fileInput = (IFileEditorInput) input;
file = fileInput.getFile();
project = file.getProject();
jProject = JavaCore.create(project);
-
+
return jProject;
}
-
+
return null;
- }
-
+ }
+
static public IJavaProject findJavaProject(String name) {
if(StringHelper.isEmpty( name )) {
return null;
@@ -182,9 +183,9 @@
for (int i = 0; i < launchConfigurations.length; i++) { // can't believe there is no look up by name API
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
if(launchConfiguration.getName().equals(consoleConfiguration.getName())) {
- proj = ProjectUtils.findJavaProject(launchConfiguration.getAttribute(IConsoleConfigurationLaunchConstants.PROJECT_NAME, ""));
+ proj = ProjectUtils.findJavaProject(launchConfiguration.getAttribute(IConsoleConfigurationLaunchConstants.PROJECT_NAME, "")); //$NON-NLS-1$
}
- }
+ }
} catch (CoreException e1) {
HibernateConsolePlugin.getDefault().log(e1);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/QLFormatHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -26,6 +26,6 @@
public class QLFormatHelper {
static public String formatForScreen(String query) {
- return new Formatter(query).setInitialString("").setIndentString(" ").format();
+ return new Formatter(query).setInitialString("").setIndentString(" ").format(); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/xpl/DialogSelectionHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/xpl/DialogSelectionHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/xpl/DialogSelectionHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -30,33 +30,34 @@
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceSorter;
import org.hibernate.eclipse.console.FileFilter;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class DialogSelectionHelper {
/**
- *
+ *
* Shows the UI to select new JAR or ZIP archive entries located in the workspace.
* The dialog returns the selected entries or <code>null</code> if the dialog has
* been cancelled. The dialog does not apply any changes.
* @param shell The parent shell for the dialog.
- * @param initialSelection The path of the element (container or archive) to initially select or <code>null</code> to not select an entry.
+ * @param initialSelection The path of the element (container or archive) to initially select or <code>null</code> to not select an entry.
* @param usedEntries An array of paths that are already on the classpath and therefore should not be
* selected again.
* @param fileExtensions An array of file extensions.
* @param allowMultiple allow multiple selections.
* @param allowFiles TODO
* @param acceptedTypes TODO
- *
+ *
* @return Returns the new classpath container entry paths or <code>null</code> if the dialog has
* been cancelled by the user.
- *
- * Inspired by BuildPathDialogAccess.chooseJAREntries from jdt.ui.wizards
+ *
+ * Inspired by BuildPathDialogAccess.chooseJAREntries from jdt.ui.wizards
*/
public static IPath[] chooseFileEntries(Shell shell, IPath initialSelection, IPath[] usedEntries, String title, String description, String[] fileExtensions, boolean allowMultiple, boolean allowDirectories, boolean allowFiles ) {
if (usedEntries == null) {
- throw new IllegalArgumentException("used entries must be not-null");
+ throw new IllegalArgumentException(HibernateConsoleMessages.DialogSelectionHelper_used_entries_must_be_notnull);
}
-
+
List clazzes = new ArrayList();
if(allowDirectories) {
clazzes.add(IFolder.class);
@@ -66,7 +67,7 @@
clazzes.add(IFile.class);
}
Class[] acceptedClasses = (Class[]) clazzes.toArray(new Class[clazzes.size()]);
-
+
TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
ArrayList usedFiles= new ArrayList(usedEntries.length);
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
@@ -77,7 +78,7 @@
}
}
IResource focus= initialSelection != null ? root.findMember(initialSelection) : null;
-
+
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider() );
dialog.setValidator(validator);
dialog.setAllowMultiple(allowMultiple);
@@ -99,22 +100,22 @@
}
return null;
}
-
+
public static IPath[] chooseFolderEntries(Shell shell, IPath initialSelection, String title, String description, boolean allowMultiple) {
List clazzes = new ArrayList();
clazzes.add(IFolder.class);
clazzes.add(IProject.class);
Class[] acceptedClasses = (Class[]) clazzes.toArray(new Class[clazzes.size()]);
-
+
TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, true);
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
IResource focus= initialSelection != null ? root.findMember(initialSelection) : null;
-
+
ElementTreeSelectionDialog dialog= null;
dialog = new FolderSelectionDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider() );
// dialog = new FileFolderSelectionDialog(shell, allowMultiple, allowDirectories ? IResource.FOLDER : IResource.FILE );
-
+
dialog.setValidator(validator);
dialog.setAllowMultiple(allowMultiple);
dialog.setTitle(title);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -30,24 +30,25 @@
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class ConsoleConfigurationPropertySource implements IPropertySource {
private final ConsoleConfiguration cfg;
-
+
static IPropertyDescriptor[] pd;
static {
List l = new ArrayList();
- l.add(new TextPropertyDescriptor("name", "Name"));
- l.add(new PropertyDescriptor("hibernate.cfg.xml", "Configuration file"));
- l.add(new PropertyDescriptor("hibernate.properties", "Properties file"));
- l.add(new PropertyDescriptor("mapping.files", "Additonal mapping files"));
-
-
+ l.add(new TextPropertyDescriptor("name", HibernateConsoleMessages.ConsoleConfigurationPropertySource_name)); //$NON-NLS-1$
+ l.add(new PropertyDescriptor("hibernate.cfg.xml", HibernateConsoleMessages.ConsoleConfigurationPropertySource_config_file)); //$NON-NLS-1$
+ l.add(new PropertyDescriptor("hibernate.properties", HibernateConsoleMessages.ConsoleConfigurationPropertySource_properties_file)); //$NON-NLS-1$
+ l.add(new PropertyDescriptor("mapping.files", HibernateConsoleMessages.ConsoleConfigurationPropertySource_additional_mapping_files)); //$NON-NLS-1$
+
+
pd = (IPropertyDescriptor[]) l.toArray( new IPropertyDescriptor[l.size()] );
}
-
+
public ConsoleConfigurationPropertySource(ConsoleConfiguration cfg) {
this.cfg = cfg;
}
@@ -62,25 +63,25 @@
public Object getPropertyValue(Object id) {
try {
- if("name".equals(id)) {
+ if("name".equals(id)) { //$NON-NLS-1$
return cfg.getName();
}
// TODO: bring back more eclipse friendly file names
ConsoleConfigurationPreferences preferences = cfg.getPreferences();
-
- if("hibernate.cfg.xml".equals(id)) {
+
+ if("hibernate.cfg.xml".equals(id)) { //$NON-NLS-1$
return preferences.getConfigXMLFile();
}
- if("hibernate.properties".equals(id)) {
+ if("hibernate.properties".equals(id)) { //$NON-NLS-1$
return preferences.getPropertyFile();
}
- if("mapping.files".equals(id)) {
+ if("mapping.files".equals(id)) { //$NON-NLS-1$
return new Integer(preferences.getMappingFiles().length);
}
-
+
return null;
} catch(RuntimeException e) {
- return "Error: " + e.getMessage();
+ return HibernateConsoleMessages.ConsoleConfigurationPropertySource_error + e.getMessage();
}
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -47,6 +47,7 @@
import org.hibernate.classic.Session;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.execution.ExecutionContext;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.QLFormatHelper;
import org.hibernate.eclipse.hqleditor.HQLEditor;
@@ -62,49 +63,49 @@
public class DynamicSQLPreviewView extends ViewPart {
private IPartListener2 partListener = new IPartListener2() {
-
+
public void partInputChanged(IWorkbenchPartReference partRef) {
-
+
}
-
+
public void partVisible(IWorkbenchPartReference partRef) {
-
+
}
-
- public void partHidden(IWorkbenchPartReference partRef) {
-
+
+ public void partHidden(IWorkbenchPartReference partRef) {
+
}
-
+
public void partOpened(IWorkbenchPartReference partRef) {
-
+
}
-
+
public void partDeactivated(IWorkbenchPartReference partRef) {
-
+
}
-
+
public void partClosed(IWorkbenchPartReference partRef) {
if(partRef.getPart(false)==currentEditor) {
setCurrentEditor(null);
}
}
-
+
public void partBroughtToTop(IWorkbenchPartReference partRef) {
hookIntoEditor(partRef);
}
-
+
public void partActivated(IWorkbenchPartReference partRef) {
- hookIntoEditor( partRef );
+ hookIntoEditor( partRef );
}
-
+
};
-
+
private SourceViewer textViewer;
private HQLEditor currentEditor;
private MonoReconciler reconciler;
- private HQLEditorDocumentSetupParticipant docSetupParticipant = new HQLEditorDocumentSetupParticipant();
+ private HQLEditorDocumentSetupParticipant docSetupParticipant = new HQLEditorDocumentSetupParticipant();
private void hookIntoEditor(IWorkbenchPartReference partRef) {
if(partRef==null) {
@@ -114,23 +115,23 @@
IWorkbenchPart part = partRef.getPart(false);
if(part!=null && (part instanceof HQLEditor)) {
setCurrentEditor((HQLEditor) part);
- }
+ }
}
private void setCurrentEditor(HQLEditor editor) {
if(editor==currentEditor) return;
- if(currentEditor!=null) {
+ if(currentEditor!=null) {
reconciler.uninstall();
}
-
+
currentEditor = editor;
-
+
if(currentEditor!=null) {
ITextViewer editorViewer = currentEditor.getTextViewer();
- reconciler.install(editorViewer);
+ reconciler.install(editorViewer);
}
-
+
updateText(currentEditor);
-
+
}
private void updateText(HQLEditor editor) {
@@ -138,33 +139,33 @@
if(editor!=null) {
ConsoleConfiguration consoleConfiguration = editor.getConsoleConfiguration();
if(StringHelper.isEmpty( editor.getQueryString() )) {
- textViewer.getDocument().set( "Empty HQL query." );
+ textViewer.getDocument().set( HibernateConsoleMessages.DynamicSQLPreviewView_empty_hql_query );
} else if(consoleConfiguration!=null) {
if(consoleConfiguration.isSessionFactoryCreated()) {
String generateSQL = generateSQL(consoleConfiguration.getExecutionContext(), consoleConfiguration.getSessionFactory(), editor.getQueryString());
if(StringHelper.isEmpty( generateSQL )) {
- textViewer.getDocument().set( "HQL was valid, but no SQL generated. Your configuration most likely does not have any mappings defined." );
+ textViewer.getDocument().set( HibernateConsoleMessages.DynamicSQLPreviewView_no_sql_generated );
} else {
textViewer.getDocument().set(generateSQL);
}
} else {
- textViewer.getDocument().set("Session factory not created for configuration: " + consoleConfiguration.getName());
+ textViewer.getDocument().set(HibernateConsoleMessages.DynamicSQLPreviewView_session_factory_not_created + consoleConfiguration.getName());
}
} else {
- textViewer.getDocument().set("No Console configuration associated with HQL Editor");
+ textViewer.getDocument().set(HibernateConsoleMessages.DynamicSQLPreviewView_no_console_conf_associated);
}
} else {
- textViewer.getDocument().set("No HQL Query editor");
- }
+ textViewer.getDocument().set(HibernateConsoleMessages.DynamicSQLPreviewView_no_hql_query_editor);
+ }
}
}
public String generateSQL(ExecutionContext context, final SessionFactory sf, final String query) {
- if(StringHelper.isEmpty(query)) return "";
-
+ if(StringHelper.isEmpty(query)) return ""; //$NON-NLS-1$
+
String result;
-
+
result = (String) context.execute(new ExecutionContext.Command() {
public Object execute() {
Session session = null;
@@ -172,60 +173,60 @@
SessionFactoryImpl sfimpl = (SessionFactoryImpl) sf; // hack - to get to the actual queries..
StringBuffer str = new StringBuffer(256);
HQLQueryPlan plan = new HQLQueryPlan(query, false, Collections.EMPTY_MAP, sfimpl);
-
+
QueryTranslator[] translators = plan.getTranslators();
for (int i = 0; i < translators.length; i++) {
QueryTranslator translator = translators[i];
if(translator.isManipulationStatement()) {
- str.append("Manipulation of " + i + ":");
+ str.append(HibernateConsoleMessages.DynamicSQLPreviewView_manipulation_of + i + ":"); //$NON-NLS-1$
Iterator iterator = translator.getQuerySpaces().iterator();
while ( iterator.hasNext() ) {
Object qspace = iterator.next();
str.append(qspace);
- if(iterator.hasNext()) { str.append(", "); }
+ if(iterator.hasNext()) { str.append(", "); } //$NON-NLS-1$
}
-
+
} else {
- Type[] returnTypes = translator.getReturnTypes();
- str.append(i +": ");
+ Type[] returnTypes = translator.getReturnTypes();
+ str.append(i +": "); //$NON-NLS-1$
for (int j = 0; j < returnTypes.length; j++) {
Type returnType = returnTypes[j];
str.append(returnType.getName());
- if(j<returnTypes.length-1) { str.append(", "); }
- }
+ if(j<returnTypes.length-1) { str.append(", "); } //$NON-NLS-1$
+ }
}
- str.append("\n-----------------\n");
+ str.append("\n-----------------\n"); //$NON-NLS-1$
Iterator sqls = translator.collectSqlStrings().iterator();
while ( sqls.hasNext() ) {
String sql = (String) sqls.next();
str.append(QLFormatHelper.formatForScreen(sql));
- str.append("\n\n");
+ str.append("\n\n"); //$NON-NLS-1$
}
}
return str.toString();
- } catch(Throwable t) {
+ } catch(Throwable t) {
if(session!=null) session.close();
//StringWriter sw = new StringWriter();
StringBuffer msgs = new StringBuffer();
-
+
Throwable cause = t;
while(cause!=null) {
msgs.append(t);
if(cause.getCause()==cause) {
cause=null;
- } else {
+ } else {
cause = cause.getCause();
- if(cause!=null) msgs.append("\nCaused by:\n");
+ if(cause!=null) msgs.append(HibernateConsoleMessages.DynamicSQLPreviewView_caused_by);
}
}
- //t.printStackTrace(new PrintWriter(sw));
+ //t.printStackTrace(new PrintWriter(sw));
//return sw.getBuffer().toString();
return msgs.toString();
}
-
+
}
});
-
+
return result;
}
@@ -237,9 +238,9 @@
docSetupParticipant.setup( doc );
- textViewer.getDocument().set("No HQL Query editor selected");
+ textViewer.getDocument().set(HibernateConsoleMessages.DynamicSQLPreviewView_no_hql_query_editor_selected);
textViewer.configure(new HQLSourceViewerConfiguration(null));
-
+
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
IPartService service = window.getPartService();
@@ -249,43 +250,43 @@
public void init(IViewSite site) throws PartInitException {
super.init(site);
-
+
IReconcilingStrategy strategy = new AbstractReconcilingStrategy() {
-
+
protected void doReconcile(final IDocument doc) {
Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
-
+
public void run() {
//textViewer.getDocument().set(doc.get());
updateText(currentEditor);
- }
- });
+ }
+ });
}
-
+
};
reconciler = new MonoReconciler(strategy,false);
- reconciler.setDelay(500);
-
+ reconciler.setDelay(500);
+
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
IPartService service = window.getPartService();
service.addPartListener(partListener);
-
+
hookIntoEditor(service.getActivePartReference());
-
+
}
-
+
public void dispose() {
IWorkbenchWindow window = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow();
- IPartService service = window.getPartService();
+ IPartService service = window.getPartService();
service.removePartListener(partListener);
docSetupParticipant.unsetup();
- super.dispose();
+ super.dispose();
}
-
+
public void setFocus() {
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabView.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageTabView.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -65,7 +65,7 @@
public class QueryPageTabView extends ViewPart implements ISelectionProvider {
- public static final String ID = "org.hibernate.eclipse.console.views.QueryPageTabView";
+ public static final String ID = "org.hibernate.eclipse.console.views.QueryPageTabView"; //$NON-NLS-1$
protected CTabFolder tabs = null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -38,6 +38,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Image;
@@ -48,6 +49,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.hibernate.console.QueryPage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -71,19 +73,20 @@
if (value.getClass().isArray() ) {
Object[] arr = (Object[]) value;
if (columnIndex > arr.length - 1) {
- return "<Unknown value>";
+ return HibernateConsoleMessages.QueryPageViewer_unknown_value;
}
- return "" + arr[columnIndex];
+ return "" + arr[columnIndex]; //$NON-NLS-1$
} else {
if(columnIndex!=0) {
- return "?";
+ return "?"; //$NON-NLS-1$
} else {
- return value == null ? "" : value.toString();
+ return value == null ? "" : value.toString(); //$NON-NLS-1$
}
}
}
- catch (RuntimeException e) {
- return "<error: " + e.getMessage() + ">";
+ catch (RuntimeException e) {
+ String out = NLS.bind(HibernateConsoleMessages.QueryPageViewer_error, e.getMessage());
+ return out;
}
}
public void addListener(ILabelProviderListener listener) {
@@ -99,13 +102,13 @@
public static final Object NULL_VALUE = new Object() {
-
+
public String toString() {
- return "<null>";
+ return "<null>"; //$NON-NLS-1$
}
-
+
};
-
+
// should map to our table model instead
class ContentProviderImpl implements IStructuredContentProvider {
public Object[] getElements(Object inputElement) {
@@ -116,8 +119,8 @@
return ensureNotNull(objects);
} else {
Throwable[] throwables = (Throwable[])qp.getExceptions().toArray(new Throwable[0]);
- HibernateConsolePlugin.getDefault().logErrorMessage("Exception while executing HQL Query", throwables);
- return throwables; // TODO: provide actual error page
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.QueryPageViewer_exception_while_executing_hql_query, throwables);
+ return throwables; // TODO: provide actual error page
}
} else {
return null;
@@ -138,36 +141,36 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
+
}
-
+
private final QueryPage queryPage;
private TableViewer tableViewer;
private CTabItem tabItem;
private final QueryPageTabView qrView;
-
+
public QueryPageViewer(QueryPageTabView qrView, QueryPage queryPage) {
this.qrView = qrView;
this.queryPage = queryPage;
-
+
createControl();
-
-
+
+
}
-
+
protected CTabItem getTabItem() {
return this.tabItem;
}
-
+
public Table getTable() {
return this.tableViewer.getTable();
}
-
+
protected void createControl() {
this.tabItem = new CTabItem(this.qrView.tabs, SWT.NONE);
this.tabItem.setData( this.queryPage );
- int index = this.qrView.tabs.getItems().length;
+ int index = this.qrView.tabs.getItems().length;
Composite composite = new Composite(this.qrView.tabs, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 5;
@@ -184,16 +187,16 @@
this.tabItem.setToolTipText(this.queryPage.getQuery() );
} else if (this.queryPage.isMetaData() ) {
this.tabItem.setImage(ImageStore.getImage(ImageStore.TABLE_DETAILS) );
- this.tabItem.setText(this.queryPage.getBookmark().getName() + ":" +
+ this.tabItem.setText(this.queryPage.getBookmark().getName() + ":" +
this.queryPage.getEntity().getQualifiedName() );
tabItem.setToolTipText(this.queryPage.getEntity().getQualifiedName() );
} else {
this.tabItem.setImage(ImageStore.getImage(ImageStore.TABLE) );
- this.tabItem.setText(this.queryPage.getBookmark().getName() + ":" +
+ this.tabItem.setText(this.queryPage.getBookmark().getName() + ":" +
this.queryPage.getEntity().getQualifiedName() );
this.tabItem.setToolTipText(this.queryPage.getEntity().getQualifiedName() );
}*/
-
+
createTable(composite);
this.tabItem.setControl(composite);
initializePopUpMenu();
@@ -222,7 +225,7 @@
tableDoubleClicked();
}
});
-
+
this.tableViewer.addSelectionChangedListener(new ISelectionChangedListener () {
public void selectionChanged(SelectionChangedEvent event) {
tableDoubleClicked();
@@ -239,7 +242,7 @@
qrView.fireSelectionChangedEvent(selection);
}
}
-
+
/**
* @param table
*/
@@ -266,9 +269,9 @@
}
public void propertyChange(PropertyChangeEvent event) {
- if ("rows".equals(event.getPropertyName() ) ) {
+ if ("rows".equals(event.getPropertyName() ) ) { //$NON-NLS-1$
this.tableViewer.refresh();
- } else if ("columns".equals(event.getPropertyName() ) ) {
+ } else if ("columns".equals(event.getPropertyName() ) ) { //$NON-NLS-1$
Table table = this.tableViewer.getTable();
TableColumn[] columns = table.getColumns();
for (int i = 0, length = columns == null ? 0 : columns.length; i < length; i++) {
@@ -281,7 +284,7 @@
}
// updateStatusLine();
}
-
+
public void dispose() {
//this.queryPage.removePropertyChangeListener(this);
this.tabItem.dispose();
@@ -290,7 +293,7 @@
protected QueryPage getQueryPage() {
return this.queryPage;
}
-
+
private void initializePopUpMenu() {
MenuManager manager = new MenuManager();
manager.setRemoveAllWhenShown(true);
@@ -301,13 +304,13 @@
});
Menu contextMenu = manager.createContextMenu(this.tableViewer.getControl() );
this.tableViewer.getControl().setMenu(contextMenu);
- // register the menu to the site so that we can allow
+ // register the menu to the site so that we can allow
// actions to be plugged in
//this.tableView.getSite().registerContextMenu(manager, this.tableView);
}
-
-
+
+
protected ISelection getSelection() {
return this.tableViewer.getSelection();
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersPage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -63,6 +63,7 @@
import org.hibernate.console.ConsoleQueryParameter;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.QueryInputModel;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.hql.classic.ParserHelper;
@@ -72,10 +73,10 @@
public class QueryParametersPage extends Page implements IQueryParametersPage {
- private static final String NAME_PROPERTY = "name";
- private static final String TYPE_PROPERTY = "type";
- private static final String VALUE_PROPERTY = "value";
- private static final String NULL_PROPERTY = "null_prop";
+ private static final String NAME_PROPERTY = "name"; //$NON-NLS-1$
+ private static final String TYPE_PROPERTY = "type"; //$NON-NLS-1$
+ private static final String VALUE_PROPERTY = "value"; //$NON-NLS-1$
+ private static final String NULL_PROPERTY = "null_prop"; //$NON-NLS-1$
private Composite top = null;
@@ -87,7 +88,7 @@
final QueryInputModel model;
- private ToggleActive toggleActive;
+ private ToggleActive toggleActive;
private Observer observer = new Observer() {
public void update(java.util.Observable o, Object arg) {
@@ -100,7 +101,7 @@
private final QueryEditor editor;
-
+
public QueryParametersPage(QueryEditor editor) {
this.editor = editor;
model = editor.getQueryInputModel();
@@ -108,26 +109,26 @@
public Control getControl() {
return top;
- }
-
+ }
+
public void createControl(Composite parent) {
top = new Composite( parent, SWT.NONE );
top.setLayout( new GridLayout() );
createQueryParametersTable();
createStatusLabel();
-
+
model.addObserver(observer);
-
+
toggleActive.setChecked(model.ignoreParameters());
tableViewer.getTable().setEnabled(!model.ignoreParameters());
tableViewer.setInput(model);
-
+
}
private void createStatusLabel() {
GridData gridData = new org.eclipse.swt.layout.GridData();
- gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
+ gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
statusLabel = new Label( top, SWT.NULL );
//statusLabel.setText("max");
@@ -138,11 +139,11 @@
queryParametersTable.setFocus();
}
-
+
/**
* This method initializes queryParametersTable
- *
+ *
*/
private void createQueryParametersTable() {
GridData gridData = new org.eclipse.swt.layout.GridData();
@@ -157,21 +158,21 @@
TableColumn nameColumn = new TableColumn( queryParametersTable,
SWT.NONE );
nameColumn.setWidth(100);
- nameColumn.setText( "Name" );
+ nameColumn.setText( HibernateConsoleMessages.QueryParametersPage_name );
TableColumn typeColumn = new TableColumn( queryParametersTable,
SWT.NONE );
typeColumn.setWidth(75);
- typeColumn.setText( "Type" );
+ typeColumn.setText( HibernateConsoleMessages.QueryParametersPage_type );
TableColumn valueColumn = new TableColumn( queryParametersTable,
SWT.NONE );
valueColumn.setWidth( 100 );
- valueColumn.setText( "Value" );
+ valueColumn.setText( HibernateConsoleMessages.QueryParametersPage_value );
TableColumn nullColumn = new TableColumn( queryParametersTable,
SWT.NONE );
nullColumn.setWidth( 32 );
- nullColumn.setText( "null?" );
-
-
+ nullColumn.setText( HibernateConsoleMessages.QueryParametersPage_null );
+
+
tableViewer = new TableViewer( queryParametersTable );
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@@ -180,26 +181,26 @@
if(statusLabel!=null) {
Object firstElement = ((IStructuredSelection)tableViewer.getSelection()).getFirstElement();
if(firstElement instanceof ConsoleQueryParameter) {
- statusLabel.setText("Format: " + ((ConsoleQueryParameter)firstElement).getDefaultFormat());
+ statusLabel.setText(HibernateConsoleMessages.QueryParametersPage_format + ((ConsoleQueryParameter)firstElement).getDefaultFormat());
} else {
- statusLabel.setText("");
+ statusLabel.setText(""); //$NON-NLS-1$
}
}
-
+
}
-
+
});
final List possibleTypes = new ArrayList(ConsoleQueryParameter.getPossibleTypes());
Collections.sort(possibleTypes, new Comparator() {
-
+
public int compare(Object o1, Object o2) {
Type t1 = (Type) o1;
Type t2 = (Type) o2;
return t1.getName().compareTo(t2.getName());
}
-
+
});
-
+
tableViewer.setCellModifier( new ICellModifier() {
public void modify(Object element, String property, Object value) {
@@ -217,7 +218,7 @@
if(i==((Integer)value).intValue()) {
if(cqp.getType()!=type) {
cqp.setType(type);
- cqp.setNull(); // have to reset to ensure it's working
+ cqp.setNull(); // have to reset to ensure it's working
}
break;
}
@@ -229,10 +230,10 @@
}
if ( NULL_PROPERTY.equals( property ) ) {
if(cqp.isNull()) {
- cqp.setValueFromString( "" ); // best attempt to "unnull"
+ cqp.setValueFromString( "" ); // best attempt to "unnull" //$NON-NLS-1$
} else {
cqp.setNull();
- }
+ }
}
tableViewer.refresh(cqp);
}
@@ -249,14 +250,14 @@
while(iterator.hasNext()) {
if (type == ((Type) iterator.next())) {
return new Integer(i);
- }
+ }
i++;
}
}
if ( VALUE_PROPERTY.equals( property ) ) {
return cqp.getValueAsString();
}
- if ( NULL_PROPERTY.equals( property )) {
+ if ( NULL_PROPERTY.equals( property )) {
return Boolean.valueOf(cqp.isNull());
}
return null;
@@ -282,10 +283,10 @@
String[] columnProperties = new String[] { NAME_PROPERTY, TYPE_PROPERTY, VALUE_PROPERTY, NULL_PROPERTY };
tableViewer.setColumnProperties( columnProperties );
-
-
+
+
String[] valueTypes = new String[possibleTypes.size()];
-
+
Iterator iterator = possibleTypes.iterator();
int i=0;
while ( iterator.hasNext() ) {
@@ -297,7 +298,7 @@
editors[1] = new ComboBoxCellEditor( queryParametersTable, valueTypes );
editors[2] = new TextCellEditor( queryParametersTable );
editors[3] = new CheckboxCellEditor( queryParametersTable );
-
+
tableViewer.setCellEditors( editors );
tableViewer.setLabelProvider( new ITableLabelProvider() {
@@ -342,49 +343,49 @@
}
} );
-
+
}
public void init(IPageSite site) {
super.init( site );
NewRowAction newRowAction = new NewRowAction();
site.getActionBars().getToolBarManager().add(newRowAction);
-
+
site.getActionBars().getToolBarManager().add(new RemoveRowAction());
-
+
toggleActive = new ToggleActive();
site.getActionBars().getToolBarManager().add(toggleActive);
-
+
}
private class NewRowAction extends Action {
public NewRowAction() {
- super( "" );
+ super( "" ); //$NON-NLS-1$
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.NEW_PARAMETER));
}
public void run() {
ConsoleQueryParameter[] queryParameters = model.getQueryParameters();
-
+
Map qp = new HashMap();
for (int i = 0; i < queryParameters.length; i++) {
ConsoleQueryParameter parameter = queryParameters[i];
qp.put(parameter.getName(), parameter);
}
-
+
model.clear();
-
+
String queryString = editor.getQueryString();
-
+
ConsoleQueryParameter cqp = null;
int[] positions = StringHelper.locateUnquoted( queryString, '?' );
for (int i = 0; i < positions.length; i++) {
- cqp = (ConsoleQueryParameter) qp.get(""+i);
+ cqp = (ConsoleQueryParameter) qp.get(""+i); //$NON-NLS-1$
if(cqp==null) {
- cqp = model.createUniqueParameter(""+i);
+ cqp = model.createUniqueParameter(""+i); //$NON-NLS-1$
}
model.addParameter( cqp );
}
-
+
StringTokenizer st = new StringTokenizer(queryString, ParserHelper.HQL_SEPARATORS);
Set result = new HashSet();
@@ -395,26 +396,26 @@
}
}
- Iterator iterator = result.iterator();
+ Iterator iterator = result.iterator();
while ( iterator.hasNext() ) {
String paramName = (String) iterator.next();
cqp = (ConsoleQueryParameter) qp.get(paramName);
if(cqp==null) {
- cqp = model.createUniqueParameter(paramName);
- }
+ cqp = model.createUniqueParameter(paramName);
+ }
model.addParameter(cqp);
}
-
+
/* if(cqp==null) {
cqp = model.createUniqueParameter("param");
model.addParameter( cqp );
}*/
}
}
-
+
private class RemoveRowAction extends Action {
public RemoveRowAction() {
- super( "" );
+ super( "" ); //$NON-NLS-1$
setImageDescriptor(getSite().getWorkbenchWindow().getWorkbench().getSharedImages().getImageDescriptor(org.eclipse.ui.ISharedImages.IMG_TOOL_DELETE));
}
@@ -429,26 +430,26 @@
}
}
}
-
+
private class ToggleActive extends Action {
public ToggleActive() {
- super("");
+ super(""); //$NON-NLS-1$
setChecked(false);
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.IGNORE_PARAMETER));
}
-
+
public void run() {
model.setIgnoreParameters(isChecked());
setChecked(model.ignoreParameters());
}
}
-
-
+
+
public void dispose() {
super.dispose();
-
+
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryParametersView.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -28,21 +28,22 @@
import org.eclipse.ui.part.MessagePage;
import org.eclipse.ui.part.PageBook;
import org.eclipse.ui.part.PageBookView;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.hqleditor.HQLEditor;
public class QueryParametersView extends PageBookView {
-
+
public QueryParametersView() {
super();
}
-
+
protected IPage createDefaultPage(PageBook book) {
MessagePage page = new MessagePage();
initPage(page);
page.createControl(book);
- page.setMessage("No HQL editor open");
- return page;
+ page.setMessage(HibernateConsoleMessages.QueryParametersView_no_hql_editor_open);
+ return page;
}
protected PageRec doCreatePage(IWorkbenchPart part) {
@@ -55,7 +56,7 @@
return new PageRec(part, page);
}
// There is no query parameters to outline
- return null;
+ return null;
}
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -6,6 +6,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -15,7 +16,7 @@
private StructuredViewer viewer;
protected ReloadConfigurationAction(StructuredViewer sv) {
- super("Rebuild configuration");
+ super(HibernateConsoleMessages.ReloadConfigurationAction_rebuild_configuration);
setEnabledWhenNoSessionFactory(true);
viewer = sv;
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.RELOAD) );
@@ -34,13 +35,13 @@
} catch (HibernateConsoleRuntimeException he) {
HibernateConsolePlugin.getDefault().showError(
viewer.getControl().getShell(),
- "Exception while connecting/starting Hibernate", he);
+ HibernateConsoleMessages.ReloadConfigurationAction_exception_while_start_hibernate, he);
} catch (UnsupportedClassVersionError ucve) {
HibernateConsolePlugin
.getDefault()
.showError(
viewer.getControl().getShell(),
- "Starting Hibernate resulted in a UnsupportedClassVersionError.\nThis can occur if you are running eclipse with JDK 1.4 and your domain classes require JDK 1.5. \n\nResolution: Run eclipse with JDK 1.5.",
+ HibernateConsoleMessages.ReloadConfigurationAction_starting_hibernate_resulted_exception,
ucve);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,16 +25,18 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.execution.ExecutionContext.Command;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction;
import org.hibernate.tool.hbm2ddl.SchemaExport;
/**
* @author max
- *
+ *
*/
public class SchemaExportAction extends ConsoleConfigurationBasedAction {
@@ -51,7 +53,7 @@
* @param selectionProvider
*/
public SchemaExportAction(StructuredViewer selectionProvider) {
- super( "Run SchemaExport" );
+ super( HibernateConsoleMessages.SchemaExportAction_run_schemaexport );
this.viewer = selectionProvider;
}
@@ -63,11 +65,11 @@
final ConsoleConfiguration config = (ConsoleConfiguration) node;
config.execute( new Command() {
public Object execute() {
- if ( config.getConfiguration() != null
+ String out = NLS.bind(HibernateConsoleMessages.SchemaExportAction_sure_run_schemaexport, config.getName());
+ if ( config.getConfiguration() != null
&& MessageDialog.openConfirm( viewer.getControl().getShell(),
- "Run SchemaExport",
- "Are you sure you want to run SchemaExport on '"
- + config.getName() + "'?" ) ) {
+ HibernateConsoleMessages.SchemaExportAction_run_schemaexport,
+ out ) ) {
SchemaExport export = new SchemaExport( config
.getConfiguration() );
export.create( false, true );
@@ -77,15 +79,13 @@
int cnt = 1;
while ( iterator.hasNext() ) {
Throwable element = (Throwable) iterator.next();
- HibernateConsolePlugin.getDefault().logErrorMessage("Error #"
- + cnt++
- + " while performing SchemaExport",
- element );
+ String outStr = NLS.bind(HibernateConsoleMessages.SchemaExportAction_errornum_while_performing_schemaexport, cnt++);
+ HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element );
}
HibernateConsolePlugin.getDefault().showError(viewer.getControl().getShell(),
cnt
- 1
- + " error(s) while performing SchemaExport, see Error Log for details",
+ + HibernateConsoleMessages.SchemaExportAction_error_while_performing_schemaexport,
(Throwable)null );
}
}
@@ -100,14 +100,14 @@
catch (HibernateException he) {
HibernateConsolePlugin.getDefault().showError(
viewer.getControl().getShell(),
- "Exception while running SchemaExport", he );
+ HibernateConsoleMessages.SchemaExportAction_exception_running_schemaexport, he );
}
}
}
/*
* (non-Javadoc)
- *
+ *
* @see org.hibernate.eclipse.console.actions.SessionFactoryBasedAction#updateState(org.hibernate.console.ConsoleConfiguration)
*/
protected boolean updateState(ConsoleConfiguration consoleConfiguration) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/ClearPlaceHolderJob.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/ClearPlaceHolderJob.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/ClearPlaceHolderJob.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -4,7 +4,7 @@
* are 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:/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
@@ -33,6 +33,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.ui.progress.UIJob;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.views.navigator.PendingJob.NonConflictingRule;
public class ClearPlaceHolderJob extends UIJob {
@@ -43,14 +44,14 @@
private Object parent;
public ClearPlaceHolderJob(AbstractTreeViewer viewer, PendingNode placeHolder, Object parent, Object[] children) {
- super("Removing place holder for pending node");
+ super(HibernateConsoleMessages.ClearPlaceHolderJob_removing_place_holder);
this.viewer = viewer;
- this.placeHolder = placeHolder;
+ this.placeHolder = placeHolder;
this.parent = parent;
this.children = children;
setRule(NonConflictingRule.INSTANCE);
}
-
+
public IStatus runInUIThread(IProgressMonitor monitor) {
viewer.remove(placeHolder);
viewer.add(parent, children);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/PendingNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/PendingNode.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/navigator/PendingNode.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,13 +23,14 @@
import org.eclipse.swt.graphics.Image;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
public class PendingNode {
private static Image[] loadingImage;
-
+
static {
try {
loadingImage = new Image[4];
@@ -38,17 +39,17 @@
loadingImage[2] = EclipseImages.getImage( ImageConstants.EXECUTE );
loadingImage[3] = EclipseImages.getImage( ImageConstants.HQL_EDITOR );
} catch (RuntimeException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage( "Error while getting images", e );
+ HibernateConsolePlugin.getDefault().logErrorMessage( HibernateConsoleMessages.PendingNode_error_getting_images, e );
throw new ExceptionInInitializerError(e);
}
}
-
- private String text[];
+
+ private String text[];
private int count = 0;
-
+
public PendingNode(String type) {
text = new String[4];
- text[0] = "Pending " + type;
+ text[0] = HibernateConsoleMessages.PendingNode_pending + type;
text[1] = text + "."; //$NON-NLS-1$
text[2] = text + ".."; //$NON-NLS-1$
text[3] = text + "..."; //$NON-NLS-1$
@@ -61,5 +62,5 @@
public Image getImage() {
count++;
return loadingImage[count % 4];
- }
+ }
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/CollectionPropertySource.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -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);
+ properties[i] = new PropertyDescriptor(new Integer(i),"#" + i); //$NON-NLS-1$
}
descriptors = properties;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/EntityPropertySource.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -30,6 +30,7 @@
import org.hibernate.Session;
import org.hibernate.console.execution.ExecutionContextHolder;
import org.hibernate.console.execution.ExecutionContext.Command;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metadata.CollectionMetadata;
import org.hibernate.proxy.HibernateProxyHelper;
@@ -40,11 +41,11 @@
{
private Object reflectedObject;
private IPropertyDescriptor[] propertyDescriptors;
-
+
private final ExecutionContextHolder currentConfiguration;
private final Session currentSession;
private ClassMetadata classMetadata;
-
+
public EntityPropertySource (final Object object, final Session currentSession, ExecutionContextHolder currentConfiguration)
{
this.currentSession = currentSession;
@@ -55,92 +56,92 @@
} else {
classMetadata = currentSession.getSessionFactory().getClassMetadata( HibernateProxyHelper.getClassWithoutInitializingProxy(reflectedObject));
}
-
+
}
-
-
+
+
public Object getEditableValue() {
- return "";
+ return ""; //$NON-NLS-1$
}
-
+
public IPropertyDescriptor[] getPropertyDescriptors() {
if(propertyDescriptors==null) {
currentConfiguration.getExecutionContext().execute(new Command() {
-
+
public Object execute() {
-
+
propertyDescriptors = initializePropertyDescriptors(classMetadata);
return null;
}
-
+
});
}
return propertyDescriptors;
}
-
+
static protected IPropertyDescriptor[] initializePropertyDescriptors(ClassMetadata classMetadata) {
-
+
String[] propertyNames = classMetadata.getPropertyNames();
int length = propertyNames.length;
-
+
PropertyDescriptor identifier = null;
-
- if(classMetadata.hasIdentifierProperty() ) {
+
+ if(classMetadata.hasIdentifierProperty() ) {
identifier = new PropertyDescriptor(classMetadata.getIdentifierPropertyName(), classMetadata.getIdentifierPropertyName());
- identifier.setCategory("Identifier");
+ identifier.setCategory(HibernateConsoleMessages.EntityPropertySource_identifier);
length++;
}
-
+
PropertyDescriptor[] properties = new PropertyDescriptor[length];
-
+
int idx = 0;
if(identifier!=null) {
- properties[idx++] = identifier;
+ properties[idx++] = identifier;
}
-
+
for (int i = 0; i < propertyNames.length; i++) {
PropertyDescriptor prop = new PropertyDescriptor(propertyNames[i],propertyNames[i]);
- prop.setCategory("Properties");
- properties[i+idx] = prop;
+ prop.setCategory(HibernateConsoleMessages.EntityPropertySource_properties);
+ properties[i+idx] = prop;
}
-
+
return properties;
}
public Object getPropertyValue(Object id) {
Object propertyValue;
-
+
if(id.equals(classMetadata.getIdentifierPropertyName())) {
- propertyValue = classMetadata.getIdentifier(reflectedObject, EntityMode.POJO);
+ propertyValue = classMetadata.getIdentifier(reflectedObject, EntityMode.POJO);
} else {
- propertyValue = classMetadata.getPropertyValue(reflectedObject, (String)id, EntityMode.POJO);
- }
-
+ propertyValue = classMetadata.getPropertyValue(reflectedObject, (String)id, EntityMode.POJO);
+ }
+
if (propertyValue instanceof Collection) {
- CollectionMetadata collectionMetadata = currentSession.getSessionFactory().getCollectionMetadata(classMetadata.getEntityName() + "." + id);
+ CollectionMetadata collectionMetadata = currentSession.getSessionFactory().getCollectionMetadata(classMetadata.getEntityName() + "." + id); //$NON-NLS-1$
if(collectionMetadata!=null) {
propertyValue = new CollectionPropertySource((Collection) propertyValue,currentSession,currentConfiguration, collectionMetadata);
}
}
return propertyValue;
}
-
- public boolean isPropertySet(Object id) {
+
+ public boolean isPropertySet(Object id) {
return false; // we can not decide this at the given point.
}
-
+
public void resetPropertyValue(Object id) {
-
+
}
-
+
public void setPropertyValue(Object id, Object value) {
// lets not support editing in the raw properties view - to flakey ui.
//classMetadata.setPropertyValue(reflectedObject, (String) id, value, EntityMode.POJO);
}
-
+
public boolean isPropertyResettable(Object id) {
return false;
}
-
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/properties/QueryPagePropertySource.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -26,63 +26,64 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.hibernate.console.QueryPage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class QueryPagePropertySource implements IPropertySource2
-{
+{
private final QueryPage page;
static IPropertyDescriptor[] descriptors;
- private static final String QUERY_TEXT = "QueryPage.queryString";
+ private static final String QUERY_TEXT = "QueryPage.queryString"; //$NON-NLS-1$
- private static final Object CONFIGURATION_TEXT = "QueryPage.consoleConfiguration";
-
- private static final String QUERY_SIZE = "QueryPage.size";
-
- private static final String QUERY_TIME = "QueryPage.time";
-
+ private static final Object CONFIGURATION_TEXT = "QueryPage.consoleConfiguration"; //$NON-NLS-1$
+
+ private static final String QUERY_SIZE = "QueryPage.size"; //$NON-NLS-1$
+
+ private static final String QUERY_TIME = "QueryPage.time"; //$NON-NLS-1$
+
static {
descriptors = new IPropertyDescriptor[4];
PropertyDescriptor descriptor;
// query string
descriptor = new TextPropertyDescriptor(QUERY_TEXT,
- "Query string");
+ HibernateConsoleMessages.QueryPagePropertySource_query_string);
descriptor.setAlwaysIncompatible(false);
//descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
descriptors[0] = descriptor;
-
+
// configuration name
descriptor = new TextPropertyDescriptor(CONFIGURATION_TEXT,
- "Console configuration");
+ HibernateConsoleMessages.QueryPagePropertySource_console_configuration);
descriptor.setAlwaysIncompatible(false);
//descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
descriptors[1] = descriptor;
-
+
// number of items
descriptor = new TextPropertyDescriptor(QUERY_SIZE,
- "Query size");
+ HibernateConsoleMessages.QueryPagePropertySource_query_size);
descriptor.setAlwaysIncompatible(false);
//descriptor.setCategory(IResourcePropertyConstants.P_FILE_SYSTEM_CATEGORY);
descriptors[2] = descriptor;
-
+
// time of query running
descriptor = new TextPropertyDescriptor(QUERY_TIME,
- "Query run time");
+ HibernateConsoleMessages.QueryPagePropertySource_query_run_time);
descriptor.setAlwaysIncompatible(false);
descriptors[3] = descriptor;
}
-
+
public QueryPagePropertySource (QueryPage page) {
- this.page = page;
+ this.page = page;
}
- public boolean isPropertyResettable(Object id) {
+ public boolean isPropertyResettable(Object id) {
return false;
}
public Object getEditableValue() {
- return "";
+ return ""; //$NON-NLS-1$
}
public IPropertyDescriptor[] getPropertyDescriptors() {
@@ -98,28 +99,28 @@
}
if(QUERY_SIZE.equals(id) ) {
int resultSize = page.getResultSize();
- return resultSize==-1?"(unknown)":resultSize;
+ return resultSize==-1?HibernateConsoleMessages.QueryPagePropertySource_unknown:resultSize;
}
if(QUERY_TIME.equals(id) ) {
long resultTime = page.getQueryTime();
- if (resultTime==-1) return"(unknown)";
- if (resultTime > 1000) return (resultTime / 1000) + "." + (resultTime / 100) % 10 +" sec";
- return resultTime + " millisec";
+ if (resultTime==-1) return HibernateConsoleMessages.QueryPagePropertySource_unknown;
+ if (resultTime > 1000) return (resultTime / 1000) + "." + (resultTime / 100) % 10 +HibernateConsoleMessages.QueryPagePropertySource_sec; //$NON-NLS-1$
+ return resultTime + HibernateConsoleMessages.QueryPagePropertySource_millisec;
}
-
- return null;
+
+ return null;
}
public boolean isPropertySet(Object id) {
return false;
}
- public void resetPropertyValue(Object id) {
-
+ public void resetPropertyValue(Object id) {
+
}
public void setPropertyValue(Object id, Object value) {
-
-
+
+
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationCreationWizard.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -46,6 +46,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.INewWizard;
@@ -58,6 +59,7 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.utils.ProjectUtils;
@@ -83,7 +85,7 @@
setDefaultPageImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.NEW_WIZARD) );
setNeedsProgressMonitor(true);
}
-
+
/**
* Adding the page to the wizard.
*/
@@ -117,7 +119,7 @@
final String persistenceUnitName = confPage.getPersistenceUnitName();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
- try {
+ try {
createConsoleConfiguration(confPage.getShell(), confPage.getOldConfiguration(), configName, annotations, projectName, useProjectClasspath, entityResolver, propertyFile, fileName, mappings, classpaths, persistenceUnitName, namingStrategy, monitor);
} catch (CoreException e) {
throw new InvocationTargetException(e);
@@ -131,21 +133,21 @@
} catch (InterruptedException e) {
return false;
} catch (InvocationTargetException e) {
- Throwable realException = e.getTargetException();
+ Throwable realException = e.getTargetException();
IStatus s = null;
if(realException instanceof CoreException) {
s = ( (CoreException)realException).getStatus();
} else {
- IStatus se = HibernateConsolePlugin.throwableToStatus( e );
- s = new MultiStatus(HibernateConsolePlugin.ID, IStatus.OK, new IStatus[] { se }, "Probably missing classes or errors with classloading", e);
-
+ IStatus se = HibernateConsolePlugin.throwableToStatus( e );
+ s = new MultiStatus(HibernateConsolePlugin.ID, IStatus.OK, new IStatus[] { se }, HibernateConsoleMessages.ConsoleConfigurationCreationWizard_missing_classes, e);
+
}
- HibernateConsolePlugin.getDefault().showError( container.getShell(), "Error while finishing Wizard", s );
+ HibernateConsolePlugin.getDefault().showError( container.getShell(), HibernateConsoleMessages.ConsoleConfigurationCreationWizard_error_finishing, s );
return false;
}
return true;
}
-
+
static protected void createConsoleConfiguration(
final Shell shell,
final EclipseConsoleConfiguration oldConfig,
@@ -154,40 +156,40 @@
IPath cfgFile, IPath[] mappings, IPath[] classpaths, String persistenceUnitName, String namingStrategy, IProgressMonitor monitor)
throws CoreException {
- monitor.beginTask("Configuring Hibernate Console", IProgressMonitor.UNKNOWN);
-
+ monitor.beginTask(HibernateConsoleMessages.ConsoleConfigurationCreationWizard_configuring_hibernate_console, IProgressMonitor.UNKNOWN);
+
//ConsoleConfigurationPreferences ccp = createOldConsoleConfiguration( configName, cmode, projectName, useProjectClasspath, entityResolver, propertyFilename, cfgFile, mappings, classpaths, persistenceUnitName, namingStrategy );
-
+
if(oldConfig!=null) {
KnownConfigurations.getInstance().removeConfiguration( oldConfig, false );
}
-
+
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType( ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID );
- String launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(configName);
+ String launchName = launchManager.generateUniqueLaunchConfigurationNameFrom(configName);
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null, launchName);
wc.setAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, cmode.toString());
wc.setAttribute( IConsoleConfigurationLaunchConstants.PROJECT_NAME, projectName );
-
+
wc.setAttribute( IConsoleConfigurationLaunchConstants.PROPERTY_FILE, safePathName(propertyFilename) );
wc.setAttribute( IConsoleConfigurationLaunchConstants.CFG_XML_FILE, safePathName(cfgFile) );
wc.setAttribute( IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, persistenceUnitName );
-
+
wc.setAttribute( IConsoleConfigurationLaunchConstants.NAMING_STRATEGY, namingStrategy );
wc.setAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, entityResolver );
-
+
IRuntimeClasspathEntry[] projectEntries = new IRuntimeClasspathEntry[0];
if(useProjectClasspath) {
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
projectEntries = JavaRuntime.computeUnresolvedRuntimeClasspath(wc);
-
+
}
-
+
if(classpaths.length>0) {
List user = new ArrayList();
for (int i = 0; i < projectEntries.length; i++) {
- user.add( projectEntries[i].getMemento() );
- }
+ user.add( projectEntries[i].getMemento() );
+ }
for (int i = 0; i < classpaths.length; i++) {
IPath entry = classpaths[i];
IRuntimeClasspathEntry userEntry = JavaRuntime.newArchiveRuntimeClasspathEntry( entry );
@@ -195,49 +197,52 @@
}
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, user);
- } else {
+ } else {
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, (String)null);
}
-
+
List mappingFiles = new ArrayList();
for (int i = 0; i < mappings.length; i++) {
- mappingFiles.add(mappings[i].toPortableString());
+ mappingFiles.add(mappings[i].toPortableString());
}
wc.setAttribute( IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, mappingFiles );
-
+
wc.doSave();
-
+
Display.getDefault().syncExec(new Runnable() {
public void run() {
if(StringHelper.isNotEmpty( projectName )) {
IJavaProject project = ProjectUtils.findJavaProject( projectName );
- if(project.exists()) {
+ if(project.exists()) {
HibernateNature hibernateNature = HibernateNature.getHibernateNature( project );
if(hibernateNature==null) { // project not enabled at all
- if( MessageDialog.openConfirm( shell, "Enable Hibernate features for project", "The project named '" + projectName + "' does not have Hibernate features enabled. Should it be updated to use " + configName + " ?")) {
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationCreationWizard_the_project, projectName, configName);
+ if( MessageDialog.openConfirm( shell, HibernateConsoleMessages.ConsoleConfigurationCreationWizard_enable_hibernate_features, out)) {
ProjectUtils.toggleHibernateOnProject( project.getProject(), true, configName );
}
}
- else {
+ else {
String defaultConsoleConfigurationName = hibernateNature.getDefaultConsoleConfigurationName();
-
+
if((oldConfig!=null && oldConfig.getName().equals(defaultConsoleConfigurationName)) ||
defaultConsoleConfigurationName.equals(hibernateNature.getDefaultConsoleConfigurationName())) { // an update so its just forced in there.
ProjectUtils.toggleHibernateOnProject( project.getProject(), true, configName );
- } else if(defaultConsoleConfigurationName==null) {
- if(MessageDialog.openConfirm( shell, "Enable Hibernate features for project", "The project named " + projectName + " does not have a default Hibernate configuration specified. Should it be updated to use " + configName + " ?")) {
+ } else if(defaultConsoleConfigurationName==null) {
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationCreationWizard_the_project_named, projectName, configName);
+ if(MessageDialog.openConfirm( shell, HibernateConsoleMessages.ConsoleConfigurationCreationWizard_enable_hibernate_features, out)) {
ProjectUtils.toggleHibernateOnProject( project.getProject(), true, configName );
}
} else { // hibernate enabled, but not this exact one
- if(MessageDialog.openConfirm( shell, "Enable Hibernate features for project", "The project named " + projectName + " have the " + defaultConsoleConfigurationName + " specified. Should it be updated to use " + configName + " ?")) {
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationCreationWizard_the_project_named_have, new Object[]{ projectName, defaultConsoleConfigurationName, configName });
+ if(MessageDialog.openConfirm( shell, HibernateConsoleMessages.ConsoleConfigurationCreationWizard_enable_hibernate_features, out)) {
ProjectUtils.toggleHibernateOnProject( project.getProject(), true, configName );
}
- }
+ }
}
- }
+ }
}
-
+
}});
monitor.worked(1);
}
@@ -250,9 +255,9 @@
}
}
-
-
+
+
/**
* We will accept the selection in the workbench to see if
* we can initialize from it.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -55,6 +55,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -78,6 +79,7 @@
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.eclipse.console.EclipseConsoleConfiguration;
import org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
@@ -88,25 +90,25 @@
/**
* @author max
*
- *
+ *
*/
public class ConsoleConfigurationWizardPage extends WizardPage {
-
+
private Text propertyFileText;
private Text configurationFileText;
private Text configurationNameText;
private Text projectNameText;
private Text persistenceUnitNameText;
-
-
+
+
private EclipseConsoleConfiguration oldConfiguaration = null;
Button coreMode;
Button jpaMode;
Button annotationsMode;
-
+
private Text entityResolverClassNameText;
private Text namingStrategyClassNameText;
-
+
private ISelection selection;
private UpDownListComposite mappingFilesViewer;
private UpDownListComposite classPathViewer;
@@ -115,55 +117,55 @@
private Button entbutton;
private Button useProjectClassPath;
private Button nambutton;
-
+
/**
* Constructor for SampleNewWizardPage.
* @param pageName
*/
public ConsoleConfigurationWizardPage(ISelection selection) {
- super("configurationPage");
- setTitle("Create Hibernate Console Configuration");
- setDescription("This wizard allows you to create a configuration for Hibernate Console.");
- this.selection = selection;
+ super(HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_page);
+ setTitle(HibernateConsoleMessages.ConsoleConfigurationWizardPage_create_hibernate_console_config);
+ setDescription(HibernateConsoleMessages.ConsoleConfigurationWizardPage_this_wizard_allows);
+ this.selection = selection;
}
-
+
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
TabFolder folder = new TabFolder(parent,SWT.TOP);
-
+
//Composite container = new Composite(parent, SWT.NULL);
-
+
GridLayout layout = new GridLayout();
//container.setLayout(layout);
layout.numColumns = 3;
- layout.verticalSpacing = 9;
-
+ layout.verticalSpacing = 9;
+
GridData gd;
-
+
ModifyListener modifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
};
-
-
- Composite general = createGeneral( folder, modifyListener );
+
+
+ Composite general = createGeneral( folder, modifyListener );
TabItem item = new TabItem(folder, SWT.NONE);
item.setControl( general );
- item.setText( "General" );
-
+ item.setText( HibernateConsoleMessages.ConsoleConfigurationWizardPage_general );
+
Composite composite = buildClassPathTable(folder);
item = new TabItem(folder, SWT.NONE);
item.setControl( composite );
- item.setText( "Classpath" );
-
+ item.setText( HibernateConsoleMessages.ConsoleConfigurationWizardPage_classpath );
+
composite = buildMappingFileTable(folder);
item = new TabItem(folder, SWT.NONE);
item.setControl( composite );
- item.setText( "Mappings" );
-
+ item.setText( HibernateConsoleMessages.ConsoleConfigurationWizardPage_mappings );
+
initialize(selection);
dialogChanged();
setControl(folder);
@@ -173,141 +175,141 @@
Composite container = new Composite(parent, SWT.NULL);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
- gridLayout.verticalSpacing = 9;
-
+ gridLayout.verticalSpacing = 9;
+
container.setLayout(gridLayout);
Label label;
Button button;
GridData gd;
label = new Label(container, SWT.NULL);
- label.setText("&Name:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_name);
+
configurationNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
- configurationNameText.setLayoutData(gd);
+ configurationNameText.setLayoutData(gd);
configurationNameText.addModifyListener(modifyListener);
-
+
label = new Label(container, SWT.NULL);
- label.setText("Pro&ject:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_project);
+
projectNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
projectNameText.setLayoutData(gd);
projectNameText.addModifyListener(modifyListener);
-
+
button = new Button(container, SWT.PUSH);
- button.setText("Browse...");
+ button.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_browse);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleProjectBrowse();
}
});
-
+
//label = new Label(container, SWT.NULL);
createConfigurationMode( container );
-
-
+
+
label = new Label(container, SWT.NULL);
- label.setText("&Property file:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_property_file_2);
+
propertyFileText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
propertyFileText.setLayoutData(gd);
propertyFileText.addModifyListener(modifyListener);
-
-
+
+
button = new Button(container, SWT.PUSH);
- button.setText("Browse...");
+ button.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_browse);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handlePropertyFileBrowse();
}
});
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Configuration file:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_file);
+
configurationFileText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
configurationFileText.setLayoutData(gd);
configurationFileText.addModifyListener(modifyListener);
-
+
confbutton = new Button(container, SWT.PUSH);
- confbutton.setText("Browse...");
+ confbutton.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_browse);
confbutton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleConfigurationFileBrowse();
}
});
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Persistence unit:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_persistence_unit);
+
persistenceUnitNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
persistenceUnitNameText.setLayoutData(gd);
persistenceUnitNameText.addModifyListener(modifyListener);
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Naming strategy:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_naming_strategy);
+
namingStrategyClassNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
- namingStrategyClassNameText.setLayoutData(gd);
+ namingStrategyClassNameText.setLayoutData(gd);
namingStrategyClassNameText.addModifyListener(modifyListener);
-
+
nambutton = new Button(container, SWT.PUSH);
- nambutton.setText("Browse...");
+ nambutton.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_browse);
nambutton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleNamingStrategyBrowse();
}
});
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Entity resolver:");
-
+ label.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_entity_resolver);
+
entityResolverClassNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
- entityResolverClassNameText.setLayoutData(gd);
+ entityResolverClassNameText.setLayoutData(gd);
entityResolverClassNameText.addModifyListener(modifyListener);
-
+
entbutton = new Button(container, SWT.PUSH);
- entbutton.setText("Browse...");
+ entbutton.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_browse);
entbutton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleEntityResolverBrowse();
}
});
-
-
+
+
return container;
}
-
+
private void createConfigurationMode(Composite container) {
SelectionListener sl = new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
dialogChanged();
- }
+ }
};
- new Label(container, SWT.NULL).setText( "Type:" );
+ new Label(container, SWT.NULL).setText( HibernateConsoleMessages.ConsoleConfigurationWizardPage_type );
Group group = new Group( container, SWT.SHADOW_IN);
//group.setText("Choose Hibernate configuration");
group.setLayout( new RowLayout( SWT.HORIZONTAL ) );
coreMode = new Button(group, SWT.RADIO);
- coreMode.setText("Core");
+ coreMode.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_core);
coreMode.addSelectionListener( sl );
coreMode.setSelection( true );
annotationsMode = new Button(group, SWT.RADIO);
- annotationsMode.setText("Annotations (jdk 1.5+)");
+ annotationsMode.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_annotations);
annotationsMode.addSelectionListener( sl );
jpaMode = new Button(group, SWT.RADIO);
- jpaMode.setText("JPA (jdk 1.5+)");
+ jpaMode.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_jpa);
jpaMode.addSelectionListener( sl );
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
@@ -315,56 +317,56 @@
}
protected void handleEntityResolverBrowse() {
- String string = DialogSelectionHelper.chooseImplementation(EntityResolver.class.getName(), entityResolverClassNameText.getText(), "Select entity resolver class", getShell());
+ String string = DialogSelectionHelper.chooseImplementation(EntityResolver.class.getName(), entityResolverClassNameText.getText(), HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_entity_resolver_class, getShell());
if(string!=null) {
entityResolverClassNameText.setText(string);
}
}
-
+
protected void handleNamingStrategyBrowse() {
- String string = DialogSelectionHelper.chooseImplementation(NamingStrategy.class.getName(), namingStrategyClassNameText.getText(), "Select naming strategy class", getShell());
+ String string = DialogSelectionHelper.chooseImplementation(NamingStrategy.class.getName(), namingStrategyClassNameText.getText(), HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_naming_strategy_class, getShell());
if(string!=null) {
namingStrategyClassNameText.setText(string);
- }
+ }
}
-
+
private Composite buildClassPathTable(Composite parent) {
Composite c = new Composite(parent, SWT.None);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
gridLayout.verticalSpacing = 9;
c.setLayout( gridLayout );
-
- classPathViewer = new UpDownListComposite(c, SWT.NONE, "Additional classpath (Hibernate jars not necessary!)") {
+
+ classPathViewer = new UpDownListComposite(c, SWT.NONE, HibernateConsoleMessages.ConsoleConfigurationWizardPage_additional_classpath) {
protected Object[] handleAdd(int idx) {
TableItem[] items = getTable().getItems();
IPath[] exclude = new IPath[items.length];
-
+
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
- exclude[i] = (IPath) item.getData();
+ exclude[i] = (IPath) item.getData();
}
-
+
switch (idx) {
case 0:
- return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, "Add classpath entry", "Add a directory, .zip or .jar file", new String[] { ".jar", ".zip" }, true, true, true);
+ return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_classpath_entry, HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_directory_zip_jar, new String[] { HibernateConsoleMessages.ConsoleConfigurationWizardPage_27, HibernateConsoleMessages.ConsoleConfigurationWizardPage_28 }, true, true, true);
case 1:
return BuildPathDialogAccess.chooseExternalJAREntries(getShell() );
default:
return null;
}
-
+
}
protected String[] getAddButtonLabels() {
- return new String[] { "Add JAR/Dir...", "Add External JARS..." };
+ return new String[] { HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_jar_dir, HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_external_jars };
}
protected void listChanged() {
dialogChanged();
}
-
+
};
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
@@ -372,97 +374,97 @@
gd.verticalAlignment = GridData.FILL;
gd.horizontalAlignment = GridData.FILL;
classPathViewer.setLayoutData( gd );
-
+
useProjectClassPath = new Button(c, SWT.CHECK);
useProjectClassPath.setSelection( true );
- useProjectClassPath.setText("Include default classpath from project");
+ useProjectClassPath.setText(HibernateConsoleMessages.ConsoleConfigurationWizardPage_include_default_classpath);
useProjectClassPath.addSelectionListener(new SelectionListener() {
-
+
public void widgetDefaultSelected(SelectionEvent e) {
dialogChanged();
}
-
+
public void widgetSelected(SelectionEvent e) {
- dialogChanged();
+ dialogChanged();
}
});
-
-
- return c;
+
+
+ return c;
}
private UpDownListComposite buildMappingFileTable(Composite parent) {
- mappingFilesViewer = new UpDownListComposite(parent, SWT.NONE, "Additional mapping files (not listed in cfg.xml)") {
+ mappingFilesViewer = new UpDownListComposite(parent, SWT.NONE, HibernateConsoleMessages.ConsoleConfigurationWizardPage_additional_mapping_files) {
protected Object[] handleAdd(int idx) {
TableItem[] items = getTable().getItems();
IPath[] exclude = new IPath[items.length];
-
+
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
- exclude[i] = (IPath) item.getData();
+ exclude[i] = (IPath) item.getData();
}
-
- return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, "Add hbm.xml file", "Add a Hibernate Mapping file", new String[] { "hbm.xml" }, true, false, true);
+
+ return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_hbmxml_file, HibernateConsoleMessages.ConsoleConfigurationWizardPage_add_hibernate_mapping_file, new String[] { HibernateConsoleMessages.ConsoleConfigurationWizardPage_35 }, true, false, true);
}
protected void listChanged() {
dialogChanged();
}
};
-
+
GridData gd;
gd = new GridData(GridData.FILL_BOTH);
-
+
gd.horizontalSpan = 3;
gd.verticalSpan = 1;
-
+
mappingFilesViewer.setLayoutData( gd );
return mappingFilesViewer;
}
-
-
-
+
+
+
/**
* A visitor class that will make a "best guess" on which files the
* user want for the properties and config file.
- *
+ *
* @author max
*
*/
static class Visitor implements IResourceProxyVisitor {
-
+
public IPath propertyFile;
public IPath configFile;
public IPath persistencexml;
public IJavaProject javaProject;
public List classpath = new ArrayList();
public List mappings = new ArrayList();
-
+
public boolean visit(IResourceProxy proxy) throws CoreException {
//System.out.println("visit: " + proxy.getName() );
IPath fullPath = proxy.requestFullPath();
if(proxy.getType() == IResource.FILE) {
- if("hibernate.properties".equals(proxy.getName() ) ) {
+ if("hibernate.properties".equals(proxy.getName() ) ) { //$NON-NLS-1$
propertyFile = fullPath;
return false;
}
-
- if("hibernate.cfg.xml".equals(proxy.getName() ) ) {
+
+ if("hibernate.cfg.xml".equals(proxy.getName() ) ) { //$NON-NLS-1$
configFile = fullPath;
mappings.clear(); // we prefer af cfg.xml over mappings
return false;
}
-
- if("persistence.xml".equals( proxy.getName() )) {
+
+ if("persistence.xml".equals( proxy.getName() )) { //$NON-NLS-1$
if(javaProject!=null && javaProject.isOnClasspath( proxy.requestResource() )) {
persistencexml = fullPath;
mappings.clear();
- return false;
+ return false;
}
}
-
+
// only add mappings if we don't have a config file.
- if((configFile==null || persistencexml==null) && proxy.getName().endsWith(".hbm.xml") ) {
+ if((configFile==null || persistencexml==null) && proxy.getName().endsWith(".hbm.xml") ) { //$NON-NLS-1$
mappings.add(fullPath);
return false;
}
@@ -479,7 +481,7 @@
}
-
+
public void initialize(ISelection currentSelection) {
try {
Visitor v = new Visitor();
@@ -488,14 +490,14 @@
IStructuredSelection ssel = (IStructuredSelection)currentSelection;
if (ssel.size()>1) return;
Object obj = ssel.getFirstElement();
-
+
IContainer container = null;
if (obj instanceof IJavaElement) {
v.javaProject = ((IJavaElement) obj).getJavaProject();
if(v.javaProject!=null) {
container = v.javaProject.getProject();
}
- }
+ }
if (obj instanceof IResource) {
IResource res = (IResource) obj;
if (obj instanceof IContainer) {
@@ -514,12 +516,12 @@
if(container!=null) {
container.accept(v, IResource.NONE);
-
+
if(v.javaProject==null) {
IProject project = container.getProject();
v.javaProject = JavaCore.create(project);
}
-
+
if(v.javaProject!=null) {
configurationNameText.setText(v.javaProject.getElementName() );
projectNameText.setText(v.javaProject.getElementName());
@@ -527,11 +529,11 @@
if (v.propertyFile!=null) {
propertyFileText.setText(v.propertyFile.toOSString() );
}
-
+
if (v.configFile!=null) {
configurationFileText.setText(v.configFile.toOSString() );
}
-
+
if (v.persistencexml!=null) {
jpaMode.setSelection( true );
coreMode.setSelection( false );
@@ -541,14 +543,14 @@
if (!v.classpath.isEmpty() ) classPathViewer.add(v.classpath.toArray(), false);
useProjectClassPath.setSelection( true );
//if(v.javaProject!=null) {
- //classPathViewer.add(locateTypes(v.javaProject).toArray(), false);
+ //classPathViewer.add(locateTypes(v.javaProject).toArray(), false);
//}
} else if (obj instanceof EclipseConsoleConfiguration) {
// trying to edit an EXISTING consoleconfiguration
EclipseConsoleConfiguration cc = (EclipseConsoleConfiguration) obj;
EclipseConsoleConfigurationPreferences prefs = (EclipseConsoleConfigurationPreferences) cc.getPreferences();
-
- configurationNameText.setText(prefs.getName() );
+
+ configurationNameText.setText(prefs.getName() );
if(prefs.getProjectName()!=null) projectNameText.setText( prefs.getProjectName() );
useProjectClassPath.setSelection( prefs.useProjectClasspath() );
if(prefs.getPropertyFilename()!=null) propertyFileText.setText(prefs.getPropertyFilename().toOSString() );
@@ -561,47 +563,47 @@
jpaMode.setSelection( prefs.getConfigurationMode().equals( ConfigurationMode.JPA ) );
coreMode.setSelection( prefs.getConfigurationMode().equals( ConfigurationMode.CORE ) );
annotationsMode.setSelection( prefs.getConfigurationMode().equals( ConfigurationMode.ANNOTATIONS ) );
-
+
oldConfiguaration = cc;
}
-
-
-
-
+
+
+
+
}
} catch (CoreException ce) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problem while initializing ConsoleConfigurationWizardPage", ce);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.ConsoleConfigurationWizardPage_problem_while_initializing_cc, ce);
}
-
+
}
List locateTypes(final IJavaProject javaProject) {
-
+
try {
- String typeName = "java.sql.Driver";
+ String typeName = "java.sql.Driver"; //$NON-NLS-1$
final SearchPattern pattern = SearchPattern.createPattern(typeName, IJavaSearchConstants.TYPE, IJavaSearchConstants.IMPLEMENTORS, SearchPattern.R_EXACT_MATCH);
final IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {javaProject });
-
+
final SearchEngine engine = new SearchEngine();
-
+
final CollectingSearchRequestor sr = new CollectingSearchRequestor();
final SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
-
+
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell() );
-
-
+
+
dialog.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) {
try {
engine.search(pattern, participants, scope, sr, monitor);
} catch (CoreException ce) {
HibernateConsolePlugin.getDefault().logErrorMessage(
- "Problem while locating jdbc drivers", ce);
+ HibernateConsoleMessages.ConsoleConfigurationWizardPage_problem_while_locating_jdbc_drivers, ce);
}
}
});
-
-
+
+
List resources = new ArrayList();
Iterator iter = sr.getResults().iterator();
while (iter.hasNext() ) {
@@ -610,20 +612,20 @@
resources.add(match.getResource().getFullPath() );
}
}
-
+
return resources;
} catch (InvocationTargetException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(
- "Problem while locating jdbc drivers", e);
+ HibernateConsoleMessages.ConsoleConfigurationWizardPage_problem_while_locating_jdbc_drivers, e);
} catch (InterruptedException e) {
HibernateConsolePlugin.getDefault().logErrorMessage(
- "Problem while locating jdbc drivers", e);
+ HibernateConsoleMessages.ConsoleConfigurationWizardPage_problem_while_locating_jdbc_drivers, e);
}
-
-
+
+
return Collections.EMPTY_LIST;
}
-
+
IPath[] getMappingFiles() {
return tableItems2File(mappingFilesViewer.getTable() );
}
@@ -631,91 +633,92 @@
IPath[] getClassPath() {
return tableItems2File(classPathViewer.getTable() );
}
-
+
private IPath[] tableItems2File(Table table) {
TableItem[] items = table.getItems();
IPath[] str = new IPath[items.length];
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
IPath path = (IPath) item.getData();
- str[i] = path;
+ str[i] = path;
}
return str;
}
private void handlePropertyFileBrowse() {
- IPath[] paths = org.hibernate.eclipse.console.utils.xpl.DialogSelectionHelper.chooseFileEntries(getShell(), getPropertyFilePath(), new IPath[0], "Select property file", "Choose file to use as hibernate.properties", new String[] {"properties"}, false, false, true);
+ IPath[] paths = org.hibernate.eclipse.console.utils.xpl.DialogSelectionHelper.chooseFileEntries(getShell(), getPropertyFilePath(), new IPath[0], HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_property_file, HibernateConsoleMessages.ConsoleConfigurationWizardPage_choose_file_to_use, new String[] {"properties"}, false, false, true); //$NON-NLS-1$
if(paths!=null && paths.length==1) {
propertyFileText.setText( (paths[0]).toOSString() );
}
}
-
+
private void handleProjectBrowse() {
- IJavaProject paths = DialogSelectionHelper.chooseJavaProject( getShell(), ProjectUtils.findJavaProject( propertyFileText.getText() ), "Select java project", "The (optional) java project is used to determine the default classpath" );
+ IJavaProject paths = DialogSelectionHelper.chooseJavaProject( getShell(), ProjectUtils.findJavaProject( propertyFileText.getText() ), HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_java_project, HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_java_project_to_classpath );
if(paths!=null) {
projectNameText.setText( paths.getProject().getName() );
} else {
- projectNameText.setText("");
+ projectNameText.setText(""); //$NON-NLS-1$
}
}
-
-
+
+
private void handleConfigurationFileBrowse() {
- IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), getConfigurationFilePath(), new IPath[0], "Select hibernate.cfg.xml file", "Choose file to use as hibernate.cfg.xml", new String[] {"cfg.xml"}, false, false, true);
+ IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), getConfigurationFilePath(), new IPath[0], HibernateConsoleMessages.ConsoleConfigurationWizardPage_select_hibcfgxml_file, HibernateConsoleMessages.ConsoleConfigurationWizardPage_choose_file_to_use_hibcfgxml_file, new String[] {"cfg.xml"}, false, false, true); //$NON-NLS-1$
if(paths!=null && paths.length==1) {
configurationFileText.setText( (paths[0]).toOSString() );
}
}
-
+
/**
* Ensures that both text fields are set.
*/
-
+
private void dialogChanged() {
String propertyFilename = propertyFileText.getText();
String configurationFilename = configurationFileText.getText();
-
+
configurationFileText.setEnabled( !configurationFileWillBeCreated && !getConfigurationMode().equals( ConfigurationMode.JPA ) );
confbutton.setEnabled( !getConfigurationMode().equals( ConfigurationMode.JPA ) );
-
+
persistenceUnitNameText.setEnabled( getConfigurationMode().equals( ConfigurationMode.JPA) );
-
+
if(getConfigurationName()==null || getConfigurationName().trim().length() == 0) {
- updateStatus("A name must be specified");
+ updateStatus(HibernateConsoleMessages.ConsoleConfigurationWizardPage_name_must_specified);
return;
} else {
if(oldConfiguaration==null && KnownConfigurations.getInstance().find(getConfigurationName() )!=null) {
- updateStatus("A configuration with that name already exists!");
+ updateStatus(HibernateConsoleMessages.ConsoleConfigurationWizardPage_config_name_already_exist);
return;
}
}
-
+
if(getProjectName()!=null && StringHelper.isNotEmpty(getProjectName().trim())) {
IJavaProject findJavaProject = ProjectUtils.findJavaProject( getProjectName() );
if(findJavaProject==null || !findJavaProject.exists()) {
- updateStatus("The Java project " + getProjectName() + " does not exist.");
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationWizardPage_the_java_project_does_not_exist, getProjectName());
+ updateStatus(out);
return;
}
}
-
+
/* TODO: warn about implicit behavior of loading /hibernate.cfg.xml, /hibernate.properties and /META-INF/persistence.xml
* if (propertyFilename.length() == 0 && configurationFilename.trim().length() == 0) {
updateStatus("Property or Configuration file must be specified");
return;
} */
-
+
if (propertyFilename.length() > 0) {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(propertyFilename);
- String msg = checkForFile("Property file", resource);
+ String msg = checkForFile(HibernateConsoleMessages.ConsoleConfigurationWizardPage_property_file_1, resource);
if(msg!=null) {
updateStatus(msg);
return;
}
}
-
+
if (!configurationFileWillBeCreated && configurationFilename.length() > 0) {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(configurationFilename);
- String msg = checkForFile("Configuration file",resource);
+ String msg = checkForFile(HibernateConsoleMessages.ConsoleConfigurationWizardPage_configuration_file,resource);
if(msg!=null) {
updateStatus(msg);
return;
@@ -724,18 +727,18 @@
//TODO: removed to provide a way to create a non-mapping base configuration
//updateStatus("Need to specify one or more mapping files");
//return;
- }
-
+ }
+
if((useProjectClassPath() && StringHelper.isEmpty( getProjectName() )) && classPathViewer.getTable().getItemCount()==0) {
- updateStatus( "Need to specify a project or setup a classpath" );
+ updateStatus( HibernateConsoleMessages.ConsoleConfigurationWizardPage_need_to_specify_project );
return;
}
-
+
if((!useProjectClassPath() && classPathViewer.getTable().getItemCount()==0)) {
- updateStatus( "Need to specify a classpath when not using a project classpath" );
+ updateStatus( HibernateConsoleMessages.ConsoleConfigurationWizardPage_need_to_specify_classpath );
return;
}
-
+
updateStatus(null);
}
@@ -750,13 +753,13 @@
private String checkForFile(String msgPrefix, IResource resource) {
if(resource!=null) {
if(resource instanceof IFile) {
-
+
return null;
} else {
- return msgPrefix + " is not a file";
- }
+ return msgPrefix + HibernateConsoleMessages.ConsoleConfigurationWizardPage_is_not_a_file;
+ }
} else {
- return msgPrefix + " does not exist";
+ return msgPrefix + HibernateConsoleMessages.ConsoleConfigurationWizardPage_does_not_exist;
}
}
@@ -764,9 +767,9 @@
setErrorMessage(message);
setPageComplete(message == null);
}
-
+
public Path getPropertyFilePath() {
- String p = propertyFileText.getText();
+ String p = propertyFileText.getText();
return pathOrNull(p);
}
private Path pathOrNull(String p) {
@@ -793,7 +796,7 @@
initialize( new StructuredSelection(containerFullPath) );
}
configurationFileText.setText(containerFullPath.toPortableString());
-
+
configurationFileWillBeCreated = true;
configurationFileText.setEnabled(false);
confbutton.setEnabled(false);
@@ -802,7 +805,7 @@
public String getEntityResolverClassName() {
return entityResolverClassNameText.getText();
}
-
+
public boolean useProjectClassPath() {
return useProjectClassPath.getSelection();
}
@@ -824,9 +827,9 @@
public String getPersistenceUnitName() {
return persistenceUnitNameText.getText();
}
-
-
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizard.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -47,6 +47,7 @@
import org.eclipse.ui.ide.IDE;
import org.hibernate.cfg.Environment;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.tool.hbm2x.HibernateConfigurationExporter;
@@ -60,7 +61,7 @@
private ISelection selection;
private WizardNewFileCreationPage cPage;
private ConsoleConfigurationWizardPage confPage;
-
+
/**
* Constructor for NewConfigurationWizard.
*/
@@ -92,29 +93,29 @@
public void addPages() {
cPage =
- new ExtendedWizardNewFileCreationPage( "Ccfgxml", (IStructuredSelection) selection );
- cPage.setTitle( "Create Hibernate Configuration file (cfg.xml)" );
- cPage.setDescription( "Create a new hibernate.cfg.xml." );
- cPage.setFileName("hibernate.cfg.xml");
- addPage( cPage );
-
-
+ new ExtendedWizardNewFileCreationPage( "Ccfgxml", (IStructuredSelection) selection ); //$NON-NLS-1$
+ cPage.setTitle( HibernateConsoleMessages.NewConfigurationWizard_create_hibernate_cfg_file );
+ cPage.setDescription( HibernateConsoleMessages.NewConfigurationWizard_create_new_hibernate_cfg_xml );
+ cPage.setFileName("hibernate.cfg.xml"); //$NON-NLS-1$
+ addPage( cPage );
+
+
connectionInfoPage = new NewConfigurationWizardPage(selection, cPage);
addPage(connectionInfoPage);
-
+
confPage = new ConsoleConfigurationWizardPage(selection);
- addPage(confPage);
+ addPage(confPage);
}
-
-
+
+
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
* using wizard as execution context.
*/
public boolean performFinish() {
-
+
final Properties props = new Properties();
putIfNotNull(props, Environment.SESSION_FACTORY_NAME, connectionInfoPage.getSessionFactoryName() );
putIfNotNull(props, Environment.DIALECT, connectionInfoPage.getDialect() );
@@ -125,7 +126,7 @@
putIfNotNull(props, Environment.DEFAULT_CATALOG, connectionInfoPage.getDefaultCatalog() );
putIfNotNull(props, Environment.DEFAULT_SCHEMA, connectionInfoPage.getDefaultSchema() );
final IFile file = cPage.createNewFile();
-
+
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
@@ -143,17 +144,17 @@
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
- HibernateConsolePlugin.getDefault().showError(getShell(), "Error", realException);
+ HibernateConsolePlugin.getDefault().showError(getShell(), HibernateConsoleMessages.NewConfigurationWizard_error, realException);
return false;
}
-
+
if(connectionInfoPage.isCreateConsoleConfigurationEnabled()) {
ConsoleConfigurationCreationWizard.createConsoleConfiguration(getContainer(), confPage);
}
-
+
return true;
}
-
+
/**
* @param props
* @param dialect
@@ -169,19 +170,19 @@
* The worker method. It will find the container, create the
* file if missing or just replace its contents, and open
* the editor on the newly created file.
- * @param file
- * @param props
+ * @param file
+ * @param props
*/
private void createHibernateCfgXml(
final IFile file, Properties props, IProgressMonitor monitor)
throws CoreException {
// create a sample file
- monitor.beginTask("Creating " + file.getName(), 2);
+ monitor.beginTask(HibernateConsoleMessages.NewConfigurationWizard_creating + file.getName(), 2);
try {
InputStream stream = openContentStream(props);
if (file.exists() ) {
- file.setContents(stream, true, true, monitor);
+ file.setContents(stream, true, true, monitor);
} else {
file.create(stream, true, monitor);
}
@@ -189,7 +190,7 @@
} catch (IOException e) {
}
monitor.worked(1);
- monitor.setTaskName("Opening file for editing...");
+ monitor.setTaskName(HibernateConsoleMessages.NewConfigurationWizard_open_file_for_editing);
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage page =
@@ -202,10 +203,10 @@
});
monitor.worked(1);
}
-
+
/**
* We will initialize file contents with a sample text.
- * @throws UnsupportedEncodingException
+ * @throws UnsupportedEncodingException
*/
private InputStream openContentStream(Properties props) {
@@ -213,11 +214,11 @@
HibernateConfigurationExporter hce = new HibernateConfigurationExporter();
hce.setCustomProperties(props);
hce.setOutput(stringWriter);
- hce.start();
+ hce.start();
try {
- return new ByteArrayInputStream(stringWriter.toString().getBytes("UTF-8") );
+ return new ByteArrayInputStream(stringWriter.toString().getBytes("UTF-8") ); //$NON-NLS-1$
} catch (UnsupportedEncodingException uec) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problems converting to UTF-8", uec);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.NewConfigurationWizard_problems_converting_to_utf8, uec);
return new ByteArrayInputStream(stringWriter.toString().getBytes() );
}
}
@@ -228,19 +229,19 @@
* @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
+ this.selection = selection;
}
-
+
public IWizardPage getNextPage(IWizardPage page) {
if(page==connectionInfoPage) {
if(!connectionInfoPage.isCreateConsoleConfigurationEnabled()) {
return null;
- }
+ }
confPage.setConfigurationFilePath(cPage.getContainerFullPath().append(cPage.getFileName()));
- }
+ }
return super.getNextPage( page );
}
-
+
public boolean canFinish() {
if(!connectionInfoPage.isCreateConsoleConfigurationEnabled()) {
return connectionInfoPage.isPageComplete();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizardPage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewConfigurationWizardPage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,6 +42,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
/**
@@ -64,31 +65,31 @@
private Text usernameText;
private Text passwordText;
-
+
private Text defaultSchemaText;
private Text defaultCatalogText;
private Combo urlCombo;
-
- private Button createConsoleConfiguration;
-
+
+ private Button createConsoleConfiguration;
+
private ISelection selection;
private final WizardNewFileCreationPage fileCreation;
private boolean beenShown = false;
-
+
/**
* Constructor for SampleNewWizardPage.
- * @param page
- *
+ * @param page
+ *
* @param pageName
*/
public NewConfigurationWizardPage(ISelection selection, WizardNewFileCreationPage page) {
- super("wizardPage");
+ super("wizardPage"); //$NON-NLS-1$
this.fileCreation = page;
- setTitle("Hibernate Configuration File (cfg.xml)");
- setDescription("This wizard creates a new configuration file to use with Hibernate.");
+ setTitle(HibernateConsoleMessages.NewConfigurationWizardPage_hibernate_config_file);
+ setDescription(HibernateConsoleMessages.NewConfigurationWizardPage_this_wizard_creates);
this.selection = selection;
}
@@ -104,47 +105,47 @@
};
SelectionListener selectionListener = new SelectionListener() {
-
+
public void widgetDefaultSelected(SelectionEvent e) {
dialogChanged();
getContainer().updateButtons();
}
-
+
public void widgetSelected(SelectionEvent e) {
dialogChanged();
getContainer().updateButtons();
}
-
+
};
-
+
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
- label.setText("&Container:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_container);
containerText = new Label(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- containerText.setLayoutData(gd);
-
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ containerText.setLayoutData(gd);
+
label = new Label(container, SWT.NULL);
- label.setText("&File name:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_file_name);
fileText = new Label(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
fileText.setLayoutData(gd);
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Session factory name:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_session_factory_name);
sessionFactoryNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
sessionFactoryNameText.setLayoutData(gd);
sessionFactoryNameText.addModifyListener(listener);
-
+
label = new Label(container, SWT.NULL);
- label.setText("&Database dialect:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_database_dialect);
dialectCombo = new Combo(container, SWT.NULL);
fillHerUp(dialectCombo, helper.getDialectNames() );
dialectCombo.select(0);
@@ -159,15 +160,15 @@
dialogChanged();
}
});
-
+
gd = new GridData(GridData.BEGINNING, GridData.CENTER, false,false);
gd.horizontalAlignment = SWT.TOP;
gd.verticalAlignment = SWT.TOP;
label.setLayoutData(gd);
-
+
Composite driverManagerTabContainer = container;
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("&Driver class:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_driver_class);
driver_classCombo = new Combo(driverManagerTabContainer, SWT.NULL);
driver_classCombo.select(0);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -181,59 +182,59 @@
dialogChanged();
}
});
-
+
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("Connection &URL:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_connection_url);
urlCombo = new Combo(driverManagerTabContainer, SWT.NULL);
urlCombo.select(0);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
urlCombo.setLayoutData(gd);
urlCombo.addModifyListener(listener);
-
+
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("Default Schema:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_default_schema);
defaultSchemaText = new Text(driverManagerTabContainer, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
defaultSchemaText.setLayoutData(gd);
defaultSchemaText.addModifyListener(listener);
-
+
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("Default Catalog:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_default_catalog);
defaultCatalogText = new Text(driverManagerTabContainer, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
defaultCatalogText.setLayoutData(gd);
defaultCatalogText.addModifyListener(listener);
-
+
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("User&name:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_user_name);
usernameText = new Text(driverManagerTabContainer, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
usernameText.setLayoutData(gd);
usernameText.addModifyListener(listener);
-
+
label = new Label(driverManagerTabContainer, SWT.NULL);
- label.setText("&Password:");
+ label.setText(HibernateConsoleMessages.NewConfigurationWizardPage_password);
passwordText = new Text(driverManagerTabContainer, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
passwordText.setLayoutData(gd);
passwordText.addModifyListener(listener);
-
+
fillLabel(container);
fillLabel(container);
-
+
fillLabel(container);
-
+
createConsoleConfiguration = new Button(container, SWT.CHECK);
gd = new GridData(GridData.FILL_HORIZONTAL);
- createConsoleConfiguration.setLayoutData(gd);
- createConsoleConfiguration.setText("Create a console configuration");
+ createConsoleConfiguration.setLayoutData(gd);
+ createConsoleConfiguration.setText(HibernateConsoleMessages.NewConfigurationWizardPage_create_console_configuration);
createConsoleConfiguration.addSelectionListener(selectionListener);
-
+
initialize();
dialogChanged();
-
- setControl(container);
+
+ setControl(container);
}
/**
@@ -293,39 +294,39 @@
String fileName = getFileName();
if (getContainerName().length() == 0) {
- updateStatus("File container must be specified");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_container_must_be_specified);
return;
}
if (container == null
|| (container.getType() & (IResource.PROJECT | IResource.FOLDER) ) == 0) {
- updateStatus("File container must exist");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_container_must_exist);
return;
- }
-
+ }
+
if (!container.isAccessible() ) {
- updateStatus("Project must be writable");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_project_must_be_writable);
return;
}
-
+
if (fileName.length() == 0) {
- updateStatus("File name must be specified");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_name_must_be_specified);
return;
}
if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
- updateStatus("File name must be valid");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_name_must_be_valid);
return;
}
- if (!fileName.endsWith(".cfg.xml") ) {
- updateStatus("File extension must be \"cfg.xml\"");
+ if (!fileName.endsWith(".cfg.xml") ) { //$NON-NLS-1$
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_extension_must_be_cfgxml);
return;
}
IFile file = ( (IContainer) container).getFile(new Path(fileName) );
if(file.exists() ) {
- updateStatus("File already exists");
+ updateStatus(HibernateConsoleMessages.NewConfigurationWizardPage_file_already_exist);
return;
}
-
+
// TODO: check for driver class availability.
updateStatus(null);
}
@@ -399,30 +400,30 @@
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
*/
- public void setVisible(boolean visible) {
+ public void setVisible(boolean visible) {
containerText.setText(fileCreation.getContainerFullPath().toPortableString() );
- fileText.setText(fileCreation.getFileName() );
+ fileText.setText(fileCreation.getFileName() );
super.setVisible(visible);
if(visible) {
sessionFactoryNameText.setFocus();
}
- beenShown = true;
- dialogChanged();
+ beenShown = true;
+ dialogChanged();
}
-
+
public boolean isCreateConsoleConfigurationEnabled() {
return createConsoleConfiguration.getSelection();
}
-
+
public void setCreateConsoleConfigurationVisible(boolean isVisible) {
// update visibility if button was created
if (createConsoleConfiguration != null){
createConsoleConfiguration.setVisible(isVisible);
}
}
-
+
public String getDefaultCatalog() {
return nullIfEmpty(defaultCatalogText.getText());
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFilePage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -51,6 +51,7 @@
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.xpl.SelectionHelper;
@@ -75,27 +76,27 @@
/**
* Constructor for SampleNewWizardPage.
- * @param page
- *
+ * @param page
+ *
* @param pageName
*/
public NewHibernateMappingFilePage(ISelection selection, WizardNewFileCreationPage page) {
- super("wizardPage");
+ super("wizardPage"); //$NON-NLS-1$
this.fileCreation = page;
- setTitle("Hibernate XML Mapping file");
- setDescription("This wizard creates a new Hibernate XML Mapping file");
+ setTitle(HibernateConsoleMessages.NewHibernateMappingFilePage_hibernate_xml_mapping_file);
+ setDescription(HibernateConsoleMessages.NewHibernateMappingFilePage_this_wizard_creates);
this.selection = selection;
}
- public void setVisible(boolean visible) {
+ public void setVisible(boolean visible) {
containerText.setText(fileCreation.getContainerFullPath().toPortableString() );
- fileText.setText(fileCreation.getFileName() );
+ fileText.setText(fileCreation.getFileName() );
super.setVisible(visible);
if(visible) {
classToMap.setFocus();
}
- beenShown = true;
- dialogChanged();
+ beenShown = true;
+ dialogChanged();
}
/**
@@ -109,27 +110,27 @@
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
- label.setText("&Container:");
+ label.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_container);
containerText = new Label(container, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
containerText.setLayoutData(gd);
label = new Label(container, SWT.NULL);
- label.setText("");
+ label.setText(""); //$NON-NLS-1$
label = new Label(container, SWT.NULL);
- label.setText("&File name:");
+ label.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_file_name);
fileText = new Label(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
fileText.setLayoutData(gd);
-
+
label = new Label(container, SWT.NULL);
- label.setText("");
-
+ label.setText(""); //$NON-NLS-1$
+
label = new Label(container, SWT.NULL);
- label.setText("Class to &map:");
+ label.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_class_to_map);
classToMap = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -142,13 +143,13 @@
//TODO (internal api!): ControlContentAssistHelper.createTextContentAssistant(classToMap, aCompletionProcessor);
Button button = new Button(container, SWT.PUSH);
- button.setText("Browse...");
+ button.setText(HibernateConsoleMessages.NewHibernateMappingFilePage_browse);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleClassToMapBrowse();
}
});
-
+
initialize();
dialogChanged();
setControl(container);
@@ -162,7 +163,7 @@
IType initialJavaElement = SelectionHelper.getClassFromElement(SelectionHelper.getInitialJavaElement(selection));
if(initialJavaElement!=null) {
classToMap.setText(initialJavaElement.getFullyQualifiedName('.'));
- }
+ }
}
/**
@@ -173,7 +174,7 @@
private void handleBrowse() {
ContainerSelectionDialog dialog = new ContainerSelectionDialog(
getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
- "Select new file container");
+ HibernateConsoleMessages.NewHibernateMappingFilePage_select_new_file_container);
if (dialog.open() == ContainerSelectionDialog.OK) {
Object[] result = dialog.getResult();
if (result.length == 1) {
@@ -181,7 +182,7 @@
}
}
}
-
+
private void handleClassToMapBrowse() {
IType type = findClassToMap();
if(type!=null) {
@@ -191,16 +192,16 @@
IType findClassToMap() {
IJavaProject root= getRootJavaProject();
- if (root == null)
+ if (root == null)
return null;
IJavaElement[] elements= new IJavaElement[] { root };
IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
-
- try {
+
+ try {
SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, getClassToMapText());
- dialog.setTitle("Select class to map");
- dialog.setMessage("The class will be used when generating the hbm.xml file");
+ dialog.setTitle(HibernateConsoleMessages.NewHibernateMappingFilePage_select_class_to_map);
+ dialog.setMessage(HibernateConsoleMessages.NewHibernateMappingFilePage_the_class_will_be_used_when);
if (dialog.open() == Window.OK) {
Object[] resultArray= dialog.getResult();
if (resultArray != null && resultArray.length > 0)
@@ -211,7 +212,7 @@
}
return null;
}
-
+
private IJavaProject getRootJavaProject() {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(containerText.getText());
if(resource!=null) {
@@ -237,27 +238,27 @@
String fileName = getFileName();
if (getContainerName().length() == 0) {
- updateStatus("File container must be specified");
+ updateStatus(HibernateConsoleMessages.NewHibernateMappingFilePage_file_container_must_be_specified);
return;
}
if (container == null
|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
- updateStatus("File container must exist");
+ updateStatus(HibernateConsoleMessages.NewHibernateMappingFilePage_file_container_must_exist);
return;
}
if (!container.isAccessible()) {
- updateStatus("Project must be writable");
+ updateStatus(HibernateConsoleMessages.NewHibernateMappingFilePage_project_must_be_writable);
return;
}
if (fileName.length() == 0) {
- updateStatus("File name must be specified");
+ updateStatus(HibernateConsoleMessages.NewHibernateMappingFilePage_file_name_must_be_specified);
return;
}
if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
- updateStatus("File name must be valid");
+ updateStatus(HibernateConsoleMessages.NewHibernateMappingFilePage_file_name_must_be_valid);
return;
}
-
+
updateStatus(null);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFileWizard.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewHibernateMappingFileWizard.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -43,6 +43,7 @@
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.ide.IDE;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.console.utils.xpl.SelectionHelper;
@@ -52,8 +53,8 @@
private NewHibernateMappingFilePage mappingFileInfoPage;
private ISelection selection;
private WizardNewFileCreationPage cPage;
-
-
+
+
/**
* Constructor for NewConfigurationWizard.
*/
@@ -85,25 +86,25 @@
public void addPages() {
cPage =
- new ExtendedWizardNewFileCreationPage( "Chbmxml", (IStructuredSelection) selection );
- cPage.setTitle( "Create Hibernate XML Mapping file (hbm.xml)" );
- cPage.setDescription( "Create a new XML Mapping file." );
+ new ExtendedWizardNewFileCreationPage( "Chbmxml", (IStructuredSelection) selection ); //$NON-NLS-1$
+ cPage.setTitle( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file );
+ cPage.setDescription( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_new_xml_mapping_file );
IType initialJavaElement = SelectionHelper.getClassFromElement(SelectionHelper.getInitialJavaElement(selection));
if(initialJavaElement!=null) {
- cPage.setFileName(initialJavaElement.getElementName() + ".hbm.xml");
+ cPage.setFileName(initialJavaElement.getElementName() + ".hbm.xml"); //$NON-NLS-1$
} else {
- cPage.setFileName("NewMapping.hbm.xml");
+ cPage.setFileName("NewMapping.hbm.xml"); //$NON-NLS-1$
}
- addPage( cPage );
-
-
+ addPage( cPage );
+
+
mappingFileInfoPage = new NewHibernateMappingFilePage(selection, cPage);
addPage(mappingFileInfoPage);
-
+
}
-
-
+
+
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
@@ -112,7 +113,7 @@
public boolean performFinish() {
final IFile file = cPage.createNewFile();
final String classToMapText = mappingFileInfoPage.getClassToMapText();
-
+
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
@@ -135,25 +136,25 @@
}
return true;
}
-
+
/**
* The worker method. It will find the container, create the
* file if missing or just replace its contents, and open
* the editor on the newly created file.
- * @param file
- * @param props
+ * @param file
+ * @param props
*/
private void createFile(
final IFile file, String classToMapText, IProgressMonitor monitor)
throws CoreException {
// create a sample file
- monitor.beginTask("Creating " + file.getName(), 2);
+ monitor.beginTask(HibernateConsoleMessages.NewHibernateMappingFileWizard_creating + file.getName(), 2);
try {
InputStream stream = openContentStream(classToMapText);
if (file.exists() ) {
- file.setContents(stream, true, true, monitor);
+ file.setContents(stream, true, true, monitor);
} else {
file.create(stream, true, monitor);
}
@@ -161,7 +162,7 @@
} catch (IOException e) {
}
monitor.worked(1);
- monitor.setTaskName("Opening file for editing...");
+ monitor.setTaskName(HibernateConsoleMessages.NewHibernateMappingFileWizard_opening_file_for_editing);
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage page =
@@ -174,40 +175,40 @@
});
monitor.worked(1);
}
-
+
/**
* We will initialize file contents with a sample text.
*/
-
- private InputStream openContentStream(String classToMapText) {
-
+
+ private InputStream openContentStream(String classToMapText) {
+
String classname = null;
String packagename = null;
-
+
if(StringHelper.isNotEmpty(classToMapText)) {
classname = StringHelper.unqualify(classToMapText);
packagename = StringHelper.qualifier(classToMapText);
}
String contents =
- "<?xml version=\"1.0\"?>\n" +
- "<!DOCTYPE hibernate-mapping PUBLIC\n" +
- " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n" +
- " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n" +
- "<hibernate-mapping";
-
+ "<?xml version=\"1.0\"?>\n" + //$NON-NLS-1$
+ "<!DOCTYPE hibernate-mapping PUBLIC\n" + //$NON-NLS-1$
+ " \"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"\n" + //$NON-NLS-1$
+ " \"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">\n" + //$NON-NLS-1$
+ "<hibernate-mapping"; //$NON-NLS-1$
+
if(StringHelper.isNotEmpty(packagename)) {
- contents +=" package=\"" + packagename + "\">";
+ contents +=" package=\"" + packagename + "\">"; //$NON-NLS-1$//$NON-NLS-2$
} else {
- contents +=">\n";
+ contents +=">\n"; //$NON-NLS-1$
}
-
+
if(StringHelper.isNotEmpty(classname)) {
- contents +="\n <class name=\"" + classname + "\">\n" +
- " </class>";
- }
-
- contents += "\n</hibernate-mapping>";
-
+ contents +="\n <class name=\"" + classname + "\">\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ " </class>"; //$NON-NLS-1$
+ }
+
+ contents += "\n</hibernate-mapping>"; //$NON-NLS-1$
+
return new ByteArrayInputStream(contents.getBytes());
}
@@ -217,8 +218,8 @@
* @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.selection = selection;
+ this.selection = selection;
}
-
-
+
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewReverseEngineeringFileWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewReverseEngineeringFileWizard.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/NewReverseEngineeringFileWizard.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -46,6 +46,7 @@
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.eclipse.ui.ide.IDE;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -60,7 +61,7 @@
private TableFilterWizardPage tableFilterWizardPage;
private IPath createdFile;
private String selectedConfiguratonName;
-
+
/**
* Constructor for NewConfigurationWizard.
*/
@@ -75,7 +76,7 @@
public ExtendedWizardNewFileCreationPage(String pageName, IStructuredSelection selection) {
super(pageName, selection);
- setContainerFullPath(new Path("/")); // TODO: make it based on the selection which should be available when doing the launch!
+ setContainerFullPath(new Path("/")); // TODO: make it based on the selection which should be available when doing the launch! //$NON-NLS-1$
}
boolean firstTime = true;
@@ -90,21 +91,21 @@
/**
* Adding the page to the wizard.
*/
-
+
public void addPages() {
- cPage = new ExtendedWizardNewFileCreationPage( "Ccfgxml", selection );
- cPage.setTitle( "Create Hibernate Reverse Engineering file (reveng.xml)" );
- cPage.setDescription( "Create a new hibernate.reveng.xml." );
- cPage.setFileName("hibernate.reveng.xml");
- addPage( cPage );
-
- tableFilterWizardPage = new TableFilterWizardPage( "revengtable", selectedConfiguratonName );
+ cPage = new ExtendedWizardNewFileCreationPage( "Ccfgxml", selection ); //$NON-NLS-1$
+ cPage.setTitle( HibernateConsoleMessages.NewReverseEngineeringFileWizard_create_hibernate_reverse_engineering_file );
+ cPage.setDescription( HibernateConsoleMessages.NewReverseEngineeringFileWizard_create_new_hibernate_reveng_xml );
+ cPage.setFileName("hibernate.reveng.xml"); //$NON-NLS-1$
+ addPage( cPage );
+
+ tableFilterWizardPage = new TableFilterWizardPage( "revengtable", selectedConfiguratonName ); //$NON-NLS-1$
addPage( tableFilterWizardPage );
-
+
}
-
-
+
+
/**
* This method is called when 'Finish' button is pressed in
* the wizard. We will create an operation and run it
@@ -130,12 +131,12 @@
return false;
} catch (InvocationTargetException e) {
Throwable realException = e.getTargetException();
- HibernateConsolePlugin.getDefault().showError(getShell(), "Error", realException);
+ HibernateConsolePlugin.getDefault().showError(getShell(), HibernateConsoleMessages.NewReverseEngineeringFileWizard_error, realException);
return false;
}
return true;
}
-
+
/**
* @param props
* @param dialect
@@ -151,28 +152,28 @@
* The worker method. It will find the container, create the
* file if missing or just replace its contents, and open
* the editor on the newly created file.
- * @param file
- * @param props
+ * @param file
+ * @param props
*/
private void doFinish(
final IFile file, IProgressMonitor monitor)
throws CoreException {
// create a sample file
- monitor.beginTask("Creating " + file.getName(), 2);
+ monitor.beginTask(HibernateConsoleMessages.NewReverseEngineeringFileWizard_creating + file.getName(), 2);
try {
InputStream stream = openContentStream();
if (file.exists() ) {
- file.setContents(stream, true, true, monitor);
+ file.setContents(stream, true, true, monitor);
} else {
- file.create(stream, true, monitor);
+ file.create(stream, true, monitor);
}
stream.close();
} catch (IOException e) {
-
+
}
monitor.worked(1);
- monitor.setTaskName("Opening file for editing...");
+ monitor.setTaskName(HibernateConsoleMessages.NewReverseEngineeringFileWizard_opening_file_for_editing);
getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage page =
@@ -185,35 +186,35 @@
});
monitor.worked(1);
}
-
+
private InputStream openContentStream() {
StringWriter sw = new StringWriter();
- sw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
- "<!DOCTYPE hibernate-reverse-engineering PUBLIC \"-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN\" \"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd\" >\r\n" +
- "\r\n" +
- "<hibernate-reverse-engineering>\r\n");
+ sw.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + //$NON-NLS-1$
+ "<!DOCTYPE hibernate-reverse-engineering PUBLIC \"-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN\" \"http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd\" >\r\n" + //$NON-NLS-1$
+ "\r\n" + //$NON-NLS-1$
+ "<hibernate-reverse-engineering>\r\n"); //$NON-NLS-1$
ITableFilter[] filters = tableFilterWizardPage.getTableFilters();
for (int i = 0; i < filters.length; i++) {
ITableFilter filter = filters[i];
- sw.write(" <table-filter");
- if(!".*".equals(filter.getMatchCatalog())) {
- sw.write(" match-catalog=\"" + filter.getMatchCatalog() + "\"");
+ sw.write(" <table-filter"); //$NON-NLS-1$
+ if(!".*".equals(filter.getMatchCatalog())) { //$NON-NLS-1$
+ sw.write(" match-catalog=\"" + filter.getMatchCatalog() + "\""); //$NON-NLS-1$//$NON-NLS-2$
}
- if(!".*".equals(filter.getMatchSchema())) {
- sw.write(" match-schema=\"" + filter.getMatchSchema() + "\"");
+ if(!".*".equals(filter.getMatchSchema())) { //$NON-NLS-1$
+ sw.write(" match-schema=\"" + filter.getMatchSchema() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
- sw.write(" match-name=\"" + filter.getMatchName() + "\"");
+ sw.write(" match-name=\"" + filter.getMatchName() + "\""); //$NON-NLS-1$//$NON-NLS-2$
if(filter.getExclude().booleanValue()) {
- sw.write(" exclude=\"" + filter.getExclude().booleanValue() + "\"");
+ sw.write(" exclude=\"" + filter.getExclude().booleanValue() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
- sw.write("/>\r\n");
+ sw.write("/>\r\n"); //$NON-NLS-1$
}
-
- sw.write("</hibernate-reverse-engineering>");
+
+ sw.write("</hibernate-reverse-engineering>"); //$NON-NLS-1$
try {
- return new ByteArrayInputStream(sw.toString().getBytes("UTF-8") );
+ return new ByteArrayInputStream(sw.toString().getBytes("UTF-8") ); //$NON-NLS-1$
} catch (UnsupportedEncodingException uec) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problems converting to UTF-8", uec);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.NewReverseEngineeringFileWizard_problems_converting_to_utf8, uec);
return new ByteArrayInputStream(sw.toString().getBytes() );
}
}
@@ -225,9 +226,9 @@
*/
public void init(IWorkbench workbench, IStructuredSelection selection) {
this.selection = selection;
-
+
}
-
+
public IPath getCreatedFilePath() {
return createdFile;
}
@@ -235,6 +236,6 @@
public void setSelectConfiguration(String configurationName) {
- this.selectedConfiguratonName = configurationName;
+ this.selectedConfiguratonName = configurationName;
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterCellModifier.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterCellModifier.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterCellModifier.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -35,22 +35,22 @@
public void modify(Object element, String property, Object value) {
ITableFilter tf = (ITableFilter) ((TableItem)element).getData();
- if("inclusion".equals(property)) {
+ if("inclusion".equals(property)) { //$NON-NLS-1$
if(!value.equals(tf.getExclude())) {
tf.setExclude((Boolean) value);
}
}
- if("catalog".equals(property)) {
+ if("catalog".equals(property)) { //$NON-NLS-1$
if(!value.equals(tf.getMatchCatalog())) {
tf.setMatchCatalog((String) value);
}
}
- if("schema".equals(property)) {
+ if("schema".equals(property)) { //$NON-NLS-1$
if(!value.equals(tf.getMatchSchema())) {
tf.setMatchSchema((String) value);
}
}
- if("name".equals(property)) {
+ if("name".equals(property)) { //$NON-NLS-1$
if(!value.equals(tf.getMatchName())) {
tf.setMatchName((String) value);
}
@@ -60,16 +60,16 @@
public Object getValue(Object element, String property) {
ITableFilter tf = (ITableFilter) element;
- if("inclusion".equals(property)) {
+ if("inclusion".equals(property)) { //$NON-NLS-1$
return tf.getExclude();
}
- if("catalog".equals(property)) {
+ if("catalog".equals(property)) { //$NON-NLS-1$
return tf.getMatchCatalog();
}
- if("schema".equals(property)) {
+ if("schema".equals(property)) { //$NON-NLS-1$
return tf.getMatchSchema();
}
- if("name".equals(property)) {
+ if("name".equals(property)) { //$NON-NLS-1$
return tf.getMatchName();
}
return null;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterLabelProvider.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterLabelProvider.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -31,8 +31,8 @@
public class TableFilterLabelProvider extends LabelProvider implements ITableLabelProvider {
// Names of images used to represent checkboxes
- public static final String CHECKED_IMAGE = "checked";
- public static final String UNCHECKED_IMAGE = "unchecked";
+ public static final String CHECKED_IMAGE = "checked"; //$NON-NLS-1$
+ public static final String UNCHECKED_IMAGE = "unchecked"; //$NON-NLS-1$
public Image getColumnImage(Object element, int columnIndex) {
@@ -52,7 +52,7 @@
public String getColumnText(Object element, int columnIndex) {
ITableFilter tf = (ITableFilter) element;
- String result = "";
+ String result = ""; //$NON-NLS-1$
switch (columnIndex) {
case 0:
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,6 +42,7 @@
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.utils.ProjectUtils;
@@ -86,8 +87,8 @@
private TableViewer createTableFilterViewer() {
TableViewer result = new TableViewer( rightTable );
result.setUseHashlookup( true );
- result.setColumnProperties( new String[] { "inclusion", "catalog",
- "schema", "name" } );
+ result.setColumnProperties( new String[] { "inclusion", "catalog", //$NON-NLS-1$//$NON-NLS-2$
+ "schema", "name" } ); //$NON-NLS-1$ //$NON-NLS-2$
/*
* AutoResizeTableLayout autoResizeTableLayout = new
@@ -161,16 +162,16 @@
TableContainer tc = (TableContainer) sel;
filter = revEngDef.createTableFilter();
String schema = tc.getName();
- if(schema==null || "".equals(schema)) {
- filter.setMatchCatalog(".*");
- filter.setMatchSchema(".*");
+ if(schema==null || "".equals(schema)) { //$NON-NLS-1$
+ filter.setMatchCatalog(".*"); //$NON-NLS-1$
+ filter.setMatchSchema(".*"); //$NON-NLS-1$
} else { // fake catalog handling
String catalog = StringHelper.qualifier(schema);
schema = StringHelper.unqualify(schema);
- filter.setMatchCatalog( "".equals(catalog)?".*":catalog );
- filter.setMatchSchema( "".equals(schema)?".*":schema );
+ filter.setMatchCatalog( "".equals(catalog)?".*":catalog ); //$NON-NLS-1$ //$NON-NLS-2$
+ filter.setMatchSchema( "".equals(schema)?".*":schema ); //$NON-NLS-1$ //$NON-NLS-2$
}
- filter.setMatchName(".*");
+ filter.setMatchName(".*"); //$NON-NLS-1$
filter.setExclude( Boolean.valueOf( exclude ) );
} else if ( sel instanceof Column ) {
// we ignore column since at the moment we dont know which table is there.
@@ -184,7 +185,7 @@
}
} else {
ITableFilter filter = revEngDef.createTableFilter();
- filter.setMatchName(".*");
+ filter.setMatchName(".*"); //$NON-NLS-1$
filter.setExclude( Boolean.valueOf( exclude ) );
revEngDef.addTableFilter( filter );
}
@@ -195,7 +196,7 @@
}
protected String[] getAddButtonLabels() {
- return new String[] { "Include...", "Exclude..." };
+ return new String[] { HibernateConsoleMessages.TableFilterView_include, HibernateConsoleMessages.TableFilterView_exclude };
}
protected void handleAddButtonPressed(int i) {
@@ -207,12 +208,12 @@
doExclusion();
break;
default:
- throw new IllegalArgumentException( i + " not a known button" );
+ throw new IllegalArgumentException( i + HibernateConsoleMessages.TableFilterView_not_known_button );
}
}
protected void doRemoveAll() {
- if(MessageDialog.openQuestion( getShell(), "Remove all filters" , "Do you want to remove all filters ?")) {
+ if(MessageDialog.openQuestion( getShell(), HibernateConsoleMessages.TableFilterView_remove_all_filters , HibernateConsoleMessages.TableFilterView_do_you_want_to_remove_all_filters)) {
revEngDef.removeAllTableFilters();
}
}
@@ -243,26 +244,26 @@
revEngDef.moveTableFilterUp( item );
}
}
-
+
protected void createTableColumns(org.eclipse.swt.widgets.Table table) {
- TableColumn column = new TableColumn(table, SWT.CENTER, 0);
- column.setText("!");
+ TableColumn column = new TableColumn(table, SWT.CENTER, 0);
+ column.setText(HibernateConsoleMessages.TableFilterView_sign);
column.setWidth(20);
-
+
column = new TableColumn(table, SWT.LEFT, 1);
- column.setText("Catalog");
+ column.setText(HibernateConsoleMessages.TableFilterView_catalog);
column.setWidth(100);
-
+
column = new TableColumn(table, SWT.LEFT, 2);
- column.setText("Schema");
+ column.setText(HibernateConsoleMessages.TableFilterView_schema);
column.setWidth(100);
column = new TableColumn(table, SWT.LEFT, 3);
- column.setText("Table");
+ column.setText(HibernateConsoleMessages.TableFilterView_table);
column.setWidth(100);
}
-
- public void dispose() {
+
+ public void dispose() {
super.dispose();
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -35,6 +35,7 @@
import org.eclipse.swt.widgets.Composite;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.model.impl.ReverseEngineeringDefinitionImpl;
@@ -42,32 +43,32 @@
public class TableFilterWizardPage extends WizardPage {
// TODO: clean this up to use a shared wizard model
-
+
ComboDialogField consoleConfigurationName;
private TableFilterView tfc;
private final String selectedConfiguratonName;
-
- protected TableFilterWizardPage(String pageName, String selectedConfiguratonName) {
+
+ protected TableFilterWizardPage(String pageName, String selectedConfiguratonName) {
super( pageName );
this.selectedConfiguratonName = selectedConfiguratonName;
- setTitle("Configure Table filters");
- setDescription("Specify which catalog/schema/tables should be included or excluded from the reverse engineering.");
+ setTitle(HibernateConsoleMessages.TableFilterWizardPage_configure_table_filters);
+ setDescription(HibernateConsoleMessages.TableFilterWizardPage_specify_which_catalog);
}
public void createControl(Composite parent) {
initializeDialogUnits(parent);
-
+
Composite container = new Composite(parent, SWT.NULL);
//container.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_CYAN));
-
+
GridLayout layout = new GridLayout();
-
+
container.setLayout(layout);
layout.numColumns = 3;
layout.verticalSpacing = 10;
-
+
consoleConfigurationName = new ComboDialogField(SWT.READ_ONLY);
- consoleConfigurationName.setLabelText("Console &configuration:");
+ consoleConfigurationName.setLabelText(HibernateConsoleMessages.TableFilterWizardPage_console_configuration);
ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
@@ -75,7 +76,7 @@
names[i] = configuration.getName();
}
consoleConfigurationName.setItems(names);
-
+
consoleConfigurationName.doFillIntoGrid(container, 3);
IDialogFieldListener fieldlistener = new IDialogFieldListener() {
@@ -84,19 +85,19 @@
}
};
consoleConfigurationName.setDialogFieldListener(fieldlistener);
-
+
TreeToTableComposite tfc = createTableFilterPart( container );
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.horizontalSpan=3;
tfc.setLayoutData(gd);
-
+
setControl(container);
if(selectedConfiguratonName!=null) {
- consoleConfigurationName.setText(selectedConfiguratonName);
+ consoleConfigurationName.setText(selectedConfiguratonName);
}
dialogChanged();
- }
+ }
private void updateWarningStatus(String message) {
setMessage(message, IMessageProvider.WARNING);
@@ -106,17 +107,17 @@
* Ensures that contents is ok.
*/
private void dialogChanged() {
-
+
if (hasDuplicates()) {
- updateWarningStatus("Table filters contains duplicates.");
+ updateWarningStatus(HibernateConsoleMessages.TableFilterWizardPage_table_filters_contains_duplicates);
return;
}
updateWarningStatus(null);
}
-
+
protected boolean hasDuplicates() {
- boolean res = false;
+ boolean res = false;
ITableFilter[] filters = getTableFilters();
for (int i = 1; i < filters.length; i++) {
for (int j = 0; j < i; j++) {
@@ -134,13 +135,13 @@
private TreeToTableComposite createTableFilterPart(Composite container) {
tfc = new TableFilterView(container, SWT.NULL){
-
+
protected String getConsoleConfigurationName() {
return consoleConfigurationName.getText();
}
-
- };
-
+
+ };
+
IReverseEngineeringDefinition model = new ReverseEngineeringDefinitionImpl();
model.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
@@ -154,5 +155,5 @@
public ITableFilter[] getTableFilters() {
return tfc.getTableFilterList();
}
-
+
}
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TreeToTableComposite.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -38,6 +38,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.Widget;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class TreeToTableComposite extends Composite {
@@ -47,7 +48,7 @@
}
protected void doSetValue(Object value) {
- if(value==null) { value=""; }
+ if(value==null) { value=""; } //$NON-NLS-1$
super.doSetValue( value );
}
@@ -58,23 +59,23 @@
} else {
return super.doGetValue();
}
- }
+ }
}
-
+
static public class MultiStateCellEditor extends CellEditor {
-
+
private int value;
private final int maxStates;
-
+
public MultiStateCellEditor(Composite parent, int stateCount, int initialValue) {
super(parent);
- if(stateCount < 1) throw new IllegalArgumentException("incorrect state count");
+ if(stateCount < 1) throw new IllegalArgumentException(HibernateConsoleMessages.TreeToTableComposite_incorrect_state_count);
maxStates= stateCount;
-
- if(!(initialValue >= 0 && initialValue < stateCount)) throw new IllegalArgumentException("incorrect initial value");
+
+ if(!(initialValue >= 0 && initialValue < stateCount)) throw new IllegalArgumentException(HibernateConsoleMessages.TreeToTableComposite_incorrect_initial_value);
value= initialValue;
-
+
setValueValid(true);
}
@@ -82,10 +83,10 @@
value= getNextValue(maxStates, value);
fireApplyEditorValue();
}
-
+
public static int getNextValue(int stateCount, int currentValue){
- if(!(stateCount > 1)) throw new IllegalStateException("incorrect state count");
- if(!(currentValue >= 0 && currentValue < stateCount)) throw new IllegalStateException("incorrect initial value");
+ if(!(stateCount > 1)) throw new IllegalStateException(HibernateConsoleMessages.TreeToTableComposite_incorrect_state_count);
+ if(!(currentValue >= 0 && currentValue < stateCount)) throw new IllegalStateException(HibernateConsoleMessages.TreeToTableComposite_incorrect_initial_value);
return (currentValue + 1) % stateCount;
}
@@ -103,12 +104,12 @@
protected void doSetValue(Object value) {
this.value = ((Integer) value).intValue();
if(!(this.value >= 0 && this.value < maxStates)) {
- throw new IllegalStateException("invalid value");
+ throw new IllegalStateException(HibernateConsoleMessages.TreeToTableComposite_invalid_value);
}
}
}
-
+
/** CellEditor that works like a texteditor, but returns/accepts Integer values. If the entered string is not parsable it returns null */
static protected final class IntegerCellEditor extends NullableTextCellEditor {
public IntegerCellEditor(Composite parent) {
@@ -118,7 +119,7 @@
protected void doSetValue(Object value) {
if(value!=null && value instanceof Integer) {
value = ((Integer)value).toString();
- }
+ }
super.doSetValue( value );
}
@@ -135,7 +136,7 @@
}
}
}
-
+
private Group dbgroup = null;
private Composite manipulationGroup = null;
protected Tree tree = null;
@@ -158,7 +159,7 @@
Button but = addButtons[i];
if(button == but) {
handleAddButtonPressed(i);
- }
+ }
}
}
};;
@@ -169,7 +170,7 @@
}
protected void handleAddButtonPressed(int i) {
-
+
}
@@ -182,11 +183,11 @@
createTableFiltersGroup();
createComposite();
setSize(new org.eclipse.swt.graphics.Point(913,358));
- label = new Label(this, SWT.NONE);
+ label = new Label(this, SWT.NONE);
}
/**
- * This method initializes dbgroup
+ * This method initializes dbgroup
*
*/
private void createDbgroup() {
@@ -204,11 +205,11 @@
}
protected String getTreeTitle() {
- return "Database schema:";
+ return HibernateConsoleMessages.TreeToTableComposite_database_schema;
}
/**
- * This method initializes includeExcludeGroup
+ * This method initializes includeExcludeGroup
*
*/
private void createIncludeExcludeGroup() {
@@ -241,10 +242,10 @@
manipulationGroup.setLayout(gridLayout1);
createAddButtons(manipulationGroup);
fillLabel = new Label(manipulationGroup, SWT.NONE);
- fillLabel.setText("");
+ fillLabel.setText(""); //$NON-NLS-1$
fillLabel.setLayoutData(gridData6);
upButton = new Button(manipulationGroup, SWT.NONE);
- upButton.setText("Up");
+ upButton.setText(HibernateConsoleMessages.TreeToTableComposite_up);
upButton.setLayoutData(gridData5);
upButton.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
@@ -252,7 +253,7 @@
}
} );
downButton = new Button(manipulationGroup, SWT.NONE);
- downButton.setText("Down");
+ downButton.setText(HibernateConsoleMessages.TreeToTableComposite_down);
downButton.setLayoutData(gridData4);
downButton.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
@@ -260,7 +261,7 @@
}
} );
removeButton = new Button(manipulationGroup, SWT.NONE);
- removeButton.setText("Remove");
+ removeButton.setText(HibernateConsoleMessages.TreeToTableComposite_remove);
removeButton.setLayoutData(gridData3);
removeButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
@@ -268,7 +269,7 @@
}
});
removeAllButton = new Button(manipulationGroup, SWT.NONE);
- removeAllButton.setText("Remove All");
+ removeAllButton.setText(HibernateConsoleMessages.TreeToTableComposite_remove_all);
removeAllButton.setLayoutData(gridData3);
removeAllButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
@@ -278,12 +279,12 @@
}
private void createAddButtons(Composite parent) {
-
+
String[] addButtonLabels = getAddButtonLabels();
addButtons = new Button[addButtonLabels.length];
for (int i = 0; i < addButtonLabels.length; i++) {
String label = addButtonLabels[i];
- addButtons[i] = createButton(parent, label);
+ addButtons[i] = createButton(parent, label);
addButtons[i].setEnabled(true);
}
}
@@ -292,7 +293,7 @@
Button button = new Button(parent, SWT.PUSH);
GridData data = new GridData();
data.horizontalAlignment = GridData.FILL;
-
+
button.setLayoutData(data);
button.setFont(parent.getFont() );
button.setText(label);
@@ -302,31 +303,31 @@
}
protected String[] getAddButtonLabels() {
- return new String[] { "Include...", "Exclude..."};
+ return new String[] { HibernateConsoleMessages.TreeToTableComposite_include, HibernateConsoleMessages.TreeToTableComposite_exclude};
}
protected void doRemove() {
// TODO Auto-generated method stub
-
+
}
protected void doRemoveAll() {
// TODO Auto-generated method stub
-
+
}
protected void doMoveDown() {
// TODO Auto-generated method stub
-
+
}
protected void doMoveUp() {
// TODO Auto-generated method stub
-
+
}
-
+
/**
- * This method initializes tree
+ * This method initializes tree
*
*/
private void createTree() {
@@ -334,7 +335,7 @@
}
/**
- * This method initializes tableFiltersGroup
+ * This method initializes tableFiltersGroup
*
*/
private void createTableFiltersGroup() {
@@ -352,18 +353,18 @@
}
protected String getTableTitle() {
- return "Table filters:";
+ return HibernateConsoleMessages.TreeToTableComposite_table_filters;
}
/**
- * This method initializes tableFilters
+ * This method initializes tableFilters
*
*/
private void createTableFilters() {
rightTable = new Table(tableFiltersGroup, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION );
rightTable.setHeaderVisible(true);
rightTable.setLinesVisible(true);
-
+
createTableColumns(rightTable);
}
@@ -372,7 +373,7 @@
}
/**
- * This method initializes composite
+ * This method initializes composite
*
*/
private void createComposite() {
@@ -390,23 +391,23 @@
composite.setLayoutData(gridData8);
composite.setLayout(gridLayout2);
emptyLabel = new Label(composite, SWT.NONE);
- emptyLabel.setText("");
+ emptyLabel.setText(""); //$NON-NLS-1$
emptyLabel.setLayoutData(gridData9);
refreshButton = new Button(composite, SWT.NONE);
- refreshButton.setText("Refresh");
+ refreshButton.setText(HibernateConsoleMessages.TreeToTableComposite_refresh);
refreshButton
.addSelectionListener( new org.eclipse.swt.events.SelectionAdapter() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
- doRefreshTree();
+ doRefreshTree();
}
} );
}
protected void doRefreshTree() {
-
+
}
-
+
public void setEnabled(boolean enabled) {
upButton.setEnabled(enabled);
downButton.setEnabled(enabled);
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 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingCellModifier.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -36,32 +36,32 @@
public void modify(Object element, String property, Object value) {
ITypeMapping tf = (ITypeMapping) ((TableItem)element).getData();
- if("jdbctype".equals(property)) {
+ if("jdbctype".equals(property)) { //$NON-NLS-1$
if(!safeEquals( value, tf.getJDBCType() )) {
tf.setJDBCType((String) value);
}
}
- if("hibernatetype".equals(property)) {
+ if("hibernatetype".equals(property)) { //$NON-NLS-1$
if(!safeEquals( value, tf.getHibernateType())) {
tf.setHibernateType((String) value);
}
}
- if("length".equals(property)) {
+ if("length".equals(property)) { //$NON-NLS-1$
if(!safeEquals(value, tf.getLength())) {
tf.setLength((Integer) value);
}
}
- if("precision".equals(property)) {
+ if("precision".equals(property)) { //$NON-NLS-1$
if(!safeEquals(value, tf)) {
tf.setPrecision((Integer) value);
}
}
- if("scale".equals(property)) {
+ if("scale".equals(property)) { //$NON-NLS-1$
if(!safeEquals(value,tf.getScale())) {
tf.setScale((Integer) value);
}
}
- if("not-null".equals(property)) {
+ if("not-null".equals(property)) { //$NON-NLS-1$
Boolean integerToBoolean = notnullToNullable((Integer) value);
if(!safeEquals(integerToBoolean,tf.getNullable())) {
tf.setNullable(integerToBoolean);
@@ -85,24 +85,24 @@
public Object getValue(Object element, String property) {
ITypeMapping tf = (ITypeMapping) element;
- if("precision".equals(property)) {
+ if("precision".equals(property)) { //$NON-NLS-1$
return tf.getPrecision();
}
- if("jdbctype".equals(property)) {
+ if("jdbctype".equals(property)) { //$NON-NLS-1$
return tf.getJDBCType();
}
- if("hibernatetype".equals(property)) {
+ if("hibernatetype".equals(property)) { //$NON-NLS-1$
return tf.getHibernateType();
}
- if("scale".equals(property)) {
+ if("scale".equals(property)) { //$NON-NLS-1$
return tf.getScale();
}
- if("length".equals(property)) {
+ if("length".equals(property)) { //$NON-NLS-1$
return tf.getLength();
}
- if("not-null".equals(property)) {
+ if("not-null".equals(property)) { //$NON-NLS-1$
if(tf.getNullable()==null) {
return new Integer(2);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingLabelProvider.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TypeMappingLabelProvider.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -34,7 +34,7 @@
public String getColumnText(Object element, int columnIndex) {
ITypeMapping tf = (ITypeMapping) element;
- String result = "";
+ String result = ""; //$NON-NLS-1$
switch (columnIndex) {
case 0:
@@ -55,7 +55,7 @@
}
private String safeToString(Object length) {
- if(length==null) return "";
+ if(length==null) return ""; //$NON-NLS-1$
return length.toString();
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,6 +42,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class UpDownListComposite extends Composite {
@@ -50,7 +51,7 @@
handleButtonPressed( (Button) e.widget);
}
};
-
+
private Group group = null;
private Table table = null;
private Composite buttons = null;
@@ -67,12 +68,12 @@
private final boolean checkboxInTable;
private IContentProvider contentProvider;
-
+
public UpDownListComposite(Composite parent, int style) {
- this( parent, style, "");
+ this( parent, style, ""); //$NON-NLS-1$
}
-
+
public UpDownListComposite(Composite parent, int style, String title) {
this( parent, style, title, false, null, null);
}
@@ -88,12 +89,12 @@
private void initialize() {
createGroup();
- GridLayout gridLayout = new GridLayout();
+ GridLayout gridLayout = new GridLayout();
this.setLayout(gridLayout);
}
/**
- * This method initializes group
+ * This method initializes group
*
*/
private void createGroup() {
@@ -113,7 +114,7 @@
}
/**
- * This method initializes table
+ * This method initializes table
*
*/
private void createTable() {
@@ -124,29 +125,29 @@
gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData1.heightHint = 20;
gridData1.widthHint = 20;
-
+
table = new Table(group, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI | (checkboxInTable?SWT.CHECK:SWT.NONE));
table.setHeaderVisible(false);
table.setLayoutData(gridData1);
table.setLinesVisible(false);
createColumns(table);
-
+
table.addSelectionListener(new SelectionListener() {
-
+
public void widgetDefaultSelected(SelectionEvent e) {
- handleTableSelectionChanged();
+ handleTableSelectionChanged();
}
-
+
public void widgetSelected(SelectionEvent e) {
- handleTableSelectionChanged();
+ handleTableSelectionChanged();
}
-
+
});
-
+
tableView = checkboxInTable?new CheckboxTableViewer(table):new TableViewer(table);
if(provider!=null) tableView.setLabelProvider(provider);
if(contentProvider!=null) tableView.setContentProvider(contentProvider);
-
+
}
protected void createColumns(Table table) {
@@ -156,7 +157,7 @@
}
/**
- * This method initializes buttons
+ * This method initializes buttons
*
*/
private void createButtons() {
@@ -180,33 +181,33 @@
buttons = new Composite( group, SWT.NONE );
buttons.setLayout(new GridLayout());
buttons.setLayoutData(gridData2);
-
+
String[] addButtonLabels = getAddButtonLabels();
addButtons = new Button[addButtonLabels.length];
for (int i = 0; i < addButtonLabels.length; i++) {
String label = addButtonLabels[i];
- addButtons[i] = createButton(buttons, label);
+ addButtons[i] = createButton(buttons, label);
addButtons[i].setEnabled(true);
}
removeButton = new Button(buttons, SWT.NONE);
- removeButton.setText("Remove");
+ removeButton.setText(HibernateConsoleMessages.UpDownListComposite_remove);
removeButton.setLayoutData(gridData3);
removeButton.addSelectionListener(buttonListener);
fillLabel = new Label(buttons, SWT.NONE);
- fillLabel.setText("");
+ fillLabel.setText(""); //$NON-NLS-1$
fillLabel.setLayoutData(gridData6);
upButton = new Button(buttons, SWT.NONE);
- upButton.setText("Up");
+ upButton.setText(HibernateConsoleMessages.UpDownListComposite_up);
upButton.setLayoutData(gridData4);
upButton.addSelectionListener(buttonListener);
downButton = new Button(buttons, SWT.NONE);
- downButton.setText("Down");
+ downButton.setText(HibernateConsoleMessages.UpDownListComposite_down);
downButton.setLayoutData(gridData5);
downButton.addSelectionListener(buttonListener);
}
- protected String[] getAddButtonLabels() {
- return new String[] { "Add..." };
+ protected String[] getAddButtonLabels() {
+ return new String[] { HibernateConsoleMessages.UpDownListComposite_add };
}
private Button createButton(Composite parent, String label) {
@@ -216,7 +217,7 @@
//data.grabExcessVerticalSpace = true;
data.horizontalAlignment = GridData.FILL;
//data.verticalAlignment = GridData.FILL;
-
+
button.setLayoutData(data);
button.setFont(parent.getFont() );
button.setText(label);
@@ -237,12 +238,12 @@
Button but = addButtons[i];
if(button == but) {
handleAddButtonPressed(i);
- }
- }
+ }
+ }
}
handleTableSelectionChanged();
tableView.getTable().setFocus();
-
+
}
protected void moveSelectionDown() {
@@ -287,23 +288,23 @@
item.dispose();
viewer.insert(data, index);
}
-
+
protected void handleRemove() {
IStructuredSelection selection = (IStructuredSelection) tableView.getSelection();
if (selection != null) {
int numSelected= selection.size();
-
+
Iterator iterator= selection.iterator();
while (iterator.hasNext() ) {
Object item= iterator.next();
tableView.remove(item);
}
listChanged();
- }
+ }
}
-
-
-
+
+
+
private void handleAddButtonPressed(int i) {
Object[] o = handleAdd(i);
if(o!=null) {
@@ -320,7 +321,7 @@
}
protected Object[] handleAdd(int i) {
- return new Object[] { " test " };
+ return new Object[] { HibernateConsoleMessages.UpDownListComposite_test };
}
/**
@@ -352,7 +353,7 @@
public Table getTable() {
return tableView.getTable();
}
-
+
public TableViewer getTableViewer() {
return tableView;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BasicWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -34,12 +34,13 @@
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.progress.IElementCollector;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
public abstract class BasicWorkbenchAdapter implements IDeferredWorkbenchAdapter {
static class MutexRule implements ISchedulingRule {
-
+
private final Object mutex;
public MutexRule(Object mutex) {
@@ -60,16 +61,16 @@
} else {
return false;
}
- }
+ }
}
final static Object[] NO_CHILDREN = new Object[0];
-
-
+
+
protected Object[] toArray(Iterator iterator, Class clazz, Comparator comparator) {
List obj = toList( iterator );
Object[] array = obj.toArray((Object[]) Array.newInstance(clazz, obj.size()));
-
+
if(comparator!=null) {
Arrays.sort(array, comparator);
}
@@ -83,7 +84,7 @@
}
return obj;
}
-
+
protected Object[] toArray(Enumeration enumeration, Class clazz) {
List obj = new ArrayList();
while ( enumeration.hasMoreElements() ) {
@@ -96,14 +97,14 @@
public Object[] getChildren(Object o, final IProgressMonitor monitor) {
return getChildren(o);
}
-
+
public void fetchDeferredChildren(Object object,
IElementCollector collector, IProgressMonitor monitor) {
try {
collector.add(getChildren(object, monitor), monitor);
collector.done();
} catch(Exception e) {
- handleError(collector,object, e);
+ handleError(collector,object, e);
} finally {
collector.done();
monitor.done();
@@ -112,27 +113,27 @@
protected void handleError(IElementCollector collector, Object object, Exception e) {
HibernateConsolePlugin.getDefault().logMessage(IStatus.WARNING, e.toString(), e);
- HibernateConsolePlugin.openError(null, getDefaultErrorTitle(), getDefaultErrorMessage(object), e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
+ HibernateConsolePlugin.openError(null, getDefaultErrorTitle(), getDefaultErrorMessage(object), e, HibernateConsolePlugin.PERFORM_SYNC_EXEC);
}
private String getDefaultErrorMessage(Object object) {
- return "Error while expanding " + getLabel(object);
+ return HibernateConsoleMessages.BasicWorkbenchAdapter_error_while_expanding + getLabel(object);
}
-
+
private String getDefaultErrorTitle() {
- return "Hibernate Configuration error";
+ return HibernateConsoleMessages.BasicWorkbenchAdapter_hibernate_configuration_error;
}
public boolean isContainer() {
return true;
}
-
+
final public ISchedulingRule getRule(Object object) {
//return new MutexRule(object);
return null;
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BeanPropertyDescriptor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BeanPropertyDescriptor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/BeanPropertyDescriptor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -96,7 +96,7 @@
}
public String getText(Object element) {
- return "" + element;
+ return "" + element; //$NON-NLS-1$
}
public Image getImage(Object element) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ColumnWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -45,7 +45,7 @@
static String getColumnLabel(Column c) {
String label = c.getName();
if(c.getSqlTypeCode()!=null) {
- label += " : " + JDBCToHibernateTypeHelper.getJDBCTypeName(c.getSqlTypeCode().intValue());
+ label += " : " + JDBCToHibernateTypeHelper.getJDBCTypeName(c.getSqlTypeCode().intValue()); //$NON-NLS-1$
}
return label;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConfigurationWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -28,6 +28,7 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.mapping.PersistentClass;
@@ -37,7 +38,7 @@
Configuration cfg = (Configuration) o;
Iterator classMappings = cfg.getClassMappings();
return toArray(classMappings, PersistentClass.class, new Comparator() {
-
+
public int compare(Object arg0, Object arg1) {
PersistentClass p0 = (PersistentClass) arg0;
PersistentClass p1 = (PersistentClass) arg1;
@@ -45,7 +46,7 @@
String label1 = HibernateWorkbenchHelper.getLabelForClassName(p1.getEntityName());
return label0.compareTo(label1);
}
-
+
});
}
@@ -54,7 +55,7 @@
}
public String getLabel(Object o) {
- return "Configuration";
+ return HibernateConsoleMessages.ConfigurationWorkbenchAdapter_configuration;
}
public Object getParent(Object o) {
@@ -64,7 +65,7 @@
public boolean isContainer() {
return true;
}
-
-
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,26 +27,27 @@
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.execution.ExecutionContext;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
public class ConsoleConfigurationWorkbenchAdapter extends BasicWorkbenchAdapter {
-
+
public Object[] getChildren(Object o) {
final ConsoleConfiguration ccfg = getConsoleConfiguration( o );
//String sfError = null;
if(ccfg.getConfiguration()==null) {
ccfg.build();
ccfg.execute( new ExecutionContext.Command() {
-
+
public Object execute() {
if(ccfg.hasConfiguration()) {
ccfg.getConfiguration().buildMappings();
}
return ccfg;
- }
+ }
} );
- }
-
+ }
+
/*if(ccfg.getSessionFactory()==null) { // initialize later?
try {
ccfg.buildSessionFactory();
@@ -55,26 +56,26 @@
HibernateConsolePlugin.getDefault().logErrorMessage("Problems while creating sessionfactory", t);
}
}*/
-
-
+
+
Configuration configuration = ccfg.getConfiguration();
Object o1;
if(configuration!=null) {
o1 = configuration;
} else {
- o1 = "<Empty Configuration>";
+ o1 = HibernateConsoleMessages.ConsoleConfigurationWorkbenchAdapter_empty_configuration;
}
-
+
/*Object o2;
-
+
if(sfError==null) {
NodeFactory fac = new NodeFactory(ccfg);
ConfigurationEntitiesNode cfgNode = fac.createConfigurationEntitiesNode("Session factory");
- o2 = cfgNode;
+ o2 = cfgNode;
} else {
- o2 = sfError;
+ o2 = sfError;
}*/
-
+
return new Object[] { o1, new LazySessionFactory(ccfg), new LazyDatabaseSchema(ccfg) };
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,6 +27,7 @@
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.progress.IElementCollector;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class KnownConfigurationsWorkbenchAdapter implements IDeferredWorkbenchAdapter {
@@ -40,7 +41,7 @@
}
public String getLabel(Object o) {
- return "Configurations";
+ return HibernateConsoleMessages.KnownConfigurationsWorkbenchAdapter_configurations;
}
public Object getParent(Object o) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -30,6 +30,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.JDBCReaderFactory;
@@ -41,43 +42,45 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.execution.ExecutionContext;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
public class LazyDatabaseSchemaWorkbenchAdapter extends BasicWorkbenchAdapter {
-
+
public Object[] getChildren(Object o) {
return getChildren(o, new NullProgressMonitor());
}
-
+
public Object[] getChildren(Object o, final IProgressMonitor monitor) {
LazyDatabaseSchema dbs = getLazyDatabaseSchema( o );
final DefaultDatabaseCollector db = new DefaultDatabaseCollector();
-
+
ConsoleConfiguration consoleConfiguration = dbs.getConsoleConfiguration();
try{
readDatabaseSchema(monitor, db, consoleConfiguration, dbs.getReverseEngineeringStrategy());
-
+
List result = new ArrayList();
-
+
Iterator qualifierEntries = db.getQualifierEntries();
while ( qualifierEntries.hasNext() ) {
Map.Entry entry = (Map.Entry) qualifierEntries.next();
result.add(new TableContainer((String) entry.getKey(),(List)entry.getValue()));
}
return toArray(result.iterator(), TableContainer.class, new Comparator() {
-
+
public int compare(Object arg0, Object arg1) {
-
+
return ((TableContainer)arg0).getName().compareTo(((TableContainer)arg1).getName());
}
-
+
});
} catch (HibernateException e){
- HibernateConsolePlugin.getDefault().logErrorMessage("Problems while reading database schema", e);
- return new Object[]{"<Reading schema error: " + e.getMessage() + ">"};
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema, e);
+ String out = NLS.bind(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error, e.getMessage());
+ return new Object[]{out};
}
-
+
}
private LazyDatabaseSchema getLazyDatabaseSchema(Object o) {
@@ -89,36 +92,36 @@
}
public String getLabel(Object o) {
- return "Database";
+ return HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_database;
}
public Object getParent(Object o) {
return getLazyDatabaseSchema(o).getConsoleConfiguration();
}
-
+
protected void readDatabaseSchema(final IProgressMonitor monitor, final DefaultDatabaseCollector db, ConsoleConfiguration consoleConfiguration, final ReverseEngineeringStrategy strategy) {
final Configuration configuration = consoleConfiguration.buildWith(null, false);
-
+
consoleConfiguration.getExecutionContext().execute(new ExecutionContext.Command() {
-
+
public Object execute() {
Settings settings = configuration.buildSettings();
ConnectionProvider connectionProvider = null;
try {
connectionProvider = settings.getConnectionProvider();
-
+
JDBCReader reader = JDBCReaderFactory.newJDBCReader(configuration.getProperties(), settings, strategy);
reader.readDatabaseSchema(db, settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), new ProgressListenerMonitor(monitor));
} catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problem while reading database schema", he);
- return new Object[] { "<Schema not available>"};
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_problem_while_reading_database_schema, he);
+ return new Object[] { HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_schema_not_available};
}
finally {
if (connectionProvider!=null) {
connectionProvider.close();
- }
+ }
}
-
+
return null;
}
});
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -22,42 +22,44 @@
package org.hibernate.eclipse.console.workbench;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.node.BaseNode;
import org.hibernate.console.node.NodeFactory;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
public class LazySessionFactoryAdapter extends BasicWorkbenchAdapter {
-
-
-
+
+
+
public Object[] getChildren(Object o) {
LazySessionFactory lazySessionFactory = getLazySessionFactory(o);
- String label = "Session Factory";
- if(lazySessionFactory.getCfgNode()==null) {
- if(lazySessionFactory.getConsoleConfiguration().getSessionFactory()==null) {
+ String label = HibernateConsoleMessages.LazySessionFactoryAdapter_session_factory;
+ if(lazySessionFactory.getCfgNode()==null) {
+ if(lazySessionFactory.getConsoleConfiguration().getSessionFactory()==null) {
try {
lazySessionFactory.getConsoleConfiguration().buildSessionFactory();
} catch(Throwable t) {
- label = "<Sessionfactory error: " + t.getMessage() + ">";
- HibernateConsolePlugin.getDefault().logErrorMessage("Problems while creating sessionfactory", t);
+ label = NLS.bind(HibernateConsoleMessages.LazySessionFactoryAdapter_sessionfactory_error, t.getMessage());
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.LazySessionFactoryAdapter_problems_while_creating_sessionfactory, t);
}
}
if(lazySessionFactory.getConsoleConfiguration().isSessionFactoryCreated()) {
NodeFactory fac = new NodeFactory(lazySessionFactory.getConsoleConfiguration());
lazySessionFactory.setCfgNode( fac.createConfigurationEntitiesNode(label) );
- }
+ }
}
if(lazySessionFactory.getCfgNode()!=null) {
- return toArray(lazySessionFactory.getCfgNode().children(),BaseNode.class);
+ return toArray(lazySessionFactory.getCfgNode().children(),BaseNode.class);
} else {
return new Object[] { label };
}
}
private LazySessionFactory getLazySessionFactory(Object o) {
- return (LazySessionFactory)o;
+ return (LazySessionFactory)o;
}
public ImageDescriptor getImageDescriptor(Object object) {
@@ -65,10 +67,10 @@
}
public String getLabel(Object o) {
- return "Session Factory";
+ return HibernateConsoleMessages.LazySessionFactoryAdapter_session_factory;
}
- public Object getParent(Object o) {
+ public Object getParent(Object o) {
return getLazySessionFactory( o ).getConsoleConfiguration();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PrimaryKeyWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,6 +23,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.PrimaryKey;
@@ -31,7 +32,7 @@
public Object[] getChildren(Object o) {
PrimaryKey t = getPrimaryKey( o );
-
+
if(t.getColumnSpan()==1) {
return NO_CHILDREN;
} else {
@@ -52,7 +53,7 @@
if(table.getColumnSpan()==1) {
return ColumnWorkbenchAdapter.getColumnLabel(table.getColumn(0));
} else {
- return "Composite primary key";
+ return HibernateConsoleMessages.PrimaryKeyWorkbenchAdapter_composite_primary_key;
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/PropertyWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -121,7 +121,7 @@
String typeName = (String) value.accept(new TypeNameValueVisitor(true));
if (typeName!=null) {
- return property.getName() + " : " + typeName;
+ return property.getName() + " : " + typeName; //$NON-NLS-1$
}
return property.getName();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,6 +25,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.mapping.Table;
@@ -33,12 +34,12 @@
public Object[] getChildren(Object o) {
TableContainer tc = getTableContainer( o );
return toArray(tc.getTables().iterator(), Table.class, new Comparator() {
-
+
public int compare(Object arg0, Object arg1) {
-
+
return ((Table)arg0).getName().compareTo(((Table)arg1).getName());
}
-
+
});
}
@@ -52,12 +53,12 @@
public String getLabel(Object o) {
String name = getTableContainer(o).getName();
- return "".equals(name)?"<default>":name;
+ return "".equals(name)?HibernateConsoleMessages.TableContainerWorkbenchAdapter_default:name; //$NON-NLS-1$
}
public Object getParent(Object o) {
return null;
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TypeNameValueVisitor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -47,27 +47,27 @@
}
public Object accept(Bag bag) {
- return "Bag <" + bag.getElement().accept(this) + ">";
+ return "Bag <" + bag.getElement().accept(this) + ">"; //$NON-NLS-1$//$NON-NLS-2$
}
public Object accept(IdentifierBag bag) {
- return "IdBag <" + bag.getElement().accept(this) + ">";
+ return "IdBag <" + bag.getElement().accept(this) + ">"; //$NON-NLS-1$//$NON-NLS-2$
}
public Object accept(List list) {
- return "List <" + list.getElement().accept(this) + ">";
+ return "List <" + list.getElement().accept(this) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
}
public Object accept(PrimitiveArray primitiveArray) {
- return primitiveArray.getElement().accept(this) + "[]";
+ return primitiveArray.getElement().accept(this) + "[]"; //$NON-NLS-1$
}
public Object accept(Array list) {
- return list.getElement().accept(this) + "[]";
+ return list.getElement().accept(this) + "[]"; //$NON-NLS-1$
}
public Object accept(Map map) {
- return "Map<" + map.getElement().accept(this) + ">";
+ return "Map<" + map.getElement().accept(this) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
}
public Object accept(OneToMany many) {
@@ -75,18 +75,18 @@
}
private String dequalify(String referencedEntityName) {
- if(dequalify && referencedEntityName!=null && referencedEntityName.indexOf(".")>=0) {
+ if(dequalify && referencedEntityName!=null && referencedEntityName.indexOf(".")>=0) { //$NON-NLS-1$
return referencedEntityName.substring(referencedEntityName.lastIndexOf('.')+1);
}
return referencedEntityName;
}
public Object accept(Set set) {
- return "Set<" + set.getElement().accept(this) + ">";
+ return "Set<" + set.getElement().accept(this) + ">"; //$NON-NLS-1$ //$NON-NLS-2$
}
public Object accept(Any any) {
- return "Any";
+ return "Any"; //$NON-NLS-1$
}
public Object accept(SimpleValue value) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ValueWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ValueWorkbenchAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ValueWorkbenchAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,6 +24,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.EclipseImages;
public class ValueWorkbenchAdapter extends BasicWorkbenchAdapter implements
@@ -38,7 +39,7 @@
}
public String getLabel(Object o) {
- return "value " + o.getClass().getName();
+ return HibernateConsoleMessages.ValueWorkbenchAdapter_value + o.getClass().getName();
}
public Object getParent(Object o) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,6 +25,7 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -35,10 +36,11 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.model.IWorkbenchAdapter2;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
/**
* LabelProvider based on WorkBenchLabelProvider that is not limited to WorkBench elements.
- *
+ *
* @author Max Rydahl Andersen
*
*/
@@ -48,7 +50,7 @@
/**
* Returns a workbench label provider that is hooked up to the decorator
* mechanism.
- *
+ *
* @return a new <code>DecoratingLabelProvider</code> which wraps a <code>
* new <code>WorkbenchLabelProvider</code>
*/
@@ -57,7 +59,7 @@
PlatformUI.getWorkbench().getDecoratorManager()
.getLabelDecorator());
}
-
+
/**
* Listener that tracks changes to the editor registry and does a full update
* when it changes, since many workbench adapters derive their icon from the file
@@ -87,7 +89,7 @@
*
* Subclasses may reimplement this method to decorate an object's
* image.
- *
+ *
* @param input The base image to decorate.
* @param element The element used to look up decorations.
* @return the resuling ImageDescriptor.
@@ -122,13 +124,13 @@
resourceManager = null;
super.dispose();
}
-
+
/**
* Returns the implementation of IWorkbenchAdapter for the given
- * object.
+ * object.
* @param o the object to look up.
* @return IWorkbenchAdapter or<code>null</code> if the adapter is not defined or the
- * object is not adaptable.
+ * object is not adaptable.
*/
protected final IWorkbenchAdapter getAdapter(Object o) {
if (o instanceof IAdaptable) {
@@ -140,10 +142,10 @@
/**
* Returns the implementation of IWorkbenchAdapter2 for the given
- * object.
+ * object.
* @param o the object to look up.
* @return IWorkbenchAdapter2 or<code>null</code> if the adapter is not defined or the
- * object is not adaptable.
+ * object is not adaptable.
*/
protected final IWorkbenchAdapter2 getAdapter2(Object o) {
if (o instanceof IAdaptable) {
@@ -183,7 +185,8 @@
return (String) element;
}
if (adapter == null) {
- return "Unknown: " + element.getClass().getName() + "(" + element + ")"; //$NON-NLS-1$
+ String out = NLS.bind(HibernateConsoleMessages.AnyAdaptableLabelProvider_unknown, element.getClass().getName(), element);
+ return out;
}
String label = adapter.getLabel(element);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -53,49 +53,49 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.AbstractQueryEditor;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.Messages;
import org.hibernate.mapping.PersistentClass;
public class CriteriaEditor extends AbstractQueryEditor {
private CriteriaEditorDocumentSetupParticipant docSetupParticipant;
-
+
public CriteriaEditor() {
super();
//setDocumentProvider(JDIDebugUIPlugin.getDefault().getSnippetDocumentProvider());
// TODO: setup document
// JavaTextTools tools= JDIDebugUIPlugin.getDefault().getJavaTextTools();
//tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
-
+
IPreferenceStore store = new ChainedPreferenceStore(new IPreferenceStore[] {
PreferenceConstants.getPreferenceStore(),
EditorsUI.getPreferenceStore()});
-
- setSourceViewerConfiguration(new JavaViewerConfiguration(HibernateConsolePlugin.getDefault().getJavaTextTools(), store, this));
+
+ setSourceViewerConfiguration(new JavaViewerConfiguration(HibernateConsolePlugin.getDefault().getJavaTextTools(), store, this));
setPreferenceStore(store);
setEditorContextMenuId("#CriteraEditorContext"); //$NON-NLS-1$
setRulerContextMenuId("#CriteraRulerContext"); //$NON-NLS-1$
-
+
}
-
+
protected void createActions() {
super.createActions();
Action action = new TextOperationAction(getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); //$NON-NLS-1$
action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
setAction("ContentAssistProposal", action);//$NON-NLS-1$
-
+
}
-
+
private ResourceBundle getResourceBundle() {
- return ResourceBundle.getBundle( Messages.BUNDLE_NAME );
+ return ResourceBundle.getBundle( HibernateConsoleMessages.BUNDLE_NAME );
}
protected void doSetInput(IEditorInput input) throws CoreException {
-
+
super.doSetInput( input );
-
+
/* Make sure the document partitioner is set up. The document setup
* participant sets up document partitioning, which is used for text
* colorizing and other text features.
@@ -128,19 +128,19 @@
evalCtx = project.newEvaluationContext();
}
if (evalCtx != null) {
- evalCtx.setImports(getImports());
+ evalCtx.setImports(getImports());
}
return evalCtx ;
}
-
+
private String[] getImports() {
-
+
ConsoleConfiguration consoleConfiguration = getConsoleConfiguration();
-
+
if(consoleConfiguration.getConfiguration()==null) {
consoleConfiguration.build();
- }
-
+ }
+
Set imports = new HashSet();
Configuration configuration = consoleConfiguration.getConfiguration();
if(configuration!=null) {
@@ -150,45 +150,45 @@
String className = clazz.getClassName();
if(className!=null) {
imports.add( className );
- }
+ }
}
}
-
- imports.add("org.hibernate.*");
- imports.add("org.hibernate.criterion.*");
-
+
+ imports.add("org.hibernate.*"); //$NON-NLS-1$
+ imports.add("org.hibernate.criterion.*"); //$NON-NLS-1$
+
return (String[]) imports.toArray( new String[imports.size()] );
}
- public void codeComplete(String prefix, CompletionProposalCollector collector, int position, IJavaProject project) throws JavaModelException {
+ public void codeComplete(String prefix, CompletionProposalCollector collector, int position, IJavaProject project) throws JavaModelException {
ITextSelection selection= (ITextSelection)getSelectionProvider().getSelection();
- String code= getSourceViewer().getDocument().get();
+ String code= getSourceViewer().getDocument().get();
code= prefix + code;
IEvaluationContext e= getEvaluationContext(project);
if (e != null) {
e.codeComplete(code, prefix.length()+position, collector);
}
}
-
+
public void showEditorInput(IEditorInput editorInput) {
-
+
CriteriaEditorInput hei = (CriteriaEditorInput)getEditorInput();
super.showEditorInput( editorInput );
IStorage storage = ((CriteriaEditorInput)editorInput).getStorage();
if (storage instanceof CriteriaEditorStorage) {
CriteriaEditorStorage sqlEditorStorage = (CriteriaEditorStorage) storage;
IDocument document = getDocumentProvider().getDocument( hei );
- document.set( sqlEditorStorage.getContentsString() );
- }
+ document.set( sqlEditorStorage.getContentsString() );
+ }
}
-
+
public void createPartControl(Composite parent) {
parent.setLayout( new GridLayout(1,false) );
-
+
createToolbar( parent );
-
+
super.createPartControl( parent );
if (getSourceViewer() != null ){
getSourceViewer().addTextListener(new ITextListener(){
@@ -197,14 +197,14 @@
updateExecButton();
}});
}
-
+
Control control = parent.getChildren()[1];
control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
-
+
}
-
+
@Override
protected String getConnectedImageFilePath() {
return "icons/images/criteria_editor_connect.gif"; //$NON-NLS-1$
- }
+ }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorActionContributor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -71,7 +71,7 @@
public void init(IActionBars bars, IWorkbenchPage page) {
super.init( bars, page );
- bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction", executeHQLAction);
+ bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction", executeHQLAction); //$NON-NLS-1$
bars.updateActionBars();
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInput.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInput.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,6 +23,7 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.ui.IMemento;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditorInput;
/**
@@ -36,9 +37,9 @@
public CriteriaEditorInput( IStorage storage ) {
super(storage);
- }
-
+ }
+
public String getFactoryId() {
return CriteriaditorInputFactory.ID_FACTORY;
}
@@ -48,6 +49,6 @@
}
public void resetName() {
- setName( "Criteria: " + (getConsoleConfigurationName()==null?"<None>":getConsoleConfigurationName()) );
+ setName( HibernateConsoleMessages.CriteriaEditorInput_criteria + (getConsoleConfigurationName()==null?HibernateConsoleMessages.CriteriaEditorInput_none:getConsoleConfigurationName()) );
}
-}
+}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInputFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInputFactory.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorInputFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -63,7 +63,7 @@
String storageName = null;
String storageContent = ""; //$NON-NLS-1$
- String configurationName = "";
+ String configurationName = ""; //$NON-NLS-1$
IStorage storage = input.getStorage();
if (storage != null) {
storageName = storage.getName();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorStorage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorStorage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaEditorStorage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -22,14 +22,15 @@
package org.hibernate.eclipse.criteriaeditor;
import org.eclipse.core.runtime.IPath;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditorStorage;
/**
* Storage for Criteria editors without a file
*/
public class CriteriaEditorStorage extends QueryEditorStorage {
-
+
public CriteriaEditorStorage( String source ) {
super(source);
}
@@ -38,9 +39,9 @@
super(configurationName, name, source );
}
-
+
public CriteriaEditorStorage(String consoleName, String string) {
- super(consoleName, "Criteria: " + (consoleName==null?"<None>":consoleName), string);
+ super(consoleName, HibernateConsoleMessages.CriteriaEditorStorage_criteria + (consoleName==null?HibernateConsoleMessages.CriteriaEditorStorage_none:consoleName), string);
}
public IPath getFullPath() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaditorInputFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaditorInputFactory.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/CriteriaditorInputFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -62,7 +62,7 @@
String storageName = null;
String storageContent = ""; //$NON-NLS-1$
- String configurationName = "";
+ String configurationName = ""; //$NON-NLS-1$
IStorage storage = input.getStorage();
if (storage != null) {
storageName = storage.getName();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/criteriaeditor/JavaCompletionProcessor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -36,6 +36,7 @@
import org.eclipse.jface.text.contentassist.IContextInformation;
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.eclipse.swt.widgets.Shell;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.hibernate.eclipse.hqleditor.CompletionHelper;
@@ -81,22 +82,22 @@
int offset) {
return null;
}
-
+
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
int position) {
try {
setErrorMessage( null );
if(editor.getConsoleConfiguration()==null) {
- setErrorMessage( "No console configuration found" );
+ setErrorMessage( HibernateConsoleMessages.JavaCompletionProcessor_no_console_configuration_found );
return new ICompletionProposal[0];
}
- String prefix = "Session session;"; // has to do this because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
-
+ String prefix = HibernateConsoleMessages.JavaCompletionProcessor_session_session; // has to do this because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=141518
+
try {
IJavaProject javaProject = ProjectUtils.findJavaProject( editor.getConsoleConfiguration() );
collector = new CompletionProposalCollector( javaProject );
collector.acceptContext( new CompletionContext() );
-
+
editor.codeComplete( prefix, collector, position, javaProject );
}
catch (JavaModelException x) {
@@ -104,7 +105,7 @@
ErrorDialog
.openError(
shell,
- "Error", "Error while performing code completion", x.getStatus() );
+ HibernateConsoleMessages.JavaCompletionProcessor_error, HibernateConsoleMessages.JavaCompletionProcessor_error_while_performing_code_completion, x.getStatus() );
HibernateConsolePlugin.getDefault().log( x );
}
@@ -118,9 +119,9 @@
finally {
if(collector!=null) {
setErrorMessage( collector.getErrorMessage() );
- collector = null;
+ collector = null;
}
- }
+ }
}
public char[] getCompletionProposalAutoActivationCharacters() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/HibernateConfigurationPartFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,6 +23,7 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.graph.model.AssociationViewAdapter;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
import org.hibernate.eclipse.graph.model.PersistentClassViewAdapter;
@@ -48,8 +49,8 @@
} else if ( model instanceof TableViewAdapter ) {
return new TableEditPart( (TableViewAdapter) model);
}
-
- throw new IllegalArgumentException(model.getClass() + " not known by factory");
+
+ throw new IllegalArgumentException(model.getClass() + HibernateConsoleMessages.HibernateConfigurationPartFactory_not_known_by_factory);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/actions/ToggleLayoutAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/actions/ToggleLayoutAction.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/actions/ToggleLayoutAction.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -25,6 +25,7 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.graph.AbstractGraphViewPart;
@@ -32,11 +33,11 @@
public class ToggleLayoutAction extends Action {
final AbstractGraphViewPart view;
- final private String pluginKey;
+ final private String pluginKey;
public ToggleLayoutAction(AbstractGraphViewPart view, String pluginKey)
{
- super("Automatic Layout", IAction.AS_CHECK_BOX);
+ super(HibernateConsoleMessages.ToggleLayoutAction_auto_layout, IAction.AS_CHECK_BOX);
this.view = view;
this.pluginKey = pluginKey;
setImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.LAYOUT));
@@ -54,13 +55,13 @@
private void valueChanged(boolean value, boolean doStore) {
setChecked(!value);
view.setManualLayout(value);
-
+
setToolTipText(value ?
- "Manual layout active" :
- "Automatic layout active");
+ HibernateConsoleMessages.ToggleLayoutAction_manual_layout_active :
+ HibernateConsoleMessages.ToggleLayoutAction_auto_layout_active);
setDescription(value ?
- "Enable automatic layout" :
- "Enable manual layout");
+ HibernateConsoleMessages.ToggleLayoutAction_enable_auto_layout :
+ HibernateConsoleMessages.ToggleLayoutAction_enable_manual_layout);
if (doStore) {
Preferences prefs = HibernateConsolePlugin.getDefault().getPluginPreferences();
prefs.setValue(pluginKey, value);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/NodeHeaderFigure.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/NodeHeaderFigure.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/NodeHeaderFigure.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -55,8 +55,8 @@
// Based on what was found in JBPM GPD 19/4/2006 04:34 AM
public class NodeHeaderFigure extends Figure {
- private static final Font NAMEFONT = new Font(null, "Arial", 9, SWT.BOLD);
- private static final Font TYPEFONT = new Font(null, "Arial", 9, SWT.ITALIC);
+ private static final Font NAMEFONT = new Font(null, "Arial", 9, SWT.BOLD); //$NON-NLS-1$
+ private static final Font TYPEFONT = new Font(null, "Arial", 9, SWT.ITALIC); //$NON-NLS-1$
private Figure embeddedFigure;
private Figure typeAndLabelColumn;
@@ -110,7 +110,7 @@
typeLabel.setBorder(new MarginBorder(2));
typeLabel.setForegroundColor(ColorConstants.darkGray);
typeLabel.setFont(TYPEFONT);
- typeLabel.setText("<<" + nodeType + ">>");
+ typeLabel.setText("<<" + nodeType + ">>"); //$NON-NLS-1$ //$NON-NLS-2$
typeAndLabelColumn.add(typeLabel);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/PersistentClassFigure.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/PersistentClassFigure.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/PersistentClassFigure.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -36,14 +36,14 @@
//public static Color classColor = new Color(null, 188, 174, 121); // hibernate brown
//public static Color classColor = new Color(null, 179, 202, 227); // opera tab blue
public static Color classColor = new Color(null, 212, 229, 254); // skype says
- static Font classHeaderFont = new Font(null, "Arial", 12, SWT.BOLD);
+ static Font classHeaderFont = new Font(null, "Arial", 12, SWT.BOLD); //$NON-NLS-1$
private PropertiesFigure propertiesFigure;
private NodeHeaderFigure header;
public PersistentClassFigure(String name) {
- header = new NodeHeaderFigure(name, "Class", ImageConstants.MAPPEDCLASS, false);
+ header = new NodeHeaderFigure(name, "Class", ImageConstants.MAPPEDCLASS, false); //$NON-NLS-1$
ToolbarLayout layout = new ToolbarLayout();
layout.setVertical(true);
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/TableFigure.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/TableFigure.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/figures/TableFigure.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -33,7 +33,7 @@
public class TableFigure extends Figure {
public static Color tableColor = new Color(null, 0xff, 0xff, 0xaa);
- static Font tableHeaderFont = new Font(null, "Arial", 12, SWT.BOLD);
+ static Font tableHeaderFont = new Font(null, "Arial", 12, SWT.BOLD); //$NON-NLS-1$
private Label label;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/AssociationViewAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/AssociationViewAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/AssociationViewAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,11 +24,13 @@
import org.eclipse.draw2d.ConnectionRouter;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public abstract class AssociationViewAdapter {
-
+
public abstract String getSourceName();
-
+
public abstract String getTargetName();
public RotatableDecoration getTargetDecoration() {
@@ -40,7 +42,8 @@
}
public String toString() {
- return "Association target: " + getSourceName() + " source: " + getTargetName();
+ String out = NLS.bind(HibernateConsoleMessages.AssociationViewAdapter_association_target_source, getTargetName(), getSourceName());
+ return out;
}
public String getAssociationName() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/GraphNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/GraphNode.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/GraphNode.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -35,7 +35,7 @@
*/
public abstract class GraphNode extends Observable {
- public static final String ASSOCIATONS = "ASSOCIATIONS";
+ public static final String ASSOCIATONS = "ASSOCIATIONS"; //$NON-NLS-1$
private Rectangle bounds = new Rectangle( 0, 0, -1, -1 );
protected List targetAssociations;
protected List sourceAssociations;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/InheritanceViewAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/InheritanceViewAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/InheritanceViewAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -27,6 +27,7 @@
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.RotatableDecoration;
import org.eclipse.draw2d.geometry.PointList;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class InheritanceViewAdapter extends AssociationViewAdapter {
@@ -34,13 +35,13 @@
private final PersistentClassViewAdapter superclass;
public InheritanceViewAdapter(PersistentClassViewAdapter subclass, PersistentClassViewAdapter superclass) {
- if(subclass==superclass) throw new IllegalArgumentException("subclass must not be equal to superclass");
- if(subclass==null) throw new IllegalArgumentException("subclass must not null");
- if(superclass==null) throw new IllegalArgumentException("superclass must not null");
+ if(subclass==superclass) throw new IllegalArgumentException(HibernateConsoleMessages.InheritanceViewAdapter_subclass_must_not_be_equal_to_superclass);
+ if(subclass==null) throw new IllegalArgumentException(HibernateConsoleMessages.InheritanceViewAdapter_subclass_must_not_null);
+ if(superclass==null) throw new IllegalArgumentException(HibernateConsoleMessages.InheritanceViewAdapter_superclass_must_not_null);
this.subclass = subclass;
this.superclass = superclass;
}
-
+
public RotatableDecoration getTargetDecoration() {
PolygonDecoration decoration = new PolygonDecoration();
PointList decorationPointList = new PointList();
@@ -56,9 +57,9 @@
public ConnectionRouter getConnectionRouter() {
return new ManhattanConnectionRouter();
}
-
+
public String toString() {
- return "Inheritance " + super.toString();
+ return HibernateConsoleMessages.InheritanceViewAdapter_inheritance + super.toString();
}
public String getSourceName() {
@@ -68,5 +69,5 @@
public String getTargetName() {
return superclass.getPersistentClass().getEntityName();
}
-
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PersistentClassViewAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -58,7 +58,7 @@
}
public String toString() {
- return "PersistentClassAdapter: " + persistentClass;
+ return "PersistentClassAdapter: " + persistentClass; //$NON-NLS-1$
}
public void createAssociations() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/model/PropertyAssociationViewAdapter.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -44,7 +44,7 @@
}
public String toString() {
- return "Property " + property.getProperty().getName() + " " + super.toString();
+ return "Property " + property.getProperty().getName() + " " + super.toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
public String getAssociationName() {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/CompletionHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/CompletionHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/CompletionHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -35,19 +35,20 @@
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.hqleditor.HibernateResultCollector.Settings;
public class CompletionHelper {
static public ICompletionProposal[] completeOnJavaTypes(IJavaProject javaProject, Settings settings, String packageName, String start, int offset) {
-
+
if (javaProject != null) {
- IEvaluationContext context = javaProject.newEvaluationContext();
+ IEvaluationContext context = javaProject.newEvaluationContext();
if(packageName!=null) {
context.setPackageName(packageName);
}
-
+
HibernateResultCollector rc = new HibernateResultCollector(javaProject);
rc.acceptContext(new CompletionContext());
//rc.reset(offset, javaProject, null);
@@ -58,7 +59,7 @@
// the smallest snippet possible
context.codeComplete(start, start.length(), rc);
} catch (JavaModelException jme) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not complete java types", jme);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.CompletionHelper_could_not_complete_java_types, jme);
}
IJavaCompletionProposal[] results = rc.getJavaCompletionProposals();
transpose(start, offset, results);
@@ -66,7 +67,7 @@
}
return new ICompletionProposal[0];
}
-
+
static public void transpose(String start, int offset, IJavaCompletionProposal[] results) {
// As all completions have made with the assumption on a empty
// (or almost empty) string
@@ -74,18 +75,18 @@
// into our non-java code
for (int i = 0; i < results.length; i++) {
if(results[i] instanceof AbstractJavaCompletionProposal) {
- AbstractJavaCompletionProposal proposal = (AbstractJavaCompletionProposal) results[i]; // TODO: eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=84998
+ AbstractJavaCompletionProposal proposal = (AbstractJavaCompletionProposal) results[i]; // TODO: eclipse bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=84998
transpose(offset, proposal);
} else {
- HibernateConsolePlugin.getDefault().log("ERROR: unknown CompletionProposal class.");
+ HibernateConsolePlugin.getDefault().log(HibernateConsoleMessages.CompletionHelper_error_unknown_completion_proposal_class);
}
}
- Arrays.sort(results, new CompletionProposalComparator() );
+ Arrays.sort(results, new CompletionProposalComparator() );
}
private static void transpose(int offset, AbstractJavaCompletionProposal proposal) {
int wanted = proposal.getReplacementOffset() + (offset /*- start.length()*/);
- if(wanted==proposal.getReplacementOffset() ) {
+ if(wanted==proposal.getReplacementOffset() ) {
//System.out.println("NO TRANSPOSE!");
}
if(wanted<0) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/EclipseHQLCompletionRequestor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -69,28 +69,28 @@
case HQLCompletionProposal.ENTITY_NAME:
if(proposal.getEntityName()!=null &&
!(proposal.getSimpleName().equals( proposal.getEntityName()))) {
- buf.append(" - ");
+ buf.append(" - "); //$NON-NLS-1$
buf.append(StringHelper.qualifier( proposal.getEntityName() ));
} else if(proposal.getShortEntityName()!=null &&
!(proposal.getSimpleName().equals( proposal.getEntityName()))) {
- buf.append( " - " + proposal.getShortEntityName() );
+ buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
}
break;
case HQLCompletionProposal.ALIAS_REF:
if(proposal.getShortEntityName()!=null) {
- buf.append( " - " + proposal.getShortEntityName() );
+ buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
} else if(proposal.getEntityName()!=null) {
- buf.append( " - " + proposal.getEntityName() );
+ buf.append( " - " + proposal.getEntityName() ); //$NON-NLS-1$
}
break;
case HQLCompletionProposal.PROPERTY:
if(proposal.getShortEntityName()!=null) {
- buf.append( " - " + proposal.getShortEntityName() );
+ buf.append( " - " + proposal.getShortEntityName() ); //$NON-NLS-1$
} else if(proposal.getEntityName()!=null) {
- if(proposal.getEntityName().indexOf( "." )>=0) {
- buf.append( " - " + StringHelper.unqualify( proposal.getEntityName() ));
+ if(proposal.getEntityName().indexOf( "." )>=0) { //$NON-NLS-1$
+ buf.append( " - " + StringHelper.unqualify( proposal.getEntityName() )); //$NON-NLS-1$
} else {
- buf.append( " - " + proposal.getEntityName() );
+ buf.append( " - " + proposal.getEntityName() ); //$NON-NLS-1$
}
}
break;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCodeScanner.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCodeScanner.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCodeScanner.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -81,8 +81,8 @@
"update", //$NON-NLS-1$
"versioned", //$NON-NLS-1$
"where", //$NON-NLS-1$
- "and",
- "or",
+ "and", //$NON-NLS-1$
+ "or", //$NON-NLS-1$
// -- SQL tokens --
// These aren't part of HQL, but usefull when you have SQL in the editor
@@ -108,102 +108,102 @@
/** built-in function names. Various normal builtin functions in SQL/HQL. Maybe sShould try and do this dynamically based on dialect */
private static String[] builtInFunctions = {
// standard sql92 functions
- "substring",
- "locate",
- "trim",
- "length",
- "bit_length",
- "coalesce",
- "nullif",
- "abs",
- "mod",
- "sqrt",
- "upper",
- "lower",
- "cast",
- "extract",
+ "substring", //$NON-NLS-1$
+ "locate", //$NON-NLS-1$
+ "trim", //$NON-NLS-1$
+ "length", //$NON-NLS-1$
+ "bit_length", //$NON-NLS-1$
+ "coalesce", //$NON-NLS-1$
+ "nullif", //$NON-NLS-1$
+ "abs", //$NON-NLS-1$
+ "mod", //$NON-NLS-1$
+ "sqrt", //$NON-NLS-1$
+ "upper", //$NON-NLS-1$
+ "lower", //$NON-NLS-1$
+ "cast", //$NON-NLS-1$
+ "extract", //$NON-NLS-1$
// time functions mapped to ansi extract
- "second",
- "minute",
- "hour",
- "day",
- "month",
- "year",
+ "second", //$NON-NLS-1$
+ "minute", //$NON-NLS-1$
+ "hour", //$NON-NLS-1$
+ "day", //$NON-NLS-1$
+ "month", //$NON-NLS-1$
+ "year", //$NON-NLS-1$
- "str",
+ "str", //$NON-NLS-1$
// misc functions - based on oracle dialect
- "sign",
- "acos",
- "asin",
- "atan",
- "cos",
- "cosh",
- "exp",
- "ln",
- "sin",
- "sinh",
- "stddev",
- "sqrt",
- "tan",
- "tanh",
- "variance",
+ "sign", //$NON-NLS-1$
+ "acos", //$NON-NLS-1$
+ "asin", //$NON-NLS-1$
+ "atan", //$NON-NLS-1$
+ "cos", //$NON-NLS-1$
+ "cosh", //$NON-NLS-1$
+ "exp", //$NON-NLS-1$
+ "ln", //$NON-NLS-1$
+ "sin", //$NON-NLS-1$
+ "sinh", //$NON-NLS-1$
+ "stddev", //$NON-NLS-1$
+ "sqrt", //$NON-NLS-1$
+ "tan", //$NON-NLS-1$
+ "tanh", //$NON-NLS-1$
+ "variance", //$NON-NLS-1$
- "round",
- "trunc",
- "ceil",
- "floor",
+ "round", //$NON-NLS-1$
+ "trunc", //$NON-NLS-1$
+ "ceil", //$NON-NLS-1$
+ "floor", //$NON-NLS-1$
- "chr",
- "initcap",
- "lower",
- "ltrim",
- "rtrim",
- "soundex",
- "upper",
- "ascii",
- "length",
- "to_char",
- "to_date",
+ "chr", //$NON-NLS-1$
+ "initcap", //$NON-NLS-1$
+ "lower", //$NON-NLS-1$
+ "ltrim", //$NON-NLS-1$
+ "rtrim", //$NON-NLS-1$
+ "soundex", //$NON-NLS-1$
+ "upper", //$NON-NLS-1$
+ "ascii", //$NON-NLS-1$
+ "length", //$NON-NLS-1$
+ "to_char", //$NON-NLS-1$
+ "to_date", //$NON-NLS-1$
- "current_date",
- "current_time",
- "current_timestamp",
- "lastday",
- "sysday",
- "systimestamp",
- "uid",
- "user",
+ "current_date", //$NON-NLS-1$
+ "current_time", //$NON-NLS-1$
+ "current_timestamp", //$NON-NLS-1$
+ "lastday", //$NON-NLS-1$
+ "sysday", //$NON-NLS-1$
+ "systimestamp", //$NON-NLS-1$
+ "uid", //$NON-NLS-1$
+ "user", //$NON-NLS-1$
- "rowid",
- "rownum",
+ "rowid", //$NON-NLS-1$
+ "rownum", //$NON-NLS-1$
- "concat",
- "instr",
- "instrb",
- "lpad",
- "replace",
- "rpad",
- "substr",
- "substrb",
- "translate",
+ "concat", //$NON-NLS-1$
+ "instr", //$NON-NLS-1$
+ "instrb", //$NON-NLS-1$
+ "lpad", //$NON-NLS-1$
+ "replace", //$NON-NLS-1$
+ "rpad", //$NON-NLS-1$
+ "substr", //$NON-NLS-1$
+ "substrb", //$NON-NLS-1$
+ "translate", //$NON-NLS-1$
- "substring",
- "locate",
- "bit_length",
- "coalesce",
+ "substring", //$NON-NLS-1$
+ "locate", //$NON-NLS-1$
+ "bit_length", //$NON-NLS-1$
+ "coalesce", //$NON-NLS-1$
- "atan2",
- "log",
- "mod",
- "nvl",
- "nvl2",
- "power",
+ "atan2", //$NON-NLS-1$
+ "log", //$NON-NLS-1$
+ "mod", //$NON-NLS-1$
+ "nvl", //$NON-NLS-1$
+ "nvl2", //$NON-NLS-1$
+ "power", //$NON-NLS-1$
- "add_months",
- "months_between",
- "next_day",
+ "add_months", //$NON-NLS-1$
+ "months_between", //$NON-NLS-1$
+ "next_day", //$NON-NLS-1$
};
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLCompletionProcessor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -36,6 +36,7 @@
import org.eclipse.jface.text.contentassist.IContextInformationValidator;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.tool.ide.completion.HQLCodeAssist;
@@ -61,7 +62,7 @@
public ICompletionProposal[] computeCompletionProposals( ITextViewer viewer, int documentOffset ) {
ICompletionProposal[] result = new ICompletionProposal[0];
-
+
try {
IDocument doc = viewer.getDocument();
ITypedRegion partition = null;
@@ -78,14 +79,14 @@
}
}
catch (BadLocationException x) {
- }
+ }
catch (RuntimeException re) {
- HibernateConsolePlugin.getDefault().logErrorMessage( "Error while performing HQL completion", re );
+ HibernateConsolePlugin.getDefault().logErrorMessage( HibernateConsoleMessages.HQLCompletionProcessor_error_while_performing_hql_completion, re );
}
-
+
if (result != null)
- result = sort( result );
-
+ result = sort( result );
+
return result;
}
@@ -93,48 +94,48 @@
ICompletionProposal[] result = null;
errorMessage = null;
if (doc != null && currentOffset >= 0) {
-
+
List proposalList = new ArrayList();
String startWord = null;
-
+
int startOffset = findNearestWhiteSpace( doc, currentOffset, lineStart );
-
+
int wordLength = currentOffset - startOffset;
- startWord = getWord( doc, startOffset, wordLength );
-
+ startWord = getWord( doc, startOffset, wordLength );
+
if(startWord!=null) {
try {
doc.get(0,doc.getLength()).toCharArray();
}
catch (BadLocationException e) {
- errorMessage = "Could not get document contents";
+ errorMessage = HibernateConsoleMessages.HQLCompletionProcessor_could_not_get_document_contents;
return result;
}
-
+
Configuration configuration = consoleConfiguration!=null?consoleConfiguration.getConfiguration():null;
IHQLCodeAssist hqlEval = new HQLCodeAssist(configuration);
EclipseHQLCompletionRequestor eclipseHQLCompletionCollector = new EclipseHQLCompletionRequestor();
hqlEval.codeComplete(doc.get(), currentOffset, eclipseHQLCompletionCollector);
proposalList.addAll(eclipseHQLCompletionCollector.getCompletionProposals());
errorMessage = eclipseHQLCompletionCollector.getLastErrorMessage();
-
+
if(configuration == null && consoleConfiguration!=null) {
- proposalList.add(new LoadConsoleCFGCompletionProposal(consoleConfiguration));
+ proposalList.add(new LoadConsoleCFGCompletionProposal(consoleConfiguration));
}
-
+
//findMatchingWords( currentOffset, proposalList, startWord, HQLCodeScanner.getHQLKeywords(), "keyword" );
//findMatchingWords( currentOffset, proposalList, startWord, HQLCodeScanner.getHQLFunctionNames(), "function");
-
+
result = (ICompletionProposal[]) proposalList.toArray(new ICompletionProposal[proposalList.size()]);
if(result.length==0 && errorMessage==null) {
- errorMessage = "No HQL completions available.";
+ errorMessage = HibernateConsoleMessages.HQLCompletionProcessor_no_hql_completions_available;
}
-
+
} else {
- errorMessage = "No start word found.";
+ errorMessage = HibernateConsoleMessages.HQLCompletionProcessor_no_start_word_found;
}
}
-
+
return result;
}
@@ -147,7 +148,7 @@
}
}
-
+
public IContextInformation[] computeContextInformation( ITextViewer viewer, int documentOffset ) { return null; }
public char[] getCompletionProposalAutoActivationCharacters() { return autoActivationChars; }
@@ -156,8 +157,8 @@
public IContextInformationValidator getContextInformationValidator() { return validator; }
- public String getErrorMessage() {
- return errorMessage;
+ public String getErrorMessage() {
+ return errorMessage;
}
private ICompletionProposal[] sort( ICompletionProposal[] proposals ) {
@@ -167,7 +168,7 @@
public int findNearestWhiteSpace( IDocument doc, int documentOffset, int offset ) {
boolean loop = true;
-
+
int tmpOffset = documentOffset - 1;
try {
while (loop && offset <= tmpOffset) {
@@ -176,14 +177,14 @@
loop = false;
} else {
tmpOffset--;
- }
- }
+ }
+ }
}
catch (BadLocationException x) {
}
-
+
offset = tmpOffset + 1;
-
+
return offset;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -54,7 +54,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.AbstractQueryEditor;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.Messages;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.views.IQueryParametersPage;
import org.hibernate.eclipse.console.views.QueryParametersPage;
@@ -63,126 +63,126 @@
* HQL Editor
*/
public class HQLEditor extends AbstractQueryEditor {
-
+
public static final String PLUGIN_NAME = HibernateConsolePlugin.ID;
public static final String HELP_CONTEXT_ID = PLUGIN_NAME + ".hqleditorhelp"; //$NON-NLS-1$
-
+
/** The HQL code scanner, which is used for colorizing the edit text. */
private HQLCodeScanner fHQLCodeScanner;
/** The document setup participant object, which is used partition the edit text. */
private HQLEditorDocumentSetupParticipant docSetupParticipant;
/** The projection (code folding) support object. */
private ProjectionSupport fProjectionSupport;
-
-
-
+
+
+
/**
* Constructs an instance of this class. This is the default constructor.
*/
public HQLEditor() {
super();
}
-
+
/**
* Creates and installs the editor actions.
- *
+ *
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
*/
protected void createActions() {
super.createActions();
ResourceBundle bundle = getResourceBundle();
-
+
IAction a = new TextOperationAction( bundle,
"ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS ); //$NON-NLS-1$
a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS );
setAction( "ContentAssistProposal", a ); //$NON-NLS-1$
-
+
a = new TextOperationAction( bundle, "ContentAssistTip.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION ); //$NON-NLS-1$
a.setActionDefinitionId( ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION );
setAction( "ContentAssistTip", a ); //$NON-NLS-1$
-
+
a = new TextOperationAction( bundle, "ContentFormat.", this, ISourceViewer.FORMAT ); //$NON-NLS-1$
setAction( "ContentFormat", a ); //$NON-NLS-1$
-
+
/*a = new HQLConnectAction( bundle, "HQLEditor.connectAction." ); //$NON-NLS-1$
setAction( "HQLEditor.connectAction", a ); //$NON-NLS-1$
*/
-
+
/*a = new HQLDisconnectAction( bundle, "HQLEditor.disconnectAction." ); //$NON-NLS-1$
setAction( "HQLEditor.disconnectAction", a ); //$NON-NLS-1$
*/
-
+
// a = new ExecuteQueryAction( this ); //$NON-NLS-1$
// setAction( "HQLEditor.runAction", a ); //$NON-NLS-1$
-
+
/*a = new HQLSetStatementTerminatorAction( bundle, "HQLEditor.setStatementTerminatorAction." ); //$NON-NLS-1$
setAction( "HQLEditor.setStatementTerminatorAction", a ); //$NON-NLS-1$
*/
}
-
+
private ResourceBundle getResourceBundle() {
- return ResourceBundle.getBundle( Messages.BUNDLE_NAME );
+ return ResourceBundle.getBundle( HibernateConsoleMessages.BUNDLE_NAME );
}
-
+
/**
* Creates the SWT controls for the editor.
- *
+ *
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
*/
public void createPartControl( Composite parent ) {
parent.setLayout( new GridLayout(1,false) );
-
+
createToolbar(parent);
-
+
super.createPartControl( parent );
-
+
if (getSourceViewer() != null ){
getSourceViewer().addTextListener(new ITextListener(){
-
+
public void textChanged(TextEvent event) {
updateExecButton();
}});
}
-
+
// move to base class?
Control control = parent.getChildren()[1];
control.setLayoutData( new GridData( GridData.FILL_BOTH ) );
-
+
setProjectionSupport( createProjectionSupport() );
-
+
/* Now that we have enabled source folding, make sure everything is
* expanded.
*/
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
viewer.doOperation( ProjectionViewer.TOGGLE );
-
+
/* Set a help context ID to enable F1 help. */
getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( parent, HELP_CONTEXT_ID );
-
- // the following is needed to make sure the editor area gets focus when editing after query execution
+
+ // the following is needed to make sure the editor area gets focus when editing after query execution
// TODO: find a better way since this is triggered on evey mouse click and key stroke in the editor area
StyledText textWidget = getSourceViewer().getTextWidget();
textWidget.addKeyListener(new KeyAdapter() {
-
+
public void keyPressed(KeyEvent e) {
getSite().getPage().activate(HQLEditor.this);
}
-
+
});
textWidget.addMouseListener(new MouseAdapter() {
-
+
public void mouseDown(MouseEvent e) {
getSite().getPage().activate(HQLEditor.this);
}
-
+
});
}
-
+
/**
* Creates, configures, and returns a <code>ProjectionSupport</code>
* object for this editor.
- *
+ *
* @return the <code>ProjectSupport</code> object to use with this editor
*/
protected ProjectionSupport createProjectionSupport() {
@@ -191,43 +191,43 @@
projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.error" ); //$NON-NLS-1$
projSupport.addSummarizableAnnotationType( "org.eclipse.ui.workbench.texteditor.warning" ); //$NON-NLS-1$
projSupport.install();
-
+
return projSupport;
}
-
+
/**
* Creates the source viewer to be used by this editor.
- *
+ *
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite,
* org.eclipse.jface.text.source.IVerticalRuler, int)
*/
protected ISourceViewer createSourceViewer( Composite parent, IVerticalRuler ruler, int styles ) {
HQLSourceViewer viewer = new HQLSourceViewer( parent, ruler, getOverviewRuler(), isOverviewRulerVisible(),
styles );
-
+
return viewer;
}
-
+
/**
* Creates the source viewer configuation to be used by this editor.
- *
+ *
* @return the new source viewer configuration object
*/
protected HQLSourceViewerConfiguration createSourceViewerConfiguration() {
HQLSourceViewerConfiguration config = new HQLSourceViewerConfiguration( this );
-
+
return config;
}
-
+
/**
* Sets the input of the outline page after this class has set input.
- *
+ *
* @param input the new input for the editor
* @see org.eclipse.ui.editors.text.TextEditor#doSetInput(org.eclipse.ui.IEditorInput)
*/
public void doSetInput( IEditorInput input ) throws CoreException {
super.doSetInput( input );
-
+
/* Make sure the document partitioner is set up. The document setup
* participant sets up document partitioning, which is used for text
* colorizing and other text features.
@@ -240,22 +240,22 @@
docSetupParticipant.setup( doc );
}
}
-
+
}
-
+
/**
* Sets up this editor's context menu before it is made visible.
- *
+ *
* @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/
protected void editorContextMenuAboutToShow( IMenuManager menu ) {
super.editorContextMenuAboutToShow( menu );
-
+
menu.add( new Separator() );
addAction( menu, "ContentAssistProposal" ); //$NON-NLS-1$
addAction( menu, "ContentAssistTip" ); //$NON-NLS-1$
addAction( menu, "ContentFormat" ); //$NON-NLS-1$
-
+
menu.add( new Separator() );
/*if (getConnectionInfo() == null) {
addAction( menu, "HQLEditor.connectAction" ); //$NON-NLS-1$
@@ -266,19 +266,19 @@
addAction( menu, "HQLEditor.runAction" ); //$NON-NLS-1$
//addAction( menu, "HQLEditor.setStatementTerminatorAction" ); //$NON-NLS-1$
}
-
+
/**
* Gets an adapter for the given class. Returns the HQL content outline page
* if the get request is for an outline page. Otherwise returns a projection
* adapter if one hasn't already been created.
- *
+ *
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
* @see org.eclipse.jface.text.source.projection.ProjectionSupport#getAdapter(org.eclipse.jface.text.source.ISourceViewer,
* java.lang.Class)
*/
public Object getAdapter( Class classForWhichAdapterNeeded ) {
Object adapter = null;
-
+
if(IQueryParametersPage.class.equals( classForWhichAdapterNeeded )) {
return new QueryParametersPage(this);
}
@@ -305,19 +305,19 @@
adapter = projSupport.getAdapter( getSourceViewer(), classForWhichAdapterNeeded );
}
}
-
+
/* If we still don't have an adapter let the superclass handle it. */
if (adapter == null) {
adapter = super.getAdapter( classForWhichAdapterNeeded );
}
-
+
return adapter;
}
-
+
/**
* Gets the document setup participant object associated with this editor.
* The setup participant sets the partitioning type for the document.
- *
+ *
* @return the current document setup participant
*/
public HQLEditorDocumentSetupParticipant getDocumentSetupParticipant() {
@@ -326,23 +326,23 @@
}
return docSetupParticipant;
}
-
-
+
+
/**
* Gets the <code>ProjectionSupport</code> object associated with this
* editor.
- *
+ *
* @return the current <code>ProjectionSupport</code> object
*/
protected ProjectionSupport getProjectionSupport() {
return fProjectionSupport;
}
-
-
+
+
/**
* Gets the HQL source code text scanner. Creates a default one if it
* doesn't exist yet.
- *
+ *
* @return the HQL source code text scanner
*/
public HQLCodeScanner getHQLCodeScanner() {
@@ -351,20 +351,20 @@
}
return fHQLCodeScanner;
}
-
-
+
+
/**
* Gets the color provider for colorizing HQL source code.
- *
+ *
* @return the HQL color provider
*/
public HQLColors getHQLColorProvider() {
return new HQLColors();
}
-
+
/**
* Initializes the editor.
- *
+ *
* @see org.eclipse.ui.editors.text.TextEditor#initializeEditor()
*/
protected void initializeEditor() {
@@ -372,43 +372,43 @@
setSourceViewerConfiguration( createSourceViewerConfiguration() );
setRangeIndicator( new DefaultRangeIndicator() );
}
-
-
+
+
/**
* Sets the document setup participant object associated with this editor to
* the given object. The setup participant sets the partitioning type for
* the document.
- *
+ *
* @return the current document setup participant
*/
public void setDocumentSetupParticipant( HQLEditorDocumentSetupParticipant docSetupParticipant ) {
this.docSetupParticipant = docSetupParticipant;
}
-
+
/**
* Sets the <code>ProjectionSupport</code> object associated with this
* editor.
- *
+ *
* @param projSupport the <code>ProjectionSupport</code> object to use
*/
protected void setProjectionSupport( ProjectionSupport projSupport ) {
fProjectionSupport = projSupport;
}
-
-
+
+
public ITextViewer getTextViewer() {
return getSourceViewer();
}
-
-
-
+
+
+
public void executeQuery(ConsoleConfiguration cfg) {
- cfg.executeHQLQuery(getQueryString(), getQueryInputModel().getCopyForQuery() );
+ cfg.executeHQLQuery(getQueryString(), getQueryInputModel().getCopyForQuery() );
}
@Override
protected String getConnectedImageFilePath() {
return "icons/images/hql_editor_connect.gif"; //$NON-NLS-1$
- }
-
-}
+ }
+
+}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorActionContributor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorActionContributor.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorActionContributor.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -34,41 +34,41 @@
import org.eclipse.ui.part.EditorActionBarContributor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.hibernate.eclipse.console.Messages;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.actions.ExecuteQueryAction;
/**
- * This class installs and manages actions for the HQL Editor.
+ * This class installs and manages actions for the HQL Editor.
*/
public class HQLEditorActionContributor extends TextEditorActionContributor {
protected RetargetTextEditorAction contentAssistProposalAction;
protected RetargetTextEditorAction contentAssistTipAction;
protected RetargetTextEditorAction contentFormatAction;
-
+
private ExecuteQueryAction executeHQLAction;
-
+
/**
* Constructs an instance of this class. This is the default constructor.
*/
public HQLEditorActionContributor() {
super();
- ResourceBundle bundle = ResourceBundle.getBundle(Messages.BUNDLE_NAME);
+ ResourceBundle bundle = ResourceBundle.getBundle(HibernateConsoleMessages.BUNDLE_NAME);
- contentAssistProposalAction = new RetargetTextEditorAction( bundle, "ContentAssistProposal." ); // $NON-NLS-1$
- contentAssistTipAction = new RetargetTextEditorAction( bundle, "ContentAssistTip." ); // $NON-NLS-1$
- contentFormatAction = new RetargetTextEditorAction( bundle, "ContentFormat." ); // $NON-NLS-1$
+ contentAssistProposalAction = new RetargetTextEditorAction( bundle, "ContentAssistProposal." );//$NON-NLS-1$
+ contentAssistTipAction = new RetargetTextEditorAction( bundle, "ContentAssistTip." ); //$NON-NLS-1$
+ contentFormatAction = new RetargetTextEditorAction( bundle, "ContentFormat." ); //$NON-NLS-1$
executeHQLAction = new ExecuteQueryAction();
-
+
}
/**
* Contributes items to the Workbench Edit menu.
- *
+ *
* @param mm the MenuManager to use
*/
public void contributeToMenu( IMenuManager mm ) {
@@ -85,11 +85,11 @@
hqlMenu.add( fContentAssistTipAction );
}*/
}
-
+
/**
* Sets the active editor to this contributor.
* This updates the actions to reflect the current editor.
- *
+ *
* @see org.eclipse.ui.part.EditorActionBarContributor#setActiveEditor(org.eclipse.ui.IEditorPart)
* @see EditorActionBarContributor#editorChanged
*/
@@ -100,34 +100,34 @@
if (targetEditor instanceof ITextEditor) {
textEditor = (ITextEditor) targetEditor;
}
-
+
// Set up the standard text editor actions. These actions each have an
// "retargetable action" associated with them. The action needs to be
// "retargeted" to associate it with the active editor whenever the active
// editor changes.
- contentAssistProposalAction.setAction( getAction( textEditor, "ContentAssistProposal" )); // $NON-NLS-1$
- contentAssistTipAction.setAction( getAction( textEditor, "ContentAssistTip" )); // $NON-NLS-1$
- contentFormatAction.setAction( getAction( textEditor, "ContentFormat" )); // $NON-NLS-1$
-
+ contentAssistProposalAction.setAction( getAction( textEditor, "ContentAssistProposal" )); //$NON-NLS-1$
+ contentAssistTipAction.setAction( getAction( textEditor, "ContentAssistTip" )); //$NON-NLS-1$
+ contentFormatAction.setAction( getAction( textEditor, "ContentFormat" )); //$NON-NLS-1$
+
if(targetEditor instanceof QueryEditor) {
executeHQLAction.setHibernateQueryEditor( (QueryEditor) targetEditor);
- }
+ }
}
-
+
public void contributeToToolBar(IToolBarManager toolBarManager) {
-
+
super.contributeToToolBar( toolBarManager );
-
-
+
+
}
-
+
public void init(IActionBars bars, IWorkbenchPage page) {
super.init( bars, page );
-
+
// bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ClearHQLEditorAction", fClearHQLEditorAction);
- bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction", executeHQLAction);
+ bars.setGlobalActionHandler("org.hibernate.eclipse.console.actions.ExecuteQueryAction", executeHQLAction); //$NON-NLS-1$
bars.updateActionBars();
}
-
-
-}
\ No newline at end of file
+
+
+}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInput.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInput.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -23,6 +23,7 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.ui.IMemento;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditorInput;
/**
@@ -33,11 +34,11 @@
public HQLEditorInput( String storageSource ) {
super( new HQLEditorStorage( storageSource ) );
}
-
+
public HQLEditorInput( IStorage storage ) {
- super(storage);
+ super(storage);
}
-
+
public String getFactoryId() {
return HQLEditorInputFactory.ID_FACTORY;
}
@@ -47,6 +48,6 @@
}
public void resetName() {
- setName( "HQL: " + getConsoleConfigurationName()==null?"<None>":getConsoleConfigurationName() );
+ setName( "HQL: " + getConsoleConfigurationName()==null?HibernateConsoleMessages.HQLEditorInput_none:getConsoleConfigurationName() ); //$NON-NLS-1$
}
-}
+}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInputFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInputFactory.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorInputFactory.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -62,7 +62,7 @@
String storageName = null;
String storageContent = ""; //$NON-NLS-1$
- String configurationName = "";
+ String configurationName = ""; //$NON-NLS-1$
IStorage storage = input.getStorage();
if (storage != null) {
storageName = storage.getName();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorStorage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorStorage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLEditorStorage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -21,23 +21,24 @@
*/
package org.hibernate.eclipse.hqleditor;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.QueryEditorStorage;
/**
* Storage for HQL editors without a file
*/
public class HQLEditorStorage extends QueryEditorStorage {
-
+
public HQLEditorStorage( String source ) {
super(source);
}
public HQLEditorStorage( String configurationName, String name, String source ) {
- super(configurationName,name, source);
+ super(configurationName,name, source);
}
-
+
public HQLEditorStorage(String consoleName, String string) {
- super(consoleName, "HQL: " + (consoleName==null?"<None>":consoleName), string);
+ super(consoleName, "HQL: " + (consoleName==null?HibernateConsoleMessages.HQLEditorStorage_none:consoleName), string); //$NON-NLS-1$
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLPartitionScanner.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLPartitionScanner.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLPartitionScanner.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -119,9 +119,9 @@
List rules= new ArrayList();
// Add rules for comments, quoted literals, and delimited identifiers.
- rules.add( new EndOfLineRule( "--", new Token( HQL_COMMENT )));
- rules.add( new SingleLineRule( "'", "'", new Token( HQL_QUOTED_LITERAL ), '\\' ));
- rules.add( new SingleLineRule( "\"", "\"", new Token( HQL_DELIMITED_IDENTIFIER ), '\\' ));
+ rules.add( new EndOfLineRule( "--", new Token( HQL_COMMENT ))); //$NON-NLS-1$
+ rules.add( new SingleLineRule( "'", "'", new Token( HQL_QUOTED_LITERAL ), '\\' )); //$NON-NLS-1$//$NON-NLS-2$
+ rules.add( new SingleLineRule( "\"", "\"", new Token( HQL_DELIMITED_IDENTIFIER ), '\\' )); //$NON-NLS-1$//$NON-NLS-2$
IPredicateRule[] result= new IPredicateRule[ rules.size() ];
rules.toArray( result );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLTextHover.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLTextHover.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/HQLTextHover.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -28,6 +28,7 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.Region;
import org.eclipse.swt.graphics.Point;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
/**
* This class implements the hover popup text service for HQL code.
@@ -43,9 +44,9 @@
} catch (BadLocationException x) {
}
}
- return "Empty Selection";
+ return HibernateConsoleMessages.HQLTextHover_empty_selection;
}
-
+
public IRegion getHoverRegion( ITextViewer textViewer, int offset ) {
Point selection = textViewer.getSelectedRange();
if (selection.x <= offset && offset < selection.x + selection.y)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/LoadConsoleCFGCompletionProposal.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -18,6 +18,7 @@
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -26,13 +27,13 @@
*
*/
public class LoadConsoleCFGCompletionProposal implements ICompletionProposal {
-
+
private ConsoleConfiguration consoleConfiguration;
public LoadConsoleCFGCompletionProposal(ConsoleConfiguration consoleConfiguration){
this.consoleConfiguration = consoleConfiguration;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument)
*/
@@ -42,16 +43,16 @@
try {
consoleConfiguration.build();
} catch (HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(HibernateConsolePlugin.getDefault().getShell(), "Could not load configuration " + consoleConfiguration.getName(), he);
+ HibernateConsolePlugin.getDefault().showError(HibernateConsolePlugin.getDefault().getShell(), HibernateConsoleMessages.LoadConsoleCFGCompletionProposal_could_not_load_configuration + consoleConfiguration.getName(), he);
}
- }
+ }
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo()
*/
public String getAdditionalProposalInfo() {
- return "No open console configuration found.\nThis will attempt to open the console configuration\nto enable better code completion.";
+ return HibernateConsoleMessages.LoadConsoleCFGCompletionProposal_no_open_console_cfg_found;
}
/* (non-Javadoc)
@@ -65,7 +66,7 @@
* @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString()
*/
public String getDisplayString() {
- return "Load Console Configuration";
+ return HibernateConsoleMessages.LoadConsoleCFGCompletionProposal_load_console_cfg;
}
/* (non-Javadoc)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePage.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLEditorPreferencePage.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -3,14 +3,15 @@
import org.eclipse.jface.preference.*;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
/**
* This class represents a preference page that
- * is contributed to the Preferences dialog. By
+ * is contributed to the Preferences dialog. By
* subclassing <samp>FieldEditorPreferencePage</samp>, we
* can use the field support built into JFace that allows
- * us to create a page that is small and knows how to
+ * us to create a page that is small and knows how to
* save, restore and apply itself.
* <p>
* This page is used to modify preferences only. They
@@ -26,9 +27,9 @@
public HQLEditorPreferencePage() {
super(GRID);
setPreferenceStore(HibernateConsolePlugin.getDefault().getPreferenceStore());
- setDescription("Colors for HQL editor syntax highlighting");
+ setDescription(HibernateConsoleMessages.HQLEditorPreferencePage_colors_for_hql_editor_highlighting);
}
-
+
/**
* Creates the field editors. Field editors are abstractions of
* the common GUI blocks needed to manipulate various types
@@ -36,14 +37,14 @@
* restore itself.
*/
public void createFieldEditors() {
- addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_DEFAULT_COLOR,
- "Default:", getFieldEditorParent()));
- addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_IDENTIFIER_COLOR,
- "Identifier:", getFieldEditorParent()));
- addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_KEYWORD_COLOR,
- "Keyword:", getFieldEditorParent()));
- addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_QUOTED_LITERAL_COLOR,
- "String literal:", getFieldEditorParent()));
+ addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_DEFAULT_COLOR,
+ HibernateConsoleMessages.HQLEditorPreferencePage_default, getFieldEditorParent()));
+ addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_IDENTIFIER_COLOR,
+ HibernateConsoleMessages.HQLEditorPreferencePage_identifier, getFieldEditorParent()));
+ addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_KEYWORD_COLOR,
+ HibernateConsoleMessages.HQLEditorPreferencePage_keyword, getFieldEditorParent()));
+ addField(new ColorFieldEditor(HQLPreferenceConstants.HQL_QUOTED_LITERAL_COLOR,
+ HibernateConsoleMessages.HQLEditorPreferencePage_string_literal, getFieldEditorParent()));
}
/* (non-Javadoc)
@@ -51,5 +52,5 @@
*/
public void init(IWorkbench workbench) {
}
-
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLPreferenceConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLPreferenceConstants.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/hqleditor/preferences/HQLPreferenceConstants.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -5,10 +5,10 @@
*/
public class HQLPreferenceConstants {
- public static final String HQL_KEYWORD_COLOR = "hql.keyword.color";
- public static final String HQL_IDENTIFIER_COLOR = "hql.identifier.color";
- public static final String HQL_DEFAULT_COLOR = "hql.default.color";
- public static final String HQL_QUOTED_LITERAL_COLOR = "hql.quoted_literal.color";
- public static final String HQL_COMMENT_COLOR = "hql.comment.color";
+ public static final String HQL_KEYWORD_COLOR = "hql.keyword.color"; //$NON-NLS-1$
+ public static final String HQL_IDENTIFIER_COLOR = "hql.identifier.color"; //$NON-NLS-1$
+ public static final String HQL_DEFAULT_COLOR = "hql.default.color"; //$NON-NLS-1$
+ public static final String HQL_QUOTED_LITERAL_COLOR = "hql.quoted_literal.color"; //$NON-NLS-1$
+ public static final String HQL_COMMENT_COLOR = "hql.comment.color"; //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/AddPropertyDialog.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -17,6 +17,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -30,6 +31,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
import org.hibernate.eclipse.console.model.impl.ExporterProperty;
import org.hibernate.util.StringHelper;
@@ -46,12 +48,12 @@
super( parentShell );
this.ef = ef;
}
-
+
protected Control createDialogArea(Composite parent) {
- getShell().setText("Add exporter property");
- setTitle("Add property to " + ef.getExporterDefinition().getDescription());
+ getShell().setText(HibernateConsoleMessages.AddPropertyDialog_add_exporter_property);
+ setTitle(HibernateConsoleMessages.AddPropertyDialog_add_property_to + ef.getExporterDefinition().getDescription());
Composite control = (Composite) super.createDialogArea( parent );
-
+
Composite composite = new Composite(control,SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2,false);
@@ -60,48 +62,48 @@
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
-
+
ModifyListener modifyListener = new ModifyListener() {
-
+
public void modifyText(ModifyEvent e) {
updateStatus();
}
-
+
};
Label label = new Label(composite, SWT.NONE);
- label.setText( "Name:" );
+ label.setText( HibernateConsoleMessages.AddPropertyDialog_name );
Combo combo = new Combo(composite, SWT.BORDER | SWT.LEAD | SWT.DROP_DOWN);
combo.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
combo.setFocus();
combo.addModifyListener( modifyListener );
propertyCombo = new ComboViewer(combo);
-
+
label = new Label(composite, SWT.NONE);
- label.setText( "Value:" );
-
+ label.setText( HibernateConsoleMessages.AddPropertyDialog_value );
+
value = new Text(composite, SWT.BORDER | SWT.LEAD );
value.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
value.addModifyListener( modifyListener );
-
+
initDefaultNames(ef, propertyCombo);
-
+
return control;
}
private void initDefaultNames(ExporterFactory ef2, ComboViewer viewer) {
viewer.setContentProvider( new IStructuredContentProvider() {
-
+
ExporterFactory localEf;
-
+
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
localEf = (ExporterFactory) newInput;
}
-
+
public void dispose() {
localEf = null;
}
-
+
public Object[] getElements(Object inputElement) {
Iterator set = localEf.getDefaultExporterProperties().entrySet().iterator();
List values = new ArrayList(4);
@@ -112,43 +114,43 @@
if(exporterProperty!=null) {
values.add(exporterProperty);
}
- //}
+ //}
}
return values.toArray( new ExporterProperty[values.size()] );
- }
+ }
});
-
+
viewer.setLabelProvider( new ILabelProvider() {
-
+
public void removeListener(ILabelProviderListener listener) {
-
+
}
-
+
public boolean isLabelProperty(Object element, String property) {
return false;
}
-
+
public void dispose() {
-
+
}
-
+
public void addListener(ILabelProviderListener listener) {
-
+
}
-
+
public String getText(Object element) {
ExporterProperty exporterProperty = ((ExporterProperty)element);
- return exporterProperty.getDescriptionForLabel();
+ return exporterProperty.getDescriptionForLabel();
}
-
+
public Image getImage(Object element) {
return null;
}
-
+
} );
-
+
viewer.addSelectionChangedListener( new ISelectionChangedListener() {
-
+
public void selectionChanged(SelectionChangedEvent event) {
if(value==null) return;
IStructuredSelection iss = (IStructuredSelection) event.getSelection();
@@ -156,48 +158,49 @@
value.setText( ((ExporterProperty)iss.getFirstElement()).getDefaultValue() );
}
}
-
+
} );
viewer.setInput( ef );
if(viewer.getCombo().getItemCount()>0) {
viewer.setSelection( new StructuredSelection(viewer.getElementAt( 0 )));
}
}
-
+
void updateStatus() {
getEnteredValues();
-
+
boolean ok = false;
if(StringHelper.isEmpty( getPropertyName() )) {
- setMessage( "The property name must be chosen or entered", IMessageProvider.ERROR);
+ setMessage( HibernateConsoleMessages.AddPropertyDialog_the_property_name_must_be_chosen_or_entered, IMessageProvider.ERROR);
} else if (getPropertyName().indexOf( ' ' )>=0 || getPropertyName().indexOf( '\t' )>=0) {
- setMessage( "The property name may not contain whitespaces", IMessageProvider.ERROR);
+ setMessage( HibernateConsoleMessages.AddPropertyDialog_the_property_name_may_not_contain_whitespaces, IMessageProvider.ERROR);
} else if(StringHelper.isEmpty( getPropertyValue() )) {
- setMessage( "The property value must be non-empty", IMessageProvider.ERROR);
+ setMessage( HibernateConsoleMessages.AddPropertyDialog_the_property_value_must_be_non_empty, IMessageProvider.ERROR);
} else {
if (ef.hasLocalValueFor( getPropertyName() )) {
- setMessage( "The property " + getPropertyName() + " is already set, pressing ok will overwrite the current value", IMessageProvider.WARNING);
+ String out = NLS.bind(HibernateConsoleMessages.AddPropertyDialog_the_property_is_already_set, getPropertyName());
+ setMessage(out, IMessageProvider.WARNING);
} else {
- setMessage( null, IMessageProvider.ERROR );
+ setMessage(null, IMessageProvider.ERROR);
}
ok = true;
}
-
+
Button button = getButton(IDialogConstants.OK_ID);
if(button!=null) {
button.setEnabled( ok );
}
}
-
+
public String getPropertyValue() {
return propertyValue;
}
-
+
public String getPropertyName() {
- return propertyName;
+ return propertyName;
}
-
+
void getEnteredValues() {
if(propertyCombo==null) {
propertyName = null;
@@ -210,19 +213,19 @@
propertyName = p.getName();
}
}
-
+
if(value!=null) {
- propertyValue = value.getText();
+ propertyValue = value.getText();
} else {
propertyValue = null;
}
}
-
+
protected void okPressed() {
getEnteredValues();
- super.okPressed();
+ super.okPressed();
}
-
+
public void create() {
super.create();
updateStatus();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -56,6 +56,7 @@
import org.eclipse.jface.text.DocumentRewriteSessionType;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.util.Assert;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.text.edits.TextEdit;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
@@ -68,6 +69,7 @@
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.execution.ExecutionContext.Command;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
import org.hibernate.tool.hbm2x.ArtifactCollector;
@@ -90,37 +92,37 @@
protected MultiTextEditWithProgress computeTextEdit(
ITextFileBuffer textFileBuffer, IProgressMonitor progressMonitor)
throws CoreException, OperationCanceledException {
-
+
IResource bufferRes = ResourcesPlugin.getWorkspace().getRoot().findMember(textFileBuffer.getLocation());
Map options = null;
if(bufferRes!=null) {
IJavaProject project = JavaCore.create(bufferRes.getProject());
- options = project.getOptions(true);
+ options = project.getOptions(true);
}
-
+
CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
-
+
IDocument document = textFileBuffer.getDocument();
String string = document.get();
TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, string, 0, string.length(), 0, null);
MultiTextEditWithProgress multiTextEditWithProgress = new MultiTextEditWithProgress(getOperationName());
if(edit==null) {
//HibernateConsolePlugin.getDefault().log("empty format for " + textFileBuffer.getLocation().toOSString());
- } else {
+ } else {
multiTextEditWithProgress.addChild(edit);
}
return multiTextEditWithProgress;
}
}
-
+
public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
Assert.isNotNull(configuration);
Assert.isNotNull(monitor);
try {
ExporterAttributes attributes = new ExporterAttributes(configuration);
-
+
List exporterFactories = attributes.getExporterFactories();
for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
ExporterFactory exFactory = (ExporterFactory) iter.next();
@@ -128,67 +130,67 @@
iter.remove();
}
}
-
+
Set outputDirectories = new HashSet();
ExporterFactory[] exporters = (ExporterFactory[]) exporterFactories.toArray( new ExporterFactory[exporterFactories.size()] );
ArtifactCollector collector = runExporters(attributes, exporters, outputDirectories, monitor);
-
+
Iterator iterator = outputDirectories.iterator();
while (iterator.hasNext()) {
String path = (String) iterator.next();
- refreshOutputDir( path );
+ refreshOutputDir( path );
}
-
+
RefreshTab.refreshResources(configuration, monitor);
-
+
// code formatting needs to happen *after* refresh to make sure eclipse will format the uptodate files!
if(collector!=null) {
formatGeneratedCode( monitor, collector );
}
-
-
+
+
} catch(Exception e) {
- throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
+ throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
} catch(NoClassDefFoundError e) {
- throw new CoreException(HibernateConsolePlugin.throwableToStatus(new HibernateConsoleRuntimeException("Received a NoClassDefFoundError, probably the console configuration classpath is incomplete or contains conflicting versions of the same class",e), 666));
+ throw new CoreException(HibernateConsolePlugin.throwableToStatus(new HibernateConsoleRuntimeException(HibernateConsoleMessages.CodeGenerationLaunchDelegate_received_noclassdeffounderror,e), 666));
} finally {
monitor.done();
- }
-
+ }
+
}
private void formatGeneratedCode(IProgressMonitor monitor, ArtifactCollector collector) {
- final TextFileBufferOperation operation = new FormatGeneratedCode( "Formate generated code" );
+ final TextFileBufferOperation operation = new FormatGeneratedCode( HibernateConsoleMessages.CodeGenerationLaunchDelegate_formate_generated_code );
- File[] javaFiles = collector.getFiles("java");
+ File[] javaFiles = collector.getFiles("java"); //$NON-NLS-1$
if(javaFiles.length>0) {
-
+
IPath[] locations = new IPath[javaFiles.length];
-
+
for (int i = 0; i < javaFiles.length; i++) {
File file = javaFiles[i];
locations[i] = new Path(file.getPath());
}
-
+
FileBufferOperationRunner runner= new FileBufferOperationRunner(FileBuffers.getTextFileBufferManager(), HibernateConsolePlugin.getShell());
try {
runner.execute(locations, operation, monitor);
}
catch (OperationCanceledException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("java format cancelled", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.CodeGenerationLaunchDelegate_java_format_cancelled, e);
}
catch (CoreException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("exception during java format", e);
- } catch (Throwable e) { // full guard since the above operation seem to be able to fail with IllegalArugmentException and SWT Invalid thread access while users are editing.
- HibernateConsolePlugin.getDefault().logErrorMessage("exception during java format", e);
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.CodeGenerationLaunchDelegate_exception_during_java_format, e);
+ } catch (Throwable e) { // full guard since the above operation seem to be able to fail with IllegalArugmentException and SWT Invalid thread access while users are editing.
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.CodeGenerationLaunchDelegate_exception_during_java_format, e);
}
}
-
+
}
private void refreshOutputDir(String outputdir) {
IResource bufferRes = PathHelper.findMember(ResourcesPlugin.getWorkspace().getRoot(), outputdir);
-
+
if (bufferRes != null && bufferRes.isAccessible()) {
try {
bufferRes.refreshLocal(IResource.DEPTH_INFINITE, null);
@@ -197,55 +199,55 @@
}
}
}
-
+
private ArtifactCollector runExporters (final ExporterAttributes attributes, final ExporterFactory[] exporterFactories, final Set outputDirectories, final IProgressMonitor monitor)
throws CoreException
{
-
- monitor.beginTask("Generating code for " + attributes.getConsoleConfigurationName(), exporterFactories.length + 1);
-
+
+ monitor.beginTask(HibernateConsoleMessages.CodeGenerationLaunchDelegate_generating_code_for + attributes.getConsoleConfigurationName(), exporterFactories.length + 1);
+
if (monitor.isCanceled())
return null;
-
+
ConsoleConfiguration cc = KnownConfigurations.getInstance().find(attributes.getConsoleConfigurationName());
if (attributes.isReverseEngineer()) {
- monitor.subTask("reading jdbc metadata");
+ monitor.subTask(HibernateConsoleMessages.CodeGenerationLaunchDelegate_reading_jdbc_metadata);
}
final Configuration cfg = buildConfiguration(attributes, cc, ResourcesPlugin.getWorkspace().getRoot());
-
+
monitor.worked(1);
-
+
if (monitor.isCanceled())
return null;
-
+
return (ArtifactCollector) cc.execute(new Command() {
public Object execute() {
ArtifactCollector artifactCollector = new ArtifactCollector();
-
+
// Global properties
Properties props = new Properties();
- props.put("ejb3", ""+attributes.isEJB3Enabled());
- props.put("jdk5", ""+attributes.isJDK5Enabled());
-
+ props.put("ejb3", ""+attributes.isEJB3Enabled()); //$NON-NLS-1$ //$NON-NLS-2$
+ props.put("jdk5", ""+attributes.isJDK5Enabled()); //$NON-NLS-1$//$NON-NLS-2$
+
for (int i = 0; i < exporterFactories.length; i++)
{
monitor.subTask(exporterFactories[i].getExporterDefinition().getDescription());
-
+
Properties globalProperties = new Properties();
- globalProperties.putAll(props);
-
+ globalProperties.putAll(props);
+
Exporter exporter;
try {
exporter = exporterFactories[i].createConfiguredExporter(cfg, attributes.getOutputPath(), attributes.getTemplatePath(), globalProperties, outputDirectories, artifactCollector);
} catch (CoreException e) {
- throw new HibernateConsoleRuntimeException("Error while setting up " + exporterFactories[i].getExporterDefinition(), e);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.CodeGenerationLaunchDelegate_error_while_setting_up + exporterFactories[i].getExporterDefinition(), e);
}
-
+
try {
exporter.start();
} catch(HibernateException he) {
- throw new HibernateConsoleRuntimeException("Error while running " + exporterFactories[i].getExporterDefinition().getDescription(), he);
+ throw new HibernateConsoleRuntimeException(HibernateConsoleMessages.CodeGenerationLaunchDelegate_error_while_running + exporterFactories[i].getExporterDefinition().getDescription(), he);
}
monitor.worked(1);
}
@@ -253,16 +255,16 @@
}
});
-
-
+
+
}
private Configuration buildConfiguration(final ExporterAttributes attributes, ConsoleConfiguration cc, IWorkspaceRoot root) {
- final boolean reveng = attributes.isReverseEngineer();
+ final boolean reveng = attributes.isReverseEngineer();
final String reverseEngineeringStrategy = attributes.getRevengStrategy();
final boolean preferBasicCompositeids = attributes.isPreferBasicCompositeIds();
final IResource revengres = PathHelper.findMember( root, attributes.getRevengSettings());
-
+
if(reveng) {
Configuration configuration = null;
if(cc.hasConfiguration()) {
@@ -270,37 +272,37 @@
} else {
configuration = cc.buildWith( null, false );
}
-
+
final JDBCMetaDataConfiguration cfg = new JDBCMetaDataConfiguration();
Properties properties = configuration.getProperties();
cfg.setProperties( properties );
cc.buildWith(cfg,false);
-
+
cfg.setPreferBasicCompositeIds(preferBasicCompositeids);
-
+
cc.execute(new Command() { // need to execute in the consoleconfiguration to let it handle classpath stuff!
public Object execute() {
-
-
- //todo: factor this setup of revengstrategy to core
+
+
+ //todo: factor this setup of revengstrategy to core
DefaultReverseEngineeringStrategy configurableNamingStrategy = new DefaultReverseEngineeringStrategy();
//configurableNamingStrategy.setSettings(qqsettings);
-
+
ReverseEngineeringStrategy res = configurableNamingStrategy;
if(revengres!=null) {
- /*Configuration configuration = cc.buildWith(new Configuration(), false);*/
+ /*Configuration configuration = cc.buildWith(new Configuration(), false);*/
/*Settings settings = cc.getSettings(configuration);*/
File file = PathHelper.getLocation( revengres ).toFile();
OverrideRepository repository = new OverrideRepository();///*settings.getDefaultCatalogName(),settings.getDefaultSchemaName()*/);
repository.addFile(file);
res = repository.getReverseEngineeringStrategy(res);
}
-
+
if(reverseEngineeringStrategy!=null && reverseEngineeringStrategy.trim().length()>0) {
- res = loadreverseEngineeringStrategy(reverseEngineeringStrategy, res);
+ res = loadreverseEngineeringStrategy(reverseEngineeringStrategy, res);
}
-
+
ReverseEngineeringSettings qqsettings = new ReverseEngineeringSettings(res)
.setDefaultPackageName(attributes.getPackageName())
.setDetectManyToMany( attributes.detectManyToMany() )
@@ -308,25 +310,25 @@
configurableNamingStrategy.setSettings( qqsettings );
res.setSettings(qqsettings);
-
+
cfg.setReverseEngineeringStrategy( res );
-
+
cfg.readFromJDBC();
cfg.buildMappings();
return null;
}
- });
-
+ });
+
return cfg;
} else {
cc.build();
final Configuration configuration = cc.getConfiguration();
-
+
cc.execute(new Command() {
public Object execute() {
-
+
configuration.buildMappings();
- return configuration;
+ return configuration;
}
});
return configuration;
@@ -336,44 +338,47 @@
// TODO: merge with revstrategy load in JDBCConfigurationTask
private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String className, ReverseEngineeringStrategy delegate) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class clazz = ReflectHelper.classForName(className);
Constructor constructor = clazz.getConstructor(new Class[] { ReverseEngineeringStrategy.class });
- return (ReverseEngineeringStrategy) constructor.newInstance(new Object[] { delegate });
- }
+ return (ReverseEngineeringStrategy) constructor.newInstance(new Object[] { delegate });
+ }
catch (NoSuchMethodException e) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class clazz = ReflectHelper.classForName(className);
ReverseEngineeringStrategy rev = (ReverseEngineeringStrategy) clazz.newInstance();
return rev;
- }
+ }
catch (Exception eq) {
- throw new HibernateConsoleRuntimeException("Could not create or find " + className + " with default no-arg constructor", eq);
+ String out = NLS.bind(HibernateConsoleMessages.CodeGenerationLaunchDelegate_could_not_create_or_find_with_default_noarg_constructor, className);
+ throw new HibernateConsoleRuntimeException(out, eq);
}
- }
+ }
catch (Exception e) {
- throw new HibernateConsoleRuntimeException("Could not create or find " + className + " with one argument delegate constructor", e);
- }
+ String out = NLS.bind(HibernateConsoleMessages.CodeGenerationLaunchDelegate_could_not_create_or_find_with_one_argument_delegate_constructor, className);
+ throw new HibernateConsoleRuntimeException(out, e);
+ }
}
-
+
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
ExporterAttributes attributes = new ExporterAttributes(configuration);
-
+
String configName = attributes.getConsoleConfigurationName();
if(StringHelper.isEmpty( configName )) {
- abort("Console configuration name is empty in " + configuration.getName(), null, ICodeGenerationLaunchConstants.ERR_UNSPECIFIED_CONSOLE_CONFIGURATION);
+ abort(HibernateConsoleMessages.CodeGenerationLaunchDelegate_console_configuration_name_is_empty_in + configuration.getName(), null, ICodeGenerationLaunchConstants.ERR_UNSPECIFIED_CONSOLE_CONFIGURATION);
}
-
+
if(KnownConfigurations.getInstance().find( configName )==null) {
- abort("Console configuration " + configName + " not found in " + configuration.getName(), null, ICodeGenerationLaunchConstants.ERR_CONSOLE_CONFIGURATION_NOTFOUND);
+ String out = NLS.bind(HibernateConsoleMessages.CodeGenerationLaunchDelegate_console_configuration_not_found_in, configName, configuration.getName());
+ abort(out, null, ICodeGenerationLaunchConstants.ERR_CONSOLE_CONFIGURATION_NOTFOUND);
}
-
+
if(StringHelper.isEmpty(attributes.getOutputPath())) {
- abort("Output has to be specified in " + configuration.getName(), null, ICodeGenerationLaunchConstants.ERR_OUTPUT_PATH_NOTFOUND);
+ abort(HibernateConsoleMessages.CodeGenerationLaunchDelegate_output_has_to_be_specified_in + configuration.getName(), null, ICodeGenerationLaunchConstants.ERR_OUTPUT_PATH_NOTFOUND);
}
-
+
return super.preLaunchCheck( configuration, mode, monitor );
}
-
+
protected void abort(String message, Throwable exception, int code)
throws CoreException {
throw new CoreException(new Status(IStatus.ERROR, HibernateConsolePlugin.getDefault().ID, code, message, exception));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -58,6 +58,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -70,13 +71,13 @@
private IStructuredSelection selection;
private SelectionButtonDialogField reverseengineer;
-
+
private StringButtonDialogField outputdir;
-
+
private StringButtonDialogField reverseEngineeringSettings;
-
+
private StringButtonDialogField reverseEngineeringStrategy;
-
+
private StringDialogField packageName;
private SelectionButtonDialogField preferRawCompositeIds;
@@ -85,26 +86,26 @@
private SelectionButtonDialogField useOwnTemplates;
private DirectoryBrowseField templatedir;
-
-
-
+
+
+
public CodeGenerationSettingsTab() {
super();
}
public void createControl(Composite parent) {
-
+
//initializeDialogUnits(parent);
-
+
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
-
+
container.setLayout(layout);
layout.numColumns = 4;
layout.verticalSpacing = 10;
-
+
consoleConfigurationName = new ComboDialogField(SWT.READ_ONLY);
- consoleConfigurationName.setLabelText("Console &configuration:");
+ consoleConfigurationName.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_console_configuration);
ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
@@ -112,67 +113,67 @@
names[i] = configuration.getName();
}
consoleConfigurationName.setItems(names);
-
+
IDialogFieldListener fieldlistener = new IDialogFieldListener() {
public void dialogFieldChanged(DialogField field) {
dialogChanged();
}
};
-
+
consoleConfigurationName.setDialogFieldListener(fieldlistener);
-
+
outputdir = new StringButtonDialogField(new IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
//IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), PathHelper.pathOrNull(outputdir.getText()), new IPath[0], "Select output directory", "Choose directory in which the generated files will be stored", new String[] {"cfg.xml"}, false, true, false);
- IPath[] paths = DialogSelectionHelper.chooseFolderEntries(getShell(), PathHelper.pathOrNull(outputdir.getText()), "Select output directory", "Choose directory in which the generated files will be stored", false);
+ IPath[] paths = DialogSelectionHelper.chooseFolderEntries(getShell(), PathHelper.pathOrNull(outputdir.getText()), HibernateConsoleMessages.CodeGenerationSettingsTab_select_output_dir, HibernateConsoleMessages.CodeGenerationSettingsTab_choose_dir_for_generated_files, false);
if(paths!=null && paths.length==1) {
outputdir.setText( ( (paths[0]).toOSString() ) );
- }
+ }
}
});
outputdir.setDialogFieldListener(fieldlistener);
- outputdir.setLabelText("Output &directory:");
- outputdir.setButtonLabel("&Browse...");
-
- templatedir = new DirectoryBrowseField(null, null, "Select template directory", "Choose directory containing custom templates");
+ outputdir.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_output_dir);
+ outputdir.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_browse);
+
+ templatedir = new DirectoryBrowseField(null, null, HibernateConsoleMessages.CodeGenerationSettingsTab_select_template_dir, HibernateConsoleMessages.CodeGenerationSettingsTab_choose_dir_custom_templates);
templatedir.setDialogFieldListener(fieldlistener);
- templatedir.setLabelText("Template &directory:");
- templatedir.setFilesystemBrowseLabel("&Filesystem...");
- templatedir.setWorkspaceBrowseLabel("&Workspace...");
-
+ templatedir.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_template_directory);
+ templatedir.setFilesystemBrowseLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_filesystem);
+ templatedir.setWorkspaceBrowseLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_workspace);
+
packageName = new StringDialogField();
packageName.setDialogFieldListener(fieldlistener);
- packageName.setLabelText("&Package:");
-
+ packageName.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_package);
+
reverseEngineeringStrategy = new StringButtonDialogField(new IStringButtonAdapter() {
-
+
public void changeControlPressed(DialogField field) {
- String string = DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategy.class.getName(), reverseEngineeringStrategy.getText(), "Choose a reverse engineering strategy", getShell());
+ String string = DialogSelectionHelper.chooseImplementation(ReverseEngineeringStrategy.class.getName(), reverseEngineeringStrategy.getText(), HibernateConsoleMessages.CodeGenerationSettingsTab_choose_reverse_engineering_strategy, getShell());
if(string!=null) {
reverseEngineeringStrategy.setText(string);
- }
- }
+ }
+ }
});
reverseEngineeringStrategy.setDialogFieldListener(fieldlistener);
- reverseEngineeringStrategy.setLabelText("reveng. s&trategy:");
- reverseEngineeringStrategy.setButtonLabel("&Browse...");
-
+ reverseEngineeringStrategy.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_reveng_strategy);
+ reverseEngineeringStrategy.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_browse);
+
reverseEngineeringSettings= new StringButtonDialogField(new IStringButtonAdapter() {
public void changeControlPressed(DialogField field) {
int defaultChoice = 0;
IPath reverseEngineeringSettingsFile = getReverseEngineeringSettingsFile();
-
+
if(reverseEngineeringSettingsFile==null) {
defaultChoice = 0;
} else {
defaultChoice = 1;
}
- MessageDialog dialog = new MessageDialog(getShell(),
- "Setup reverse engineering",
- null,
- "Do you want to create a new reveng.xml or use an existing file ?",
- MessageDialog.QUESTION,
- new String[] { "Create &new...", "Use &existing...", IDialogConstants.CANCEL_LABEL},
+ MessageDialog dialog = new MessageDialog(getShell(),
+ HibernateConsoleMessages.CodeGenerationSettingsTab_setup_reverse_engineering,
+ null,
+ HibernateConsoleMessages.CodeGenerationSettingsTab_do_you_want_create_reveng_xml,
+ MessageDialog.QUESTION,
+ new String[] { HibernateConsoleMessages.CodeGenerationSettingsTab_create_new, HibernateConsoleMessages.CodeGenerationSettingsTab_use_existing, IDialogConstants.CANCEL_LABEL},
defaultChoice);
int answer = dialog.open();
if(answer==0) { // create new
@@ -180,7 +181,7 @@
wizard.init(PlatformUI.getWorkbench(), selection );
wizard.setSelectConfiguration(getConfigurationName());
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-
+
WizardDialog wdialog = new WizardDialog(win.getShell(), wizard);
wdialog.open(); // This opens a dialog
IPath createdFilePath = wizard.getCreatedFilePath();
@@ -188,43 +189,43 @@
reverseEngineeringSettings.setText(createdFilePath.toOSString());
}
} else if (answer==1) { // use existing
- IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), reverseEngineeringSettingsFile, new IPath[0], "Select reverse engineering settings file", "Choose file from which settings for the reverse engineering will be read", new String[] {"reveng.xml"}, false, false, true);
+ IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), reverseEngineeringSettingsFile, new IPath[0], HibernateConsoleMessages.CodeGenerationSettingsTab_select_reverse_engineering_settings_file, HibernateConsoleMessages.CodeGenerationSettingsTab_choose_file_read_reverse_settings, new String[] {HibernateConsoleMessages.CodeGenerationSettingsTab_reveng_xml_1}, false, false, true);
if(paths!=null && paths.length==1) {
reverseEngineeringSettings.setText( ( (paths[0]).toOSString() ) );
- }
- }
+ }
+ }
}
});
reverseEngineeringSettings.setDialogFieldListener(fieldlistener);
- reverseEngineeringSettings.setLabelText("reveng.&xml:");
- reverseEngineeringSettings.setButtonLabel("&Setup...");
-
+ reverseEngineeringSettings.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_reveng_xml_2);
+ reverseEngineeringSettings.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_setup);
+
reverseengineer = new SelectionButtonDialogField(SWT.CHECK);
- reverseengineer.setLabelText("Reverse engineer from JDBC Connection");
+ reverseengineer.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_reverse_engineer_from_jdbc_connection);
reverseengineer.setDialogFieldListener(fieldlistener);
-
+
useOwnTemplates = new SelectionButtonDialogField(SWT.CHECK);
useOwnTemplates.setDialogFieldListener(fieldlistener);
- useOwnTemplates.setLabelText("Use custom templates (for custom file generation)");
-
+ useOwnTemplates.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_use_custom_templates);
+
preferRawCompositeIds = new SelectionButtonDialogField(SWT.CHECK);
- preferRawCompositeIds.setLabelText("Generate basic typed composite ids");
+ preferRawCompositeIds.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_generate_basic_typed_composite_ids);
preferRawCompositeIds.setSelection(true);
preferRawCompositeIds.setDialogFieldListener(fieldlistener);
-
+
autoManyToMany = new SelectionButtonDialogField(SWT.CHECK);
- autoManyToMany.setLabelText("Detect many-to-many tables");
+ autoManyToMany.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_detect_many_to_many_tables);
autoManyToMany.setSelection(true);
autoManyToMany.setDialogFieldListener(fieldlistener);
-
+
autoVersioning = new SelectionButtonDialogField(SWT.CHECK);
- autoVersioning.setLabelText("Detect optimistic lock columns");
+ autoVersioning.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_detect_optimistic_lock_columns);
autoVersioning.setSelection(true);
autoVersioning.setDialogFieldListener(fieldlistener);
-
+
useOwnTemplates.attachDialogField(templatedir);
reverseengineer.attachDialogFields(new DialogField[] { packageName, preferRawCompositeIds, reverseEngineeringSettings, reverseEngineeringStrategy, autoManyToMany, autoVersioning });
-
+
consoleConfigurationName.doFillIntoGrid(container, 4);
Control[] controls = outputdir.doFillIntoGrid(container, 4);
// Hack to tell the text field to stretch!
@@ -233,7 +234,7 @@
packageName.doFillIntoGrid(container, 4);
reverseEngineeringSettings.doFillIntoGrid(container, 4);
reverseEngineeringStrategy.doFillIntoGrid(container, 4);
-
+
fillLabel(container);
preferRawCompositeIds.doFillIntoGrid(container, 3);
fillLabel(container);
@@ -244,7 +245,7 @@
controls = templatedir.doFillIntoGrid(container, 4);
// Hack to tell the text field to stretch!
( (GridData)controls[1].getLayoutData() ).grabExcessHorizontalSpace=true;
-
+
dialogChanged();
setControl(container);
}
@@ -259,29 +260,29 @@
outputdir.setEnabled(!configSelected);
reverseengineer.setEnabled(!configSelected);
useOwnTemplates.setEnabled(!configSelected);
-
+
if (configSelected) {
- updateStatus("Console configuration must be specified");
+ updateStatus(HibernateConsoleMessages.CodeGenerationSettingsTab_console_cfg_must_be_specified);
return;
}
-
- String msg = PathHelper.checkDirectory(outputdir.getText(), "Output directory", false);
-
+
+ String msg = PathHelper.checkDirectory(outputdir.getText(), HibernateConsoleMessages.CodeGenerationSettingsTab_output_directory, false);
+
if (msg!=null) {
updateStatus(msg);
return;
- }
+ }
if(packageName.isEnabled() && getOutputPackage().length()>0) {
IStatus val= JavaConventions.validatePackageName(getOutputPackage() );
if (val.getSeverity() == IStatus.ERROR || val.getSeverity() == IStatus.WARNING) {
updateStatus(val.getMessage() );
return;
- }
+ }
}
-
+
if(reverseEngineeringSettings.getText().trim().length()>0) {
- msg = checkFile(getReverseEngineeringSettingsFile(), "reveng.xml");
+ msg = checkFile(getReverseEngineeringSettingsFile(), HibernateConsoleMessages.CodeGenerationSettingsTab_reveng_xml_3);
if(msg!=null) {
updateStatus(msg);
return;
@@ -289,7 +290,7 @@
}
if(useOwnTemplates.isSelected() ) {
- msg = PathHelper.checkDirectory(templatedir.getText(), "template directory", true);
+ msg = PathHelper.checkDirectory(templatedir.getText(), HibernateConsoleMessages.CodeGenerationSettingsTab_template_dir, true);
if (msg!=null) {
updateStatus(msg);
return;
@@ -298,21 +299,21 @@
/*IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(getTemplateDirectory() );
IResource[] files = new IFile[0];
boolean found = false;
-
+
if(resource.getType() == IResource.FOLDER) {
try {
found = ( (IFolder)resource).accept(new IResourceProxyVisitor() {
-
- public boolean visit(IResourceProxy proxy) throws CoreException {
+
+ public boolean visit(IResourceProxy proxy) throws CoreException {
return false;
}
-
+
});
} catch (CoreException e) {
// noop
}
}
-
+
if(!found) {
setMessage("No templates (*.vm) found in template directory", IMessageProvider.WARNING);
} else {
@@ -322,7 +323,7 @@
} else {
setMessage(null);
}
-
+
updateStatus(null);
}
@@ -335,24 +336,24 @@
if (resType == IResource.FILE) {
return null;
} else {
- return name + " must be a file";
+ return name + HibernateConsoleMessages.CodeGenerationSettingsTab_must_be_file;
}
} else {
- return name + " does not exist";
+ return name + HibernateConsoleMessages.CodeGenerationSettingsTab_does_not_exist;
}
}
-
+
private void updateStatus(String message) {
setErrorMessage(message);
updateLaunchConfigurationDialog();
}
-
+
public String getConfigurationName() {
return consoleConfigurationName.getText();
}
-
+
/**
* @return
*/
@@ -363,16 +364,16 @@
private String resolve(String expression) {
if(expression==null) return null;
IStringVariableManager variableManager = VariablesPlugin.getDefault().getStringVariableManager();
-
+
try {
return variableManager.performStringSubstitution(expression, false);
} catch (CoreException e) {
// ignore possible errors during substitution and just return the orginal expression
return expression;
- }
+ }
}
-
-
+
+
String getOutputPackage() {
return packageName.getText();
}
@@ -380,12 +381,12 @@
private IPath getReverseEngineeringSettingsFile() {
return PathHelper.pathOrNull(reverseEngineeringSettings.getText() );
- }
-
+ }
+
private String getReverseEngineeringStrategy() {
return reverseEngineeringStrategy.getText();
- }
-
+ }
+
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
// try {
// attributes = new ExporterAttributes(configuration);
@@ -395,7 +396,7 @@
}
public void initializeFrom(ILaunchConfiguration configuration) {
- try {
+ try {
ExporterAttributes attributes = new ExporterAttributes(configuration);
consoleConfigurationName.setText(attributes.getConsoleConfigurationName());
preferRawCompositeIds.setSelection(attributes.isPreferBasicCompositeIds());
@@ -409,8 +410,8 @@
packageName.setText(safeText(attributes.getPackageName()));
templatedir.setText(safeText(attributes.getTemplatePath()));
} catch (CoreException ce) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Problem when reading hibernate tools launch configuration", ce);
- }
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.CodeGenerationSettingsTab_problems_when_reading, ce);
+ }
}
private String safeText(String text) {
@@ -424,7 +425,7 @@
return text;
}
}
-
+
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR, strOrNull(outputdir.getText()));
configuration.setAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, preferRawCompositeIds.isSelected());
@@ -433,23 +434,23 @@
configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, isReverseEngineerEnabled());
configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_STRATEGY, strOrNull(reverseEngineeringStrategy.getText()));
configuration.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, strOrNull(reverseEngineeringSettings.getText()));
-
-
+
+
configuration.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, useOwnTemplates.isSelected());
configuration.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, strOrNull(templatedir.getText()));
-
- configuration.setAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME, getConfigurationName());
+
+ configuration.setAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME, getConfigurationName());
configuration.setAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME, getOutputPackage());
-
+
}
public String getName() {
- return "Main";
+ return HibernateConsoleMessages.CodeGenerationSettingsTab_main;
}
-
+
public Image getImage() {
return EclipseImages.getImage(ImageConstants.MINI_HIBERNATE);
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationLaunchDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationLaunchDelegate.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationLaunchDelegate.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -5,11 +5,12 @@
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class ConsoleConfigurationLaunchDelegate extends LaunchConfigurationDelegate {
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
- throw new IllegalStateException("Direct launch not supported");
+ throw new IllegalStateException(HibernateConsoleMessages.ConsoleConfigurationLaunchDelegate_direct_launch_not_supported);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -1,5 +1,5 @@
/**
- *
+ *
*/
package org.hibernate.eclipse.launch;
@@ -20,6 +20,7 @@
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -37,6 +38,7 @@
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
import org.hibernate.console.ImageConstants;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -46,21 +48,21 @@
import org.hibernate.util.StringHelper;
public class ConsoleConfigurationMainTab extends ConsoleConfigurationTab {
-
-
-
+
+
+
private Button coreMode;
private Button jpaMode;
private Button annotationsMode;
private Button confbutton;
-
+
private Text propertyFileText;
private Text configurationFileText;
private Text projectNameText;
private Text persistenceUnitNameText;
-
+
public String getName() {
- return "Main";
+ return HibernateConsoleMessages.ConsoleConfigurationMainTab_main;
}
public void createControl(Composite parent) {
@@ -71,39 +73,39 @@
layout.verticalSpacing = 0;
comp.setLayout(layout);
comp.setFont(font);
-
+
createConfigurationMode( comp );
-
+
createProjectEditor( comp );
-
+
createPropertyFileEditor(comp);
createConfigurationFileEditor(comp);
-
+
createPersistenceUnitEditor( comp );
-
-
+
+
}
private void createConfigurationMode(Composite container) {
- Group group = createGroup( container, "Type:");
+ Group group = createGroup( container, HibernateConsoleMessages.ConsoleConfigurationMainTab_type);
group.setLayout( new RowLayout( SWT.HORIZONTAL ) );
coreMode = new Button(group, SWT.RADIO);
- coreMode.setText("Core");
+ coreMode.setText(HibernateConsoleMessages.ConsoleConfigurationMainTab_core);
coreMode.addSelectionListener( getChangeListener() );
coreMode.setSelection( true );
annotationsMode = new Button(group, SWT.RADIO);
- annotationsMode.setText("Annotations (jdk 1.5+)");
+ annotationsMode.setText(HibernateConsoleMessages.ConsoleConfigurationMainTab_annotations);
annotationsMode.addSelectionListener( getChangeListener() );
jpaMode = new Button(group, SWT.RADIO);
- jpaMode.setText("JPA (jdk 1.5+)");
+ jpaMode.setText(HibernateConsoleMessages.ConsoleConfigurationMainTab_jpa);
jpaMode.addSelectionListener( getChangeListener() );
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
group.setLayoutData( gd );
}
-
+
protected void createProjectEditor(Composite parent) {
- Group group = createGroup( parent, "Project:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationMainTab_project );
projectNameText = createBrowseEditor( parent, group);
createBrowseButton( group, new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -111,20 +113,20 @@
}
} );
}
-
+
private void createPropertyFileEditor(Composite parent) {
- Group group = createGroup( parent, "Property file:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationMainTab_property_file );
propertyFileText = createBrowseEditor( parent, group);
createSetupButton( group, new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handlePropertyFileSetup();
}
- } );
+ } );
}
-
+
private void createConfigurationFileEditor(Composite parent) {
- Group group = createGroup( parent, "Configuration file:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationMainTab_configuration_file );
configurationFileText = createBrowseEditor( parent, group);
confbutton = createSetupButton( group, new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -132,10 +134,10 @@
}
});
}
-
+
private void createPersistenceUnitEditor(Composite parent) {
- Group group = createGroup( parent, "Persistence unit:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationMainTab_persistence_unit );
persistenceUnitNameText = new Text(group, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
persistenceUnitNameText.setFont( parent.getFont() );
@@ -143,72 +145,72 @@
persistenceUnitNameText.addModifyListener(getChangeListener());
}
-
+
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
-
+
configuration.setAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, getConfigurationMode().toString());
configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, nonEmptyTrimOrNull( projectNameText ));
configuration.setAttribute(IConsoleConfigurationLaunchConstants.PROPERTY_FILE, nonEmptyTrimOrNull(propertyFileText));
- configuration.setAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE, nonEmptyTrimOrNull(configurationFileText));
+ configuration.setAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE, nonEmptyTrimOrNull(configurationFileText));
configuration.setAttribute( IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, nonEmptyTrimOrNull(persistenceUnitNameText));
-
+
}
public void initializeFrom(ILaunchConfiguration configuration) {
-
+
try {
- ConfigurationMode cm = ConfigurationMode.parse(configuration.getAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, "" ));
+ ConfigurationMode cm = ConfigurationMode.parse(configuration.getAttribute( IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, "" )); //$NON-NLS-1$
coreMode.setSelection( cm.equals( ConfigurationMode.CORE ) );
annotationsMode.setSelection( cm.equals( ConfigurationMode.ANNOTATIONS ) );
jpaMode.setSelection( cm.equals( ConfigurationMode.JPA ) );
-
- projectNameText.setText( configuration.getAttribute( IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ) );
- propertyFileText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.PROPERTY_FILE, "" ) );
- configurationFileText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.CFG_XML_FILE, "" ));
- persistenceUnitNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, "" ));
+
+ projectNameText.setText( configuration.getAttribute( IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "" ) ); //$NON-NLS-1$
+ propertyFileText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.PROPERTY_FILE, "" ) ); //$NON-NLS-1$
+ configurationFileText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.CFG_XML_FILE, "" )); //$NON-NLS-1$
+ persistenceUnitNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, "" )); //$NON-NLS-1$
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
- }
+ }
}
-
+
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {}
-
+
private void handlePropertyFileSetup() {
int defaultChoice = 0;
IPath initialPath = getPropertyFilePath() != null ? getPropertyFilePath() : null;
-
+
if(initialPath!=null) {
defaultChoice = 1;
}
- MessageDialog dialog = createSetupDialog("Setup property file", "Do you want to create a new property file or use an existing one ?", defaultChoice);
+ MessageDialog dialog = createSetupDialog(HibernateConsoleMessages.ConsoleConfigurationMainTab_setup_property_file, HibernateConsoleMessages.ConsoleConfigurationMainTab_do_you_want_to_create_new_property_file, defaultChoice);
int answer = dialog.open();
if(answer==0) { // create new
- handlePropertyFileCreate();
+ handlePropertyFileCreate();
} else if (answer==1) { // use existing
- handlePropertyFileBrowse();
- }
+ handlePropertyFileBrowse();
+ }
}
-
-
+
+
private void handlePropertyFileBrowse() {
IPath initialPath = getPropertyFilePath() != null ? getPropertyFilePath() : new Path(getProjectName());
- IPath[] paths = org.hibernate.eclipse.console.utils.xpl.DialogSelectionHelper.chooseFileEntries(getShell(), initialPath, new IPath[0], "Select property file", "Choose file to use as hibernate.properties", new String[] {"properties"}, false, false, true);
+ IPath[] paths = org.hibernate.eclipse.console.utils.xpl.DialogSelectionHelper.chooseFileEntries(getShell(), initialPath, new IPath[0], HibernateConsoleMessages.ConsoleConfigurationMainTab_select_propertyfile, HibernateConsoleMessages.ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_properties, new String[] {HibernateConsoleMessages.ConsoleConfigurationMainTab_properties}, false, false, true);
if(paths!=null && paths.length==1) {
propertyFileText.setText( (paths[0]).toOSString() );
}
}
-
+
private void handleProjectBrowse() {
- IJavaProject paths = DialogSelectionHelper.chooseJavaProject( getShell(), findJavaProject(), "Select java project", "The (optional) java project is used to determine the default classpath" );
+ IJavaProject paths = DialogSelectionHelper.chooseJavaProject( getShell(), findJavaProject(), HibernateConsoleMessages.ConsoleConfigurationMainTab_select_java_project, HibernateConsoleMessages.ConsoleConfigurationMainTab_java_project_to_determine_default_classpath );
if(paths!=null) {
projectNameText.setText( paths.getProject().getName() );
} else {
- projectNameText.setText("");
+ projectNameText.setText(""); //$NON-NLS-1$
}
}
-
+
private IJavaProject findJavaProject(){
IPath path = pathOrNull(getProjectName());
if (path != null && path.segmentCount() >= 1){
@@ -217,14 +219,14 @@
}
return null;
}
-
+
private void handlePropertyFileCreate() {
Wizard wizard = new Wizard(){
-
- String pageName = "Create Property File";
-
+
+ String pageName = HibernateConsoleMessages.ConsoleConfigurationMainTab_create_property_file;
+
WizardNewFileCreationPage cPage = null;
-
+
@Override
public void addPages() {
StructuredSelection selection = null;
@@ -235,10 +237,10 @@
selection = StructuredSelection.EMPTY;
}
cPage = new WizardNewFileCreationPage(pageName, selection);
- cPage.setTitle( "Create Hibernate Properties file (.properties)" );
- cPage.setDescription( "Create a new properties file" );
- cPage.setFileName("hibernate.properties");
- addPage( cPage );
+ cPage.setTitle( HibernateConsoleMessages.ConsoleConfigurationMainTab_create_hibernate_properties_file );
+ cPage.setDescription( HibernateConsoleMessages.ConsoleConfigurationMainTab_create_new_properties_file );
+ cPage.setFileName("hibernate.properties"); //$NON-NLS-1$
+ addPage( cPage );
}
@Override
@@ -247,46 +249,46 @@
propertyFileText.setText( file.getFullPath().toOSString() );
return true;
}};
-
+
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
WizardDialog wdialog = new WizardDialog(win.getShell(), wizard);
wdialog.open();
}
-
+
private MessageDialog createSetupDialog(String title, String question, int defaultChoice){
- return new MessageDialog(getShell(),
- title,
- null,
- question,
- MessageDialog.QUESTION,
- new String[] { "Create &new...", "Use &existing...", IDialogConstants.CANCEL_LABEL},
+ return new MessageDialog(getShell(),
+ title,
+ null,
+ question,
+ MessageDialog.QUESTION,
+ new String[] { HibernateConsoleMessages.ConsoleConfigurationMainTab_create_new, HibernateConsoleMessages.ConsoleConfigurationMainTab_use_existing, IDialogConstants.CANCEL_LABEL},
defaultChoice);
}
-
+
private void handleConfigurationFileSetup() {
int defaultChoice = 0;
IPath initialPath = getConfigurationFilePath() != null ? getConfigurationFilePath() : null;
-
+
if(initialPath!=null) {
defaultChoice = 1;
}
- MessageDialog dialog = createSetupDialog("Setup configuration file", "Do you want to create a new *.cfg.xml or use an existing one ?", defaultChoice);
+ MessageDialog dialog = createSetupDialog(HibernateConsoleMessages.ConsoleConfigurationMainTab_setup_configuration_file, HibernateConsoleMessages.ConsoleConfigurationMainTab_do_you_want_to_create_new_cfgxml, defaultChoice);
int answer = dialog.open();
if(answer==0) { // create new
- handleConfigurationFileCreate();
+ handleConfigurationFileCreate();
} else if (answer==1) { // use existing
- handleConfigurationFileBrowse();
- }
+ handleConfigurationFileBrowse();
+ }
}
-
+
private void handleConfigurationFileBrowse() {
IPath initialPath = getConfigurationFilePath() != null ? getConfigurationFilePath() : new Path(getProjectName());
- IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), initialPath, new IPath[0], "Select hibernate.cfg.xml file", "Choose file to use as hibernate.cfg.xml", new String[] {"cfg.xml"}, false, false, true);
+ IPath[] paths = DialogSelectionHelper.chooseFileEntries(getShell(), initialPath, new IPath[0], HibernateConsoleMessages.ConsoleConfigurationMainTab_select_hibernate_cfg_xml_file, HibernateConsoleMessages.ConsoleConfigurationMainTab_choose_file_to_use_as_hibernate_cfg_xml, new String[] {HibernateConsoleMessages.ConsoleConfigurationMainTab_cfg_xml}, false, false, true);
if(paths!=null && paths.length==1) {
configurationFileText.setText( (paths[0]).toOSString() );
}
}
-
+
private void handleConfigurationFileCreate() {
StructuredSelection selection = null;
IJavaProject project = findJavaProject();
@@ -298,13 +300,13 @@
NewConfigurationWizard wizard = new NewConfigurationWizard();
wizard.init(PlatformUI.getWorkbench(), selection );
IWorkbenchWindow win = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-
+
WizardDialog wdialog = new WizardDialog(win.getShell(), wizard);
wdialog.create();
- IWizardPage configPage = wizard.getPage("wizardPage");
+ IWizardPage configPage = wizard.getPage(HibernateConsoleMessages.ConsoleConfigurationMainTab_wizard_page);
if (configPage != null && configPage instanceof NewConfigurationWizardPage){
((NewConfigurationWizardPage)configPage).setCreateConsoleConfigurationVisible(false);
- }
+ }
// This opens a dialog
if (wdialog.open() == Window.OK){
WizardNewFileCreationPage createdFilePath = ((WizardNewFileCreationPage)wizard.getStartingPage());
@@ -314,8 +316,8 @@
}
}
}
-
+
private Path pathOrNull(String p) {
if(p==null || p.trim().length()==0) {
return null;
@@ -329,71 +331,72 @@
}
public Path getPropertyFilePath() {
- String p = propertyFileText.getText();
+ String p = propertyFileText.getText();
return pathOrNull(p);
}
-
+
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage( null );
setMessage( null );
String propertyFilename = propertyFileText.getText();
String configurationFilename = configurationFileText.getText();
-
+
configurationFileText.setEnabled( /* TODO !configurationFileWillBeCreated && */ !getConfigurationMode().equals( ConfigurationMode.JPA ) );
confbutton.setEnabled( !getConfigurationMode().equals( ConfigurationMode.JPA ) );
-
+
persistenceUnitNameText.setEnabled( getConfigurationMode().equals( ConfigurationMode.JPA) );
-
+
if(getProjectName()!=null && StringHelper.isNotEmpty(getProjectName().trim())) {
Path projectPath = new Path(getProjectName());
if (projectPath.segmentCount() > 1){
- setErrorMessage("Path for project must have only one segment.");
+ setErrorMessage(HibernateConsoleMessages.ConsoleConfigurationMainTab_path_for_project_must_have_only_one_segment);
return false;
}
IJavaProject findJavaProject = ProjectUtils.findJavaProject( getProjectName() );
if(findJavaProject==null || !findJavaProject.exists()) {
- setErrorMessage("The Java project " + getProjectName() + " does not exist.");
+ String out = NLS.bind(HibernateConsoleMessages.ConsoleConfigurationMainTab_the_java_project_does_not_exist, getProjectName());
+ setErrorMessage(out);
return false;
}
}
-
+
/* TODO: warn about implicit behavior of loading /hibernate.cfg.xml, /hibernate.properties and /META-INF/persistence.xml
* if (propertyFilename.length() == 0 && configurationFilename.trim().length() == 0) {
setErrorMessage("Property or Configuration file must be specified");
return;
} */
-
+
if (propertyFilename.length() > 0) {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(propertyFilename);
- String msg = checkForFile("Property file", resource);
+ String msg = checkForFile(HibernateConsoleMessages.ConsoleConfigurationMainTab_property_file_2, resource);
if(msg!=null) {
setErrorMessage(msg);
return false;
}
}
-
+
if (/*!configurationFileWillBeCreated &&*/ configurationFilename.length() > 0) {
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(configurationFilename);
- String msg = checkForFile("Configuration file",resource);
+ String msg = checkForFile(HibernateConsoleMessages.ConsoleConfigurationMainTab_configuration_file_2,resource);
if(msg!=null) {
setErrorMessage(msg);
return false;
}
- }
-
+ }
+
/*if((useProjectClassPath() && StringHelper.isEmpty( getProjectName() )) && classPathViewer.getTable().getItemCount()==0) {
setErrorMessage( "Need to specify a project or setup a classpath" );
return;
}
-
+
if((!useProjectClassPath() && classPathViewer.getTable().getItemCount()==0)) {
setErrorMessage( "Need to specify a classpath when not using a project classpath" );
return;
} TODO*/
-
+
return true;
}
-
+
private ConfigurationMode getConfigurationMode() {
if(annotationsMode.getSelection()) {
return ConfigurationMode.ANNOTATIONS;
@@ -413,10 +416,10 @@
if(resource instanceof IFile) {
return null;
} else {
- return msgPrefix + " is not a file";
- }
+ return msgPrefix + HibernateConsoleMessages.ConsoleConfigurationMainTab_is_not_file;
+ }
} else {
- return msgPrefix + " does not exist";
+ return msgPrefix + HibernateConsoleMessages.ConsoleConfigurationMainTab_does_not_exist;
}
}
@@ -424,5 +427,5 @@
return EclipseImages.getImage(ImageConstants.MINI_HIBERNATE);
}
-
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -17,6 +17,7 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -25,43 +26,43 @@
public class ConsoleConfigurationMappingsTab extends ConsoleConfigurationTab {
private UpDownListComposite mappingFilesViewer;
-
+
public void createControl(Composite parent) {
Composite composite = buildMappingFileTable(parent);
setControl( composite );
}
private UpDownListComposite buildMappingFileTable(Composite parent) {
- mappingFilesViewer = new UpDownListComposite(parent, SWT.NONE, "Additonal mapping files (not listed in cfg.xml)") {
+ mappingFilesViewer = new UpDownListComposite(parent, SWT.NONE, HibernateConsoleMessages.ConsoleConfigurationMappingsTab_additional_mapping_files) {
protected Object[] handleAdd(int idx) {
TableItem[] items = getTable().getItems();
IPath[] exclude = new IPath[items.length];
-
+
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
- exclude[i] = (IPath) item.getData();
+ exclude[i] = (IPath) item.getData();
}
-
- return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, "Add hbm.xml file", "Add a Hibernate Mapping file", new String[] { "hbm.xml" }, true, false, true);
+
+ return DialogSelectionHelper.chooseFileEntries(getShell(), null, exclude, HibernateConsoleMessages.ConsoleConfigurationMappingsTab_add_hbm_xml_file, HibernateConsoleMessages.ConsoleConfigurationMappingsTab_add_hibernate_mapping_file, new String[] { "hbm.xml" }, true, false, true); //$NON-NLS-1$
}
protected void listChanged() {
updateLaunchConfigurationDialog();
}
};
-
+
GridData gd;
gd = new GridData(GridData.FILL_BOTH);
-
+
gd.horizontalSpan = 3;
gd.verticalSpan = 1;
-
+
mappingFilesViewer.setLayoutData( gd );
return mappingFilesViewer;
}
public String getName() {
- return "Mappings";
+ return HibernateConsoleMessages.ConsoleConfigurationMappingsTab_mappings;
}
private IPath[] getMappings() {
@@ -71,7 +72,7 @@
for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
IPath path = (IPath) item.getData();
- str[i] = path;
+ str[i] = path;
}
return str;
}
@@ -90,7 +91,7 @@
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
- }
+ }
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
@@ -104,11 +105,11 @@
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-
+
}
public Image getImage() {
return EclipseImages.getImage( ImageConstants.MAPPEDCLASS );
}
-
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationOptionsTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -15,16 +15,17 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.hibernate.cfg.NamingStrategy;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.xml.sax.EntityResolver;
public class ConsoleConfigurationOptionsTab extends ConsoleConfigurationTab {
-
+
private Text entityResolverClassNameText;
private Text namingStrategyClassNameText;
-
+
public void createControl(Composite parent) {
Font font = parent.getFont();
Composite comp = new Composite(parent, SWT.NONE);
@@ -33,73 +34,73 @@
layout.verticalSpacing = 0;
comp.setLayout(layout);
comp.setFont(font);
-
+
createNamingStrategyClassNameEditor( comp );
createEntityResolverClassNameEditor( comp );
-
+
}
-
+
private void createNamingStrategyClassNameEditor(Composite parent) {
- Group group = createGroup( parent, "Naming strategy:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationOptionsTab_naming_strategy );
namingStrategyClassNameText = createBrowseEditor( parent, group);
createBrowseButton( group, new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleNamingStrategyBrowse();
}
- });
+ });
}
private void createEntityResolverClassNameEditor(Composite parent) {
- Group group = createGroup( parent, "Entity resolver:" );
+ Group group = createGroup( parent, HibernateConsoleMessages.ConsoleConfigurationOptionsTab_entity_resolver );
entityResolverClassNameText = createBrowseEditor( parent, group);
createBrowseButton( group, new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
handleEntityResolverBrowse();
}
- });
+ });
}
public String getName() {
- return "Options";
+ return HibernateConsoleMessages.ConsoleConfigurationOptionsTab_options;
}
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB);
}
-
+
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- namingStrategyClassNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.NAMING_STRATEGY, "" ) );
- entityResolverClassNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, "" ) );
+ namingStrategyClassNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.NAMING_STRATEGY, "" ) ); //$NON-NLS-1$
+ entityResolverClassNameText.setText( configuration.getAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, "" ) ); //$NON-NLS-1$
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log(e);
- }
+ }
}
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute( IConsoleConfigurationLaunchConstants.NAMING_STRATEGY, nonEmptyTrimOrNull( namingStrategyClassNameText ) );
- configuration.setAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, nonEmptyTrimOrNull( entityResolverClassNameText ) );
+ configuration.setAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, nonEmptyTrimOrNull( entityResolverClassNameText ) );
}
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
-
+
}
-
+
private void handleEntityResolverBrowse() {
- String string = DialogSelectionHelper.chooseImplementation(EntityResolver.class.getName(), entityResolverClassNameText.getText(), "Select entity resolver class", getShell());
+ String string = DialogSelectionHelper.chooseImplementation(EntityResolver.class.getName(), entityResolverClassNameText.getText(), HibernateConsoleMessages.ConsoleConfigurationOptionsTab_select_entity_resolver_class, getShell());
if(string!=null) {
entityResolverClassNameText.setText(string);
}
}
-
+
private void handleNamingStrategyBrowse() {
- String string = DialogSelectionHelper.chooseImplementation(NamingStrategy.class.getName(), namingStrategyClassNameText.getText(), "Select naming strategy class", getShell());
+ String string = DialogSelectionHelper.chooseImplementation(NamingStrategy.class.getName(), namingStrategyClassNameText.getText(), HibernateConsoleMessages.ConsoleConfigurationOptionsTab_select_naming_strategy_class, getShell());
if(string!=null) {
namingStrategyClassNameText.setText(string);
- }
+ }
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -14,41 +14,42 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.util.StringHelper;
abstract public class ConsoleConfigurationTab extends AbstractLaunchConfigurationTab {
protected class ChangeListener implements ModifyListener, SelectionListener {
-
+
public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
-
+
public void widgetDefaultSelected(SelectionEvent e) {/*do nothing*/}
-
+
public void widgetSelected(SelectionEvent e) {
// can use e.getSource() to handle button selection
- updateLaunchConfigurationDialog();
+ updateLaunchConfigurationDialog();
}
}
ChangeListener changeListener = new ChangeListener();
private ILaunchConfiguration currentLaunchConfig;
-
+
protected Button createBrowseButton(Group group, SelectionListener selectionListener) {
- Button button = createPushButton(group, "Browse...", null);
+ Button button = createPushButton(group, HibernateConsoleMessages.ConsoleConfigurationTab_browse, null);
button.addSelectionListener(selectionListener);
return button;
}
-
+
protected Button createSetupButton(Group group, SelectionListener selectionListener) {
- Button button = createPushButton(group, "Setup...", null);
+ Button button = createPushButton(group, HibernateConsoleMessages.ConsoleConfigurationTab_setup, null);
button.addSelectionListener(selectionListener);
return button;
}
-
+
protected Button createNewFileButton(Group group, SelectionListener selectionListener) {
- Button button = createPushButton(group, "Create New", null);
+ Button button = createPushButton(group, HibernateConsoleMessages.ConsoleConfigurationTab_create_new, null);
button.addSelectionListener(selectionListener);
return button;
}
@@ -56,11 +57,11 @@
protected Group createGroup(Composite parent, String title) {
return createGroup(parent, title, 2);
}
-
+
protected Group createGroup(Composite parent, String title, int columns) {
Font font = parent.getFont();
Group group= new Group(parent, SWT.NONE);
- group.setText(title);
+ group.setText(title);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
group.setLayoutData(gd);
GridLayout layout = new GridLayout();
@@ -77,11 +78,11 @@
protected Text createBrowseEditor(Composite parent, Group group) {
Text text = new Text(group, SWT.SINGLE | SWT.BORDER);
Font font=parent.getFont();
- GridData gd;
+ GridData gd;
gd = new GridData(GridData.FILL_HORIZONTAL);
text.setLayoutData(gd);
text.setFont(font);
- text.addModifyListener(getChangeListener());
+ text.addModifyListener(getChangeListener());
return text;
}
@@ -95,7 +96,7 @@
} else {
return str.trim();
}
- }
-
-
+ }
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTabGroup.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTabGroup.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationTabGroup.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -11,6 +11,7 @@
import org.eclipse.jdt.internal.debug.ui.classpath.IClasspathEntry;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
public class ConsoleConfigurationTabGroup extends
@@ -20,18 +21,18 @@
}
-
+
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {
new ConsoleConfigurationMainTab(),
new ConsoleConfigurationOptionsTab(),
new JavaClasspathTab() {
-
+
public boolean isShowBootpath() {
return false;
}
-
- public boolean isValid(ILaunchConfiguration launchConfig) {
+
+ public boolean isValid(ILaunchConfiguration launchConfig) {
if(super.isValid( launchConfig )) {
setErrorMessage( null );
setMessage( null );
@@ -44,32 +45,32 @@
return true;
}
}
-
+
}
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
}
- setErrorMessage( "Classpath must be set or restored to default" );
- return false;
- }
- return false;
+ setErrorMessage( HibernateConsoleMessages.ConsoleConfigurationTabGroup_classpath_must_be_set_or_restored_to_default );
+ return false;
+ }
+ return false;
}
-
+
public void initializeFrom(ILaunchConfiguration configuration) {
-
+
super.initializeFrom( configuration );
}
-
+
public boolean canSave() {
return super.canSave();
}
},
new ConsoleConfigurationMappingsTab(),
new CommonTab(),
-
+
};
-
- this.setTabs(tabs);
+
+ this.setTabs(tabs);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/DirectoryBrowseField.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -13,69 +13,70 @@
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
public class DirectoryBrowseField extends StringDialogField {
-
+
protected Button filesystemBrowse, workspaceBrowse;
protected String filesystemBrowseLabel, workspaceBrowseLabel;
protected IPath initialFilesystemPath, initialWorkspacePath;
protected String dialogTitle, dialogDescription;
-
+
public DirectoryBrowseField (IPath initialFilesystemPath, IPath initialWorkspacePath, String dialogTitle, String dialogDescription)
{
super();
-
- filesystemBrowseLabel = "Filesystem...";
- workspaceBrowseLabel = "Workspace..";
-
+
+ filesystemBrowseLabel = HibernateConsoleMessages.DirectoryBrowseField_filesystem;
+ workspaceBrowseLabel = HibernateConsoleMessages.DirectoryBrowseField_workspace;
+
this.initialFilesystemPath = initialFilesystemPath;
this.initialWorkspacePath = initialWorkspacePath;
this.dialogTitle = dialogTitle;
this.dialogDescription = dialogDescription;
}
-
+
protected void updateEnableState() {
super.updateEnableState();
boolean enabled = isEnabled();
-
+
if (filesystemBrowse != null)
filesystemBrowse.setEnabled(enabled);
if (workspaceBrowse != null)
workspaceBrowse.setEnabled(enabled);
}
-
+
protected static GridData gridDataForButton(Button button, int span) {
GridData gd= new GridData();
gd.horizontalAlignment= GridData.FILL;
gd.grabExcessHorizontalSpace= false;
gd.horizontalSpan= span;
- gd.widthHint = SWTUtil.getButtonWidthHint(button);
+ gd.widthHint = SWTUtil.getButtonWidthHint(button);
return gd;
- }
-
+ }
+
public int getNumberOfControls() {
return 4;
}
-
+
public Control[] doFillIntoGrid(Composite parent, int columns) {
assertEnoughColumns(columns);
-
+
Label label = getLabelControl(parent);
label.setLayoutData(gridDataForLabel(1));
-
+
Text text = getTextControl(parent);
text.setLayoutData(gridDataForText(columns - 3));
-
-
+
+
Button filesystemButton = getFilesystemBrowseButton(parent);
filesystemButton.setLayoutData(gridDataForButton(filesystemButton, 1));
Button workspaceButton = getWorkspaceBrowseButton(parent);
filesystemButton.setLayoutData(gridDataForButton(workspaceButton, 1));
-
+
return new Control[] { label, text, filesystemButton, workspaceButton };
}
-
+
protected void browseFilesystem ()
{
DirectoryDialog dialog = new DirectoryDialog(filesystemBrowse.getShell());
@@ -84,14 +85,14 @@
if (initialFilesystemPath != null) {
dialog.setFilterPath(initialFilesystemPath.toOSString());
}
-
+
String dir = dialog.open();
if (dir != null)
{
setText(dir);
}
}
-
+
protected void browseWorkspace ()
{
IPath[] paths = DialogSelectionHelper.chooseFolderEntries(filesystemBrowse.getShell(), initialWorkspacePath, dialogTitle, dialogDescription, false);
@@ -99,7 +100,7 @@
setText(paths[0].toOSString());
}
}
-
+
public Button getFilesystemBrowseButton (Composite parent)
{
if (filesystemBrowse == null)
@@ -117,10 +118,10 @@
}
});
}
-
+
return filesystemBrowse;
}
-
+
public Button getWorkspaceBrowseButton (Composite parent)
{
if (workspaceBrowse == null)
@@ -140,7 +141,7 @@
}
return workspaceBrowse;
}
-
+
public void setFilesystemBrowseLabel(String filesystemBrowseLabel) {
this.filesystemBrowseLabel = filesystemBrowseLabel;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterAttributes.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -51,8 +51,10 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.console.HibernateConsoleRuntimeException;
import org.hibernate.eclipse.console.ExtensionManager;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
@@ -71,7 +73,7 @@
private List exporterFactories;
private boolean autoManyToManyDetection;
private boolean autoVersioning;
-
+
public ExporterAttributes () { }
public ExporterAttributes (ILaunchConfiguration configuration)
@@ -79,68 +81,69 @@
{
initialize(configuration);
}
-
+
public void initialize (ILaunchConfiguration configuration)
throws CoreException
{
try {
- consoleConfigurationName = configuration.getAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,"");
- outputPath = configuration.getAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,"");
+ consoleConfigurationName = configuration.getAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,""); //$NON-NLS-1$
+ outputPath = configuration.getAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,""); //$NON-NLS-1$
reverseEngineer = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, false);
- revengSettings = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, "");
- revengStrategy = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_STRATEGY, "");
+ revengSettings = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, ""); //$NON-NLS-1$
+ revengStrategy = configuration.getAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_STRATEGY, ""); //$NON-NLS-1$
useOwnTemplates = configuration.getAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES,false);
enableJDK5 = configuration.getAttribute(HibernateLaunchConstants.ATTR_ENABLE_JDK5,false);
enableEJB3 = configuration.getAttribute(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS,false);
- packageName = configuration.getAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME,"");
- templatePath = configuration.getAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR,"");
+ packageName = configuration.getAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME,""); //$NON-NLS-1$
+ templatePath = configuration.getAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR,""); //$NON-NLS-1$
preferBasicCompositeIds = configuration.getAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
autoManyToManyDetection = configuration.getAttribute( HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, true);
autoVersioning = configuration.getAttribute( HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
-
-
+
+
if (!useOwnTemplates) {
templatePath = null;
}
-
+
exporterFactories = readExporterFactories(configuration);
-
+
} catch (CoreException e) {
- throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
+ throw new CoreException(HibernateConsolePlugin.throwableToStatus(e, 666));
}
}
static String getLaunchAttributePrefix(String exporterId) {
- return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId;
+ return HibernateLaunchConstants.ATTR_EXPORTERS + "." + exporterId; //$NON-NLS-1$
}
-
+
private List readExporterFactories(ILaunchConfiguration configuration) throws CoreException {
List exporterNames = configuration.getAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, (List)null);
-
- if(exporterNames!=null) {
+
+ if(exporterNames!=null) {
Map exDefinitions = ExtensionManager.findExporterDefinitionsAsMap();
List factories = new ArrayList();
for (Iterator iterator = exporterNames.iterator(); iterator.hasNext();) {
String exporterId = (String) iterator.next();
- String extensionId = configuration.getAttribute(getLaunchAttributePrefix(exporterId) + ".extension_id", (String)null);
+ String extensionId = configuration.getAttribute(getLaunchAttributePrefix(exporterId) + ".extension_id", (String)null); //$NON-NLS-1$
ExporterDefinition expDef = (ExporterDefinition) exDefinitions.get(extensionId);
if(expDef==null) {
- throw new HibernateConsoleRuntimeException("Could not locate exporter for '" + extensionId + "' in " + configuration.getName());
+ String out = NLS.bind(HibernateConsoleMessages.ExporterAttributes_could_not_locate_exporter_for_in, extensionId, configuration.getName());
+ throw new HibernateConsoleRuntimeException(out);
} else {
ExporterFactory exporterFactory = new ExporterFactory( expDef, exporterId );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() );
+ + ".properties", new HashMap() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
- }
+ }
}
return factories;
-
- } else {
+
+ } else {
// fall back to old way of reading if list of exporters does not exist.
ExporterDefinition[] exDefinitions = ExtensionManager.findExporterDefinitions();
List factories = new ArrayList();
@@ -150,74 +153,74 @@
ExporterFactory exporterFactory = new ExporterFactory( expDef, expDef.getId() );
exporterFactory.isEnabled( configuration );
factories.add( exporterFactory );
- Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
- + ".properties", new HashMap() );
+ Map props = configuration.getAttribute( getLaunchAttributePrefix(exporterFactory.getId())
+ + ".properties", new HashMap() ); //$NON-NLS-1$
exporterFactory.setProperties( props );
}
-
+
return factories;
- }
+ }
}
public static void saveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
List exporterFactories, Set enabledExporters, Set deletedExporterIds) {
-
-
+
+
List names = new ArrayList();
for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
ExporterFactory ef = (ExporterFactory) iter.next();
- configuration.setAttribute(getLaunchAttributePrefix(ef.getId()) + ".extension_id", ef.getExporterDefinition().getId());
+ configuration.setAttribute(getLaunchAttributePrefix(ef.getId()) + ".extension_id", ef.getExporterDefinition().getId()); //$NON-NLS-1$
boolean enabled = enabledExporters.contains( ef );
- String propertiesId = getLaunchAttributePrefix(ef.getId()) + ".properties";
+ String propertiesId = getLaunchAttributePrefix(ef.getId()) + ".properties"; //$NON-NLS-1$
names.add(ef.getId());
ef.setEnabled( configuration, enabled, false );
-
+
HashMap map = new HashMap(ef.getProperties());
- if(map.isEmpty()) {
+ if(map.isEmpty()) {
configuration.setAttribute( propertiesId, (Map)null );
} else {
configuration.setAttribute( propertiesId, map );
- }
+ }
}
-
+
deletedExporterIds.removeAll(names);
-
+
for (Iterator iterator = deletedExporterIds.iterator(); iterator.hasNext();) {
String deleted = (String) iterator.next();
-
+
configuration.setAttribute( getLaunchAttributePrefix( deleted ), (String)null);
- configuration.setAttribute(getLaunchAttributePrefix(deleted ) + ".extension_id", (String)null);
+ configuration.setAttribute(getLaunchAttributePrefix(deleted ) + ".extension_id", (String)null); //$NON-NLS-1$
configuration.setAttribute(getLaunchAttributePrefix(deleted), (String)null);
}
-
+
configuration.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, names);
}
public static void oldSaveExporterFactories(
ILaunchConfigurationWorkingCopy configuration,
List exporterFactories, List enabledExporters) {
-
-
+
+
for (Iterator iter = exporterFactories.iterator(); iter.hasNext();) {
ExporterFactory ef = (ExporterFactory) iter.next();
boolean enabled = enabledExporters.contains( ef );
- String propertiesId = ef.getId() + ".properties";
-
+ String propertiesId = ef.getId() + ".properties"; //$NON-NLS-1$
+
ef.setEnabled( configuration, enabled, true );
-
+
HashMap map = new HashMap(ef.getProperties());
- if(map.isEmpty()) {
+ if(map.isEmpty()) {
configuration.setAttribute( propertiesId, (Map)null );
} else {
configuration.setAttribute( propertiesId, map );
- }
+ }
}
}
-
+
private Path pathOrNull(String p) {
if(p==null || p.trim().length()==0) {
return null;
@@ -337,7 +340,7 @@
}
public List getExporterFactories() {
- return exporterFactories;
+ return exporterFactories;
}
public boolean detectManyToMany() {
@@ -348,7 +351,7 @@
return autoVersioning;
}
-
-
+
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterFactoryPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterFactoryPropertySource.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterFactoryPropertySource.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -66,7 +66,7 @@
public Object getPropertyValue(Object id) {
String propertyValue = factory.getPropertyValue( id.toString() );
if(propertyValue==null) {
- return "";
+ return ""; //$NON-NLS-1$
} else {
return propertyValue;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ExporterSettingsTab.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -63,6 +63,7 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -85,6 +86,7 @@
import org.eclipse.ui.views.properties.PropertySheetPage;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.ExtensionManager;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.model.impl.ExporterDefinition;
import org.hibernate.eclipse.console.model.impl.ExporterFactory;
@@ -97,7 +99,7 @@
private Button enableJDK5;
private Set selectedExporters;
-
+
private Set deletedExporterIds;
//private CheckboxTableViewer exporterTable;
@@ -114,7 +116,7 @@
/**
* Constructor for SampleNewWizardPage.
- *
+ *
* @param pageName
*/
public ExporterSettingsTab() {
@@ -125,7 +127,7 @@
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
- selectedExporters = new HashSet();
+ selectedExporters = new HashSet();
deletedExporterIds = new HashSet();
// ScrolledComposite scrolled = new ScrolledComposite(parent,
// SWT.V_SCROLL | SWT.H_SCROLL);
@@ -151,7 +153,7 @@
}
private void createExporterProperties(Composite parent) {
- Composite exportersComposite = createComposite( parent, "Properties:" );
+ Composite exportersComposite = createComposite( parent, HibernateConsoleMessages.ExporterSettingsTab_properties );
exportersComposite.setLayout( new GridLayout( 2, false ) );
@@ -160,29 +162,29 @@
exportersComposite.setLayoutData( gd );
Group gr = new Group(exportersComposite, SWT.NONE);
-
+
GridLayout gridLayout = new GridLayout();
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
-
- gr.setLayout( gridLayout );
+
+ gr.setLayout( gridLayout );
gd = new GridData( SWT.FILL, SWT.FILL, true, true );
- gd.verticalSpan = 2;
+ gd.verticalSpan = 2;
gr.setLayoutData( gd );
Control sheet = createPropertySheet( gr );
- gd = new GridData( SWT.FILL, SWT.FILL, true, true );
+ gd = new GridData( SWT.FILL, SWT.FILL, true, true );
sheet.setLayoutData( gd );
-
+
add = new Button( exportersComposite, SWT.PUSH );
add.setEnabled( false );
- add.setText( "Add..." );
+ add.setText( HibernateConsoleMessages.ExporterSettingsTab_add );
gd = new GridData( GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_BEGINNING );
gd.horizontalIndent = 5;
add.setLayoutData( gd );
add.addSelectionListener( new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
IStructuredSelection ss = (IStructuredSelection) getExporterTable().getSelection();
ExporterFactory ef = (ExporterFactory) ss.getFirstElement();
@@ -191,19 +193,19 @@
AddPropertyDialog dialog = new AddPropertyDialog(getShell(), ef);
if(dialog.open()==Dialog.OK) {
ef.setProperty( dialog.getPropertyName(), dialog.getPropertyValue() );
- dialogChanged();
+ dialogChanged();
refreshPropertySheet();
}
}
}
-
+
} );
remove = new Button( exportersComposite, SWT.PUSH );
- remove.setText( "Remove..." );
+ remove.setText( HibernateConsoleMessages.ExporterSettingsTab_remove );
remove.setEnabled( false );
remove.addSelectionListener( new SelectionAdapter() {
-
+
public void widgetSelected(SelectionEvent e) {
if(currentDescriptor!=null) {
IStructuredSelection ss = (IStructuredSelection) getExporterTable().getSelection();
@@ -211,11 +213,11 @@
ef.removeProperty( (String) currentDescriptor.getId() );
dialogChanged();
refreshPropertySheet();
- }
+ }
}
-
+
} );
-
+
gd = new GridData( GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_BEGINNING );
gd.horizontalIndent = 5;
@@ -224,16 +226,16 @@
}
public class MyPropertySheetEntry extends PropertySheetEntry {
-
+
public IPropertyDescriptor getMyDescriptor() {
return super.getDescriptor();
}
-
+
protected PropertySheetEntry createChildEntry() {
return new MyPropertySheetEntry();
}
}
-
+
// currently selected in the propertysheet
private IPropertyDescriptor currentDescriptor;
@@ -241,12 +243,12 @@
private ObservableFactoryList observableFactoryList;
-
-
+
+
private Control createPropertySheet(Composite exportersComposite) {
propertySheet = new PropertySheetPage() {
-
+
public void handleEntrySelection(ISelection selection) {
super.handleEntrySelection( selection );
IStructuredSelection iss = (IStructuredSelection) selection;
@@ -258,7 +260,7 @@
}
}
};
-
+
propertySheet.createControl( exportersComposite );
final PropertySheetEntry propertySheetEntry = new MyPropertySheetEntry();
@@ -283,7 +285,7 @@
} );
propertySheet.setRootEntry( propertySheetEntry );
// propertySheetEntry.setValues( new Object[] { this });
-
+
getExporterTable()
.addSelectionChangedListener( new ISelectionChangedListener() {
@@ -292,14 +294,14 @@
.getSelection();
if(s.isEmpty()) {
if(add!=null) add.setEnabled( false );
- if(remove!=null) remove.setEnabled( false );
-
+ if(remove!=null) remove.setEnabled( false );
+
propertySheetEntry.setValues(new Object[0]);
-
+
} else {
if(add!=null) add.setEnabled( true );
- if(remove!=null) remove.setEnabled( true );
-
+ if(remove!=null) remove.setEnabled( true );
+
ExporterFactory ep = (ExporterFactory) s
.getFirstElement();
propertySheetEntry.setValues( new Object[] { ep } );
@@ -313,18 +315,18 @@
}
private void createExporterTable(Composite parent) {
- exporterUpDown = new UpDownListComposite(parent, SWT.NONE, "Exporters:", true, new ExporterLabelProvider(), new ExporterContentProvider()) {
-
+ exporterUpDown = new UpDownListComposite(parent, SWT.NONE, HibernateConsoleMessages.ExporterSettingsTab_exporters, true, new ExporterLabelProvider(), new ExporterContentProvider()) {
+
protected Object[] handleAdd(int idx) {
-
+
switch (idx) {
case 0:
- Object[] selectExporters = selectExporters(getShell(), "Add exporter", "Select the exporter(s) you want to add");
+ Object[] selectExporters = selectExporters(getShell(), HibernateConsoleMessages.ExporterSettingsTab_add_exporter, HibernateConsoleMessages.ExporterSettingsTab_select_exporter_you_want_to_add);
for (int i = 0; i < selectExporters.length; i++) {
ExporterDefinition exporterDefinition = (ExporterDefinition) selectExporters[i];
- addDef(exporterDefinition);
+ addDef(exporterDefinition);
}
- return new Object[0];// { exporterFactory };
+ return new Object[0];// { exporterFactory };
case 1:
getExporterTable().setAllChecked( true );
break;
@@ -343,29 +345,29 @@
do {
duplicate = false;
initialCount++;
- Iterator iterator = observableFactoryList.getList().iterator();
+ Iterator iterator = observableFactoryList.getList().iterator();
while(iterator.hasNext()) {
- ExporterFactory def = (ExporterFactory) iterator.next();
- if(def.getId().equals(""+initialCount)) {
- duplicate = true;
- }
+ ExporterFactory def = (ExporterFactory) iterator.next();
+ if(def.getId().equals(""+initialCount)) { //$NON-NLS-1$
+ duplicate = true;
+ }
}
} while(duplicate);
-
- String initialName = "" + initialCount;
-
+
+ String initialName = "" + initialCount; //$NON-NLS-1$
+
ExporterFactory exporterFactory = new ExporterFactory( expDef, initialName );
observableFactoryList.add(exporterFactory);
selectedExporters.add(exporterFactory);
((CheckboxTableViewer)getTableViewer()).setChecked(exporterFactory, true);
-
+
}
protected void handleRemove() {
IStructuredSelection selection = (IStructuredSelection) getTableViewer().getSelection();
if (selection != null) {
int numSelected= selection.size();
-
+
Iterator iterator= selection.iterator();
while (iterator.hasNext() ) {
Object item= iterator.next();
@@ -374,9 +376,9 @@
}
//getTableViewer().setSelection(StructuredSelection.EMPTY);
listChanged();
- }
+ }
}
-
+
protected void moveSelectionDown() {
Table table = getTableViewer().getTable();
int indices[]= table.getSelectionIndices();
@@ -388,8 +390,8 @@
for (int i = indices.length - 1; i >= 0; i--) {
int index= indices[i];
if (index < max) {
- ExporterFactory data = (ExporterFactory) getTableViewer().getElementAt(index);
- observableFactoryList.moveTo(index + 1, (ExporterFactory)data);
+ ExporterFactory data = (ExporterFactory) getTableViewer().getElementAt(index);
+ observableFactoryList.moveTo(index + 1, (ExporterFactory)data);
newSelection[i]= index + 1;
}
}
@@ -404,8 +406,8 @@
for (int i = 0; i < indices.length; i++) {
int index= indices[i];
if (index > 0) {
- ExporterFactory data = (ExporterFactory) getTableViewer().getElementAt(index);
- observableFactoryList.moveTo(index - 1, (ExporterFactory)data);
+ ExporterFactory data = (ExporterFactory) getTableViewer().getElementAt(index);
+ observableFactoryList.moveTo(index - 1, (ExporterFactory)data);
newSelection[i]= index - 1;
}
}
@@ -414,7 +416,7 @@
}
protected String[] getAddButtonLabels() {
- return new String[] { "Add...", "Select all", "Deselect all" };
+ return new String[] { HibernateConsoleMessages.ExporterSettingsTab_add, HibernateConsoleMessages.ExporterSettingsTab_select_all, HibernateConsoleMessages.ExporterSettingsTab_deselect_all };
}
protected void listChanged() {
dialogChanged();
@@ -446,9 +448,9 @@
gd.horizontalAlignment = GridData.FILL;
exporterUpDown.setLayoutData( gd );
}
-
+
private void createOldExporterTable(Composite parent) {
- Composite exporterOptions = createComposite( parent, "Exporters:" );
+ Composite exporterOptions = createComposite( parent, HibernateConsoleMessages.ExporterSettingsTab_exporters );
GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true );
gd.minimumHeight = 100;
@@ -461,10 +463,10 @@
//setExporterTable(new CheckboxTableViewer( table ));
getExporterTable().setContentProvider( new ExporterContentProvider() );
getExporterTable().setLabelProvider( new ExporterLabelProvider() );
-
+
// exporterTable.getControl().setLayoutData(
// new GridData( SWT.FILL, SWT.FILL, true, true ) );
- getExporterTable().setColumnProperties( new String[] { "", "Description" } );
+ getExporterTable().setColumnProperties( new String[] { "", HibernateConsoleMessages.ExporterSettingsTab_description } ); //$NON-NLS-1$
getExporterTable().addCheckStateListener( new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
@@ -489,7 +491,7 @@
table.setLayoutData( gd );
selectAll = new Button( exporterOptions, SWT.PUSH );
- selectAll.setText( "Select All" );
+ selectAll.setText( HibernateConsoleMessages.ExporterSettingsTab_select_all );
selectAll.addSelectionListener( new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getExporterTable().setAllChecked( true );
@@ -502,7 +504,7 @@
selectAll.setLayoutData( gd );
deselectAll = new Button( exporterOptions, SWT.PUSH );
- deselectAll.setText( "Deselect All" );
+ deselectAll.setText( HibernateConsoleMessages.ExporterSettingsTab_deselect_all );
deselectAll.addSelectionListener( new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getExporterTable().setAllChecked( false );
@@ -529,16 +531,16 @@
}
};
Composite generalSettingsComposite = createComposite( parent,
- "General settings:" );
+ HibernateConsoleMessages.ExporterSettingsTab_general_settings );
generalSettingsComposite.setLayoutData( new GridData( SWT.BEGINNING,
SWT.BEGINNING, false, false ) );
enableJDK5 = new Button( generalSettingsComposite, SWT.CHECK );
- enableJDK5.setText( "Use Java 5 syntax" );
+ enableJDK5.setText( HibernateConsoleMessages.ExporterSettingsTab_use_java5_syntax );
enableJDK5.addSelectionListener( fieldlistener );
enableEJB3annotations = new Button( generalSettingsComposite, SWT.CHECK );
- enableEJB3annotations.setText( "Generate EJB3 annotations" );
+ enableEJB3annotations.setText( HibernateConsoleMessages.ExporterSettingsTab_generate_ejb3annotations );
enableEJB3annotations.addSelectionListener( fieldlistener );
}
@@ -557,40 +559,40 @@
this.viewer = (AbstractTableViewer) viewer;
ObservableFactoryList ol = (ObservableFactoryList) oldInput;
ObservableFactoryList newList = (ObservableFactoryList) newInput;
-
+
if(ol!=null) {
ol.removePropertyChangeListener(this);
}
-
+
if(newList!=null) {
newList.addPropertyChangeListener(this);
}
}
public void propertyChange(PropertyChangeEvent evt) {
-
- if("addElement".equals(evt.getPropertyName())) {
+
+ if("addElement".equals(evt.getPropertyName())) { //$NON-NLS-1$
viewer.add(evt.getNewValue());
}
-
- if("removeElement".equals(evt.getPropertyName())) {
+
+ if("removeElement".equals(evt.getPropertyName())) { //$NON-NLS-1$
viewer.remove(evt.getOldValue());
}
-
- if("insertElement".equals(evt.getPropertyName())) {
+
+ if("insertElement".equals(evt.getPropertyName())) { //$NON-NLS-1$
viewer.insert(evt.getNewValue(), ((Integer)evt.getOldValue()).intValue());
}
}
}
-
- // Complete hack to get table to work with arbitrary exporters quickly.
+
+ // Complete hack to get table to work with arbitrary exporters quickly.
private class ObservableFactoryList {
-
+
List underlyingList = new ArrayList();
-
+
PropertyChangeSupport pcs = new PropertyChangeSupport(this);
-
+
public ObservableFactoryList(List exporterFactories) {
underlyingList = exporterFactories;
}
@@ -599,14 +601,14 @@
underlyingList.remove((ExporterFactory) data);
remove(data);
underlyingList.add(i, data);
- pcs.firePropertyChange("insertElement", new Integer(i), data);
-
+ pcs.firePropertyChange("insertElement", new Integer(i), data); //$NON-NLS-1$
+
}
void addPropertyChangeListener(PropertyChangeListener pcl) {
- pcs.addPropertyChangeListener(pcl);
+ pcs.addPropertyChangeListener(pcl);
}
-
+
public List getList() {
return Collections.unmodifiableList(underlyingList);
}
@@ -614,20 +616,20 @@
void removePropertyChangeListener(PropertyChangeListener pcl) {
pcs.removePropertyChangeListener(pcl);
}
-
+
boolean add(ExporterFactory o) {
boolean changed = underlyingList.add(o);
- pcs.firePropertyChange("addElement", null, o);
+ pcs.firePropertyChange("addElement", null, o); //$NON-NLS-1$
return changed;
}
boolean remove(ExporterFactory o) {
boolean changed = underlyingList.remove(o);
- pcs.firePropertyChange("removeElement", o, null);
+ pcs.firePropertyChange("removeElement", o, null); //$NON-NLS-1$
return changed;
}
-
-
+
+
}
static private class ExporterLabelProvider implements ITableLabelProvider, ILabelProvider {
@@ -650,7 +652,7 @@
return ef.getExporterDefinition();
} else {
return (ExporterDefinition) element;
- }
+ }
}
public String getColumnText(Object element, int columnIndex) {
@@ -705,39 +707,39 @@
// ...getConfigurationName().length()==0;
if ( !configSelected ) {
- updateStatus( "Console configuration must be specified" );
+ updateStatus( HibernateConsoleMessages.ExporterSettingsTab_console_configuration_must_be_specified );
return;
}
if ( selectedExporters.size() == 0 ) {
- updateStatus( "At least one exporter option must be selected" );
+ updateStatus( HibernateConsoleMessages.ExporterSettingsTab_at_least_one_exporter_option_must_be_selected );
return;
}
-
-
+
+
// hard-coded checks: this should be delegated to extension point that knows about the different exporters.
Iterator iterator = observableFactoryList.getList().iterator();
while (iterator.hasNext()) {
ExporterFactory ef = (ExporterFactory) iterator.next();
- String str = (String) ef.getProperties().get("outputdir");
+ String str = (String) ef.getProperties().get("outputdir"); //$NON-NLS-1$
String msg = null;
if(str!=null) {
- msg = PathHelper.checkDirectory(str, "Output directory for " + ef.getExporterDefinition().getDescription(), false);
+ msg = PathHelper.checkDirectory(str, HibernateConsoleMessages.ExporterSettingsTab_output_directory_for + ef.getExporterDefinition().getDescription(), false);
if(msg!=null) {
updateStatus(msg);
return;
}
}
- str = (String) ef.getProperties().get("template_path");
- if(str!=null) {
- msg = PathHelper.checkDirectory(str, "Template directory for " + ef.getExporterDefinition().getDescription(), true);
+ str = (String) ef.getProperties().get("template_path"); //$NON-NLS-1$
+ if(str!=null) {
+ msg = PathHelper.checkDirectory(str, HibernateConsoleMessages.ExporterSettingsTab_template_directory_for + ef.getExporterDefinition().getDescription(), true);
if(msg!=null) {
updateStatus(msg);
return;
}
}
-
+
}
updateStatus( null );
}
@@ -750,15 +752,16 @@
if ( resType == IResource.PROJECT || resType == IResource.FOLDER ) {
IProject proj = res.getProject();
if ( !proj.isOpen() ) {
- return "Project for " + name + " is closed";
+ String out = NLS.bind(HibernateConsoleMessages.ExporterSettingsTab_project_for_is_closed, name);
+ return out;
}
}
else {
- return name + " has to be a folder or project";
+ return name + HibernateConsoleMessages.ExporterSettingsTab_has_to_be_folder_or_project;
}
}
else {
- return name + " does not exist";
+ return name + HibernateConsoleMessages.ExporterSettingsTab_does_not_exist;
}
return null;
}
@@ -772,11 +775,11 @@
return null;
}
else {
- return name + " must be a file";
+ return name + HibernateConsoleMessages.ExporterSettingsTab_must_be_file;
}
}
else {
- return name + " does not exist";
+ return name + HibernateConsoleMessages.ExporterSettingsTab_does_not_exist;
}
}
@@ -824,7 +827,7 @@
}
refreshPropertySheet();
-
+
dialogChanged();
}
@@ -832,7 +835,7 @@
HibernateConsolePlugin
.getDefault()
.logErrorMessage(
- "Problem when reading hibernate tools launch configuration",
+ HibernateConsoleMessages.ExporterSettingsTab_problem_when_reading_hibernate_tools_launch_configuration,
ce );
}
}
@@ -850,14 +853,14 @@
List exporterFactories = ((ObservableFactoryList)getExporterTable().getInput()).getList();
ExporterAttributes.saveExporterFactories(configuration, exporterFactories, selectedExporters, deletedExporterIds);
-
+
deletedExporterIds.clear();
}
-
+
public String getName() {
- return "Exporters";
+ return HibernateConsoleMessages.ExporterSettingsTab_exporters_2;
}
public Image getImage() {
@@ -872,13 +875,13 @@
ILabelProvider labelProvider= new ExporterLabelProvider();
ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, labelProvider);
dialog.setTitle(title);
- dialog.setMessage(description);
+ dialog.setMessage(description);
dialog.setElements(ExtensionManager.findExporterDefinitionsAsMap().values().toArray());
dialog.setMultipleSelection(true);
-
- if (dialog.open() == Window.OK) {
+
+ if (dialog.open() == Window.OK) {
return dialog.getResult();
- } else {
+ } else {
return new ExporterDefinition[0];
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/GeneralExceptionStatusHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/GeneralExceptionStatusHandler.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/GeneralExceptionStatusHandler.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -24,6 +24,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.IStatusHandler;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
public class GeneralExceptionStatusHandler implements IStatusHandler {
@@ -32,8 +33,8 @@
throws CoreException {
final boolean[] result = new boolean[1];
HibernateConsolePlugin.getDefault().log( status );
- HibernateConsolePlugin.openError(null, "Generating code", "Exception while generating code", status.getException(), HibernateConsolePlugin.PERFORM_SYNC_EXEC);
- return new Boolean(result[0]);
+ HibernateConsolePlugin.openError(null, HibernateConsoleMessages.GeneralExceptionStatusHandler_generating_code, HibernateConsoleMessages.GeneralExceptionStatusHandler_exception_while_generating_code, status.getException(), HibernateConsolePlugin.PERFORM_SYNC_EXEC);
+ return new Boolean(result[0]);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/HibernateLaunchConstants.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,24 +42,24 @@
public class HibernateLaunchConstants
{
- public static final String ATTR_PREFIX = "org.hibernate.tools.";
+ public static final String ATTR_PREFIX = "org.hibernate.tools."; //$NON-NLS-1$
// attribute to list of id for exporters configured in a specific launchconfig.
- public static final String ATTR_EXPORTERS = ATTR_PREFIX + "exporters";
+ public static final String ATTR_EXPORTERS = ATTR_PREFIX + "exporters"; //$NON-NLS-1$
- public static final String ATTR_CONSOLE_CONFIGURATION_NAME = ATTR_PREFIX + "configurationname";
- public static final String ATTR_OUTPUT_DIR = ATTR_PREFIX + "outputdir";
- public static final String ATTR_REVERSE_ENGINEER = ATTR_PREFIX + "schema2hbm";
- public static final String ATTR_REVERSE_ENGINEER_SETTINGS = ATTR_PREFIX + "revengfile";
- public static final String ATTR_REVERSE_ENGINEER_STRATEGY = ATTR_PREFIX + "revengstrategy";
- public static final String ATTR_USE_OWN_TEMPLATES = ATTR_PREFIX + "useOwnTemplates";
- public static final String ATTR_ENABLE_EJB3_ANNOTATIONS = ATTR_PREFIX + "ejb3";
- public static final String ATTR_ENABLE_JDK5 = ATTR_PREFIX + "jdk5";
- public static final String ATTR_PACKAGE_NAME = ATTR_PREFIX + "package";
- public static final String ATTR_ENABLE_TEMPLATE_DIR = ATTR_PREFIX + "templatepathenabled";
- public static final String ATTR_TEMPLATE_DIR = ATTR_PREFIX + "templatepath";
- public static final String ATTR_PREFER_BASIC_COMPOSITE_IDS = ATTR_PREFIX + "prefercompositeids";
- public static final String ATTR_AUTOMATIC_MANY_TO_MANY = ATTR_PREFIX + "reveng.detect_many_to_many";
- public static final String ATTR_AUTOMATIC_VERSIONING = ATTR_PREFIX + "reveng.detect_optimistc_lock";
+ public static final String ATTR_CONSOLE_CONFIGURATION_NAME = ATTR_PREFIX + "configurationname"; //$NON-NLS-1$
+ public static final String ATTR_OUTPUT_DIR = ATTR_PREFIX + "outputdir"; //$NON-NLS-1$
+ public static final String ATTR_REVERSE_ENGINEER = ATTR_PREFIX + "schema2hbm"; //$NON-NLS-1$
+ public static final String ATTR_REVERSE_ENGINEER_SETTINGS = ATTR_PREFIX + "revengfile"; //$NON-NLS-1$
+ public static final String ATTR_REVERSE_ENGINEER_STRATEGY = ATTR_PREFIX + "revengstrategy"; //$NON-NLS-1$
+ public static final String ATTR_USE_OWN_TEMPLATES = ATTR_PREFIX + "useOwnTemplates"; //$NON-NLS-1$
+ public static final String ATTR_ENABLE_EJB3_ANNOTATIONS = ATTR_PREFIX + "ejb3"; //$NON-NLS-1$
+ public static final String ATTR_ENABLE_JDK5 = ATTR_PREFIX + "jdk5"; //$NON-NLS-1$
+ public static final String ATTR_PACKAGE_NAME = ATTR_PREFIX + "package"; //$NON-NLS-1$
+ public static final String ATTR_ENABLE_TEMPLATE_DIR = ATTR_PREFIX + "templatepathenabled"; //$NON-NLS-1$
+ public static final String ATTR_TEMPLATE_DIR = ATTR_PREFIX + "templatepath"; //$NON-NLS-1$
+ public static final String ATTR_PREFER_BASIC_COMPOSITE_IDS = ATTR_PREFIX + "prefercompositeids"; //$NON-NLS-1$
+ public static final String ATTR_AUTOMATIC_MANY_TO_MANY = ATTR_PREFIX + "reveng.detect_many_to_many"; //$NON-NLS-1$
+ public static final String ATTR_AUTOMATIC_VERSIONING = ATTR_PREFIX + "reveng.detect_optimistc_lock"; //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ICodeGenerationLaunchConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ICodeGenerationLaunchConstants.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ICodeGenerationLaunchConstants.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -2,7 +2,7 @@
public interface ICodeGenerationLaunchConstants {
- static final String CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID = "org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType";
+ static final String CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID = "org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType"; //$NON-NLS-1$
static final int ERR_UNSPECIFIED_CONSOLE_CONFIGURATION = 1000;
static final int ERR_CONSOLE_CONFIGURATION_NOTFOUND = 1001;
static final int ERR_OUTPUT_PATH_NOTFOUND = 1002;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/IConsoleConfigurationLaunchConstants.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/IConsoleConfigurationLaunchConstants.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/IConsoleConfigurationLaunchConstants.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -4,14 +4,14 @@
public interface IConsoleConfigurationLaunchConstants {
- public static final String ID = "org.hibernate.eclipse.launch";
- public static final String NAMING_STRATEGY = ID + "NAMING_STRATEGY";
- public static final String ENTITY_RESOLVER = ID + "ENTITY_RESOLVER";
- public static final String PROPERTY_FILE = ID + ".PROPERTY_FILE";
- public static final String CFG_XML_FILE = ID + ".CFG_XML_FILE";
- public static final String PERSISTENCE_UNIT_NAME = ID + ".PERSISTENCE_UNIT_NAME";
- public static final String CONFIGURATION_FACTORY = ID + ".CONFIGURATION_FACTORY";
- public static final String FILE_MAPPINGS = ID + ".FILE_MAPPINGS";
+ public static final String ID = "org.hibernate.eclipse.launch"; //$NON-NLS-1$
+ public static final String NAMING_STRATEGY = ID + "NAMING_STRATEGY"; //$NON-NLS-1$
+ public static final String ENTITY_RESOLVER = ID + "ENTITY_RESOLVER"; //$NON-NLS-1$
+ public static final String PROPERTY_FILE = ID + ".PROPERTY_FILE"; //$NON-NLS-1$
+ public static final String CFG_XML_FILE = ID + ".CFG_XML_FILE"; //$NON-NLS-1$
+ public static final String PERSISTENCE_UNIT_NAME = ID + ".PERSISTENCE_UNIT_NAME"; //$NON-NLS-1$
+ public static final String CONFIGURATION_FACTORY = ID + ".CONFIGURATION_FACTORY"; //$NON-NLS-1$
+ public static final String FILE_MAPPINGS = ID + ".FILE_MAPPINGS"; //$NON-NLS-1$
public static final String PROJECT_NAME = IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/LaunchMenuDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/LaunchMenuDelegate.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/LaunchMenuDelegate.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -36,7 +36,7 @@
* Creates the action delegate
*/
public LaunchMenuDelegate() {
- super("org.hibernate.eclipse.launch.CodeGenerationLaunchGroup");
+ super("org.hibernate.eclipse.launch.CodeGenerationLaunchGroup"); //$NON-NLS-1$
}
/* (non-Javadoc)
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/OpenHibernateToolsConfigurations.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/OpenHibernateToolsConfigurations.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/OpenHibernateToolsConfigurations.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -29,6 +29,6 @@
public class OpenHibernateToolsConfigurations extends OpenLaunchDialogAction {
public OpenHibernateToolsConfigurations() {
- super("org.hibernate.eclipse.launch.CodeGenerationLaunchGroup");
+ super("org.hibernate.eclipse.launch.CodeGenerationLaunchGroup"); //$NON-NLS-1$
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/PathHelper.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -12,6 +12,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
+import org.eclipse.osgi.util.NLS;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
// TODO: move to internal.
public class PathHelper {
@@ -27,46 +29,46 @@
}
} else {
return PathHelper.getLocation( member ).toOSString();
- }
+ }
}
public static IResource findMember(IWorkspaceRoot root, String path) {
Path pathOrNull = PathHelper.pathOrNull(path);
if(pathOrNull==null) return null;
-
+
IResource findMember = root.findMember(pathOrNull);
if(findMember==null) {
IContainer[] findContainersForLocation = root.findContainersForLocation(pathOrNull);
if(findContainersForLocation.length>0) {
findMember = findContainersForLocation[0];
}
- }
+ }
return findMember;
}
- public static IPath getLocation(final IResource resource) {
- if (resource.getRawLocation() == null) {
- return resource.getLocation();
- }
- else return resource.getRawLocation();
+ public static IPath getLocation(final IResource resource) {
+ if (resource.getRawLocation() == null) {
+ return resource.getLocation();
+ }
+ else return resource.getRawLocation();
}
-
+
static private String resolve(String expression) {
if(expression==null) return null;
IStringVariableManager variableManager = VariablesPlugin.getDefault().getStringVariableManager();
-
+
try {
return variableManager.performStringSubstitution(expression, false);
} catch (CoreException e) {
return expression;
}
}
-
+
public static Path pathOrNull(String p) {
return pathOrNull(p, false);
}
-
+
public static Path pathOrNull(String p, boolean resolveVariables) {
if(resolveVariables && p!=null) {
p = resolve(p);
@@ -77,11 +79,11 @@
return new Path(p);
}
}
-
+
/**
* Checks if directory exists.
* Handles variables replacement too.
- *
+ *
* @param strpath
* @param name
* @param checkFilesystem
@@ -94,31 +96,35 @@
manager.validateStringVariables(strpath);
}
catch (CoreException e) {
- return name + " has invalid variable references [" + e.getMessage() + "]";
+ String out = NLS.bind(HibernateConsoleMessages.PathHelper_has_invalid_variable_references, name, e.getMessage());
+ return out;
}
- }
-
+ }
+
IPath path = pathOrNull(resolve(strpath));
-
+
if (checkFilesystem) {
if (path != null && new File(path.toOSString()).exists()) {
return null;
}
}
-
+
IResource res= ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (res != null) {
int resType= res.getType();
if (resType == IResource.PROJECT || resType == IResource.FOLDER) {
IProject proj= res.getProject();
if (!proj.isOpen() ) {
- return "Project for " + name + " is closed [" + path + "]";
- }
+ String out = NLS.bind(HibernateConsoleMessages.PathHelper_project_for_is_closed, name, path);
+ return out;
+ }
} else {
- return name + " has to be a folder or project [" + path + "]";
+ String out = NLS.bind(HibernateConsoleMessages.PathHelper_has_to_be_folder_or_project, name, path);
+ return out;
}
- } else {
- return name + " does not exist [" + path + "]";
+ } else {
+ String out = NLS.bind(HibernateConsoleMessages.PathHelper_does_not_exist, name, path);
+ return out;
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -42,6 +42,7 @@
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
@@ -59,33 +60,33 @@
*
*/
public class HibernateRefactoringUtil {
-
- private static final String ERROR_MESS = "Error during refactoring";
-
+
+ private static final String ERROR_MESS = HibernateConsoleMessages.HibernateRefactoringUtil_error_during_refactoring;
+
private static String[] pathKeys = new String[]{
IConsoleConfigurationLaunchConstants.CFG_XML_FILE,
IConsoleConfigurationLaunchConstants.PROPERTY_FILE,
HibernateLaunchConstants.ATTR_TEMPLATE_DIR,
HibernateLaunchConstants.ATTR_OUTPUT_DIR,
- HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS,
+ HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS,
};
-
+
private static String[] pathListKeys = new String[]{
- IConsoleConfigurationLaunchConstants.FILE_MAPPINGS,
+ IConsoleConfigurationLaunchConstants.FILE_MAPPINGS,
};
-
+
public static boolean isConfigurationAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
return isAttributesAffected(config, oldPath) || isClassPathAffected(config, oldPath);
}
-
+
private static boolean isAttributesAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
String attrib = null;
for (int i = 0; i < pathKeys.length; i++) {
attrib = config.getAttribute(pathKeys[i], (String)null);
- if (isAttributeChanged(attrib, oldPath))
- return true;
+ if (isAttributeChanged(attrib, oldPath))
+ return true;
}
-
+
for (int i = 0; i < pathListKeys.length; i++) {
List<String> list = config.getAttribute(pathListKeys[i], Collections.EMPTY_LIST);
List<String> newMappings = new ArrayList<String>();
@@ -100,7 +101,7 @@
}
return false;
}
-
+
private static boolean isClassPathAffected(ILaunchConfiguration config, IPath oldPath) throws CoreException{
IRuntimeClasspathEntry[] entries;
try {
@@ -110,9 +111,9 @@
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
return false;
- }
+ }
}
-
+
public static boolean isRuntimeClassPathEntriesAffected(IRuntimeClasspathEntry[] entries, IPath oldPath){
String attrib = null;
String projName = null;
@@ -128,16 +129,16 @@
}
return false;
}
-
+
public static boolean isAttributeChanged(String attrib, IPath path){
if (attrib == null || path == null) return false;
return path.isPrefixOf(new Path(attrib));
}
-
+
public static ILaunchConfiguration updateLaunchConfig(ILaunchConfiguration config, IPath oldPath, IPath newPath) throws CoreException{
final ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
updateAttributes(oldPath, newPath, wc);
-
+
//classpath
try {
IRuntimeClasspathEntry[] entries = JavaRuntime.computeUnresolvedRuntimeClasspath(config);
@@ -149,15 +150,15 @@
catch (CoreException e) {
HibernateConsolePlugin.getDefault().log( e );
}
-
- //JavaMigrationDelegate.updateResourceMapping(wc);
+
+ //JavaMigrationDelegate.updateResourceMapping(wc);
if (wc.isDirty()) {
return wc.doSave();
} else {
return config;
}
}
-
+
/*
* Use IRuntimeClasspathEntry[] and oldMementos instead of entries[i].getMemento(), because
* when resource renamed instead of internalArchive you can have externalArchive.
@@ -185,13 +186,13 @@
newMementos.add(memento);
} else {
newMementos.add(entries[i].getMemento());
- }
+ }
}
return isChanged;
}
-
+
private static String getUpdatedMemento(String memento, IPath newPath, IPath oldPath) throws CoreException{
- String error_mess = "Error occured while updating classpath.";
+ String error_mess = HibernateConsoleMessages.HibernateRefactoringUtil_error_occured_while_updating_classpath;
DocumentBuilder builder;
try {
builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
@@ -202,22 +203,22 @@
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.transform(domSource, result);
-
- org.w3c.dom.NodeList nodeList = doc.getElementsByTagName("runtimeClasspathEntry");
-
+
+ org.w3c.dom.NodeList nodeList = doc.getElementsByTagName("runtimeClasspathEntry"); //$NON-NLS-1$
+
for (int i = 0; i < nodeList.getLength(); i++) {
org.w3c.dom.Node node = nodeList.item(i);
NamedNodeMap map = node.getAttributes();
Node changedNode = null;
//if (entry instanceof RuntimeClasspathEntry){
- String[] attrNames = new String[]{"projectName", "externalArchive", "internalArchive",
- "containerPath", "javaProject"};
+ String[] attrNames = new String[]{"projectName", "externalArchive", "internalArchive", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "containerPath", "javaProject"}; //$NON-NLS-1$ //$NON-NLS-2$
for (int j = 0; j < attrNames.length; j++) {
changedNode = map.getNamedItem(attrNames[j]);
if (changedNode != null){
Path attrPath = new Path(changedNode.getNodeValue());
if (oldPath.isPrefixOf(attrPath)){
- if (attrNames[j].equals("projectName") || attrNames[j].equals("javaProject")){
+ if (attrNames[j].equals("projectName") || attrNames[j].equals("javaProject")){ //$NON-NLS-1$//$NON-NLS-2$
changedNode.setNodeValue(newPath.lastSegment());
} else {
changedNode.setNodeValue(newPath.toString());
@@ -229,11 +230,11 @@
if (node.getNodeType() == Node.ELEMENT_NODE)
{
Element element = (Element) node;
- NodeList mementoList = element.getElementsByTagName("memento");
+ NodeList mementoList = element.getElementsByTagName("memento"); //$NON-NLS-1$
for(int j=0; j < mementoList.getLength(); j++)
{
map = mementoList.item(j).getAttributes();
- changedNode = map.getNamedItem("project");
+ changedNode = map.getNamedItem("project"); //$NON-NLS-1$
if (changedNode != null){
Path attrPath = new Path(changedNode.getNodeValue());
if (oldPath.isPrefixOf(attrPath)){
@@ -251,20 +252,20 @@
transformer = tf.newTransformer();
transformer.transform(domSource, result);
return writer.toString();*/
-
+
String newMemento = DebugPlugin.serializeDocument(doc);
return newMemento;
} catch (ParserConfigurationException e) {
- IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
throw new CoreException(status);
} catch (SAXException e) {
- IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
throw new CoreException(status);
} catch (IOException e) {
- IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
throw new CoreException(status);
} catch (TransformerException e) {
- IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
+ IStatus status = new Status(IStatus.ERROR, HibernateConsolePlugin.ID, error_mess, e);
throw new CoreException(status);
}
}
@@ -279,7 +280,7 @@
wc.setAttribute(pathKeys[i], attrib);
}
}
-
+
boolean isChanged = false;
for (int i = 0; i < pathListKeys.length; i++) {
List<String> list = wc.getAttribute(pathListKeys[i], Collections.EMPTY_LIST);
@@ -297,10 +298,10 @@
if (isChanged) wc.setAttribute(pathListKeys[i], newMappings);
}
}
-
+
private static String getUpdatedPath(String attrib, IPath oldPath, IPath newPath){
IPath attribPath = new Path(attrib);
- IPath newAttribPath = new Path("/");
+ IPath newAttribPath = new Path("/"); //$NON-NLS-1$
for (int j = 0; j < attribPath.segmentCount(); j++){
if (!oldPath.isPrefixOf(attribPath.removeFirstSegments(j))){
//add prefix
@@ -314,7 +315,7 @@
}
return newAttribPath.toOSString();
}
-
+
public static ILaunchConfiguration[] getAffectedLaunchConfigurations(IPath path){
ILaunchConfiguration[] configs = null;
try {
@@ -330,10 +331,10 @@
configs = new ILaunchConfiguration[0];
HibernateConsolePlugin.getDefault().logErrorMessage( ERROR_MESS, e );
}
-
+
return configs;
}
-
+
/**
* @param changes - List of Change objects
* @return
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -22,17 +22,18 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
/**
* @author Dmitry Geraskov
*
*/
public class LaunchConfigurationResourceNameChange extends Change {
-
+
private ILaunchConfiguration fLaunchConfiguration;
private IPath fOldPath;
private IPath fNewPath;
-
+
/**
* LaunchConfigurationResourceMoveChange constructor.
* @param launchConfiguration the launch configuration to modify
@@ -56,7 +57,7 @@
* @see org.eclipse.ltk.core.refactoring.Change#getName()
*/
public String getName() {
- return "Update resource path in launch configuration " + fLaunchConfiguration.getName();
+ return HibernateConsoleMessages.LaunchConfigurationResourceNameChange_update_resource_path_in_launch_cfg + fLaunchConfiguration.getName();
}
/* (non-Javadoc)
@@ -84,17 +85,17 @@
int matchSegment = oldConfigLocation.matchingFirstSegments(rootLoacation);
IPath relativePath = oldConfigLocation.removeFirstSegments(matchSegment);
relativePath = relativePath.setDevice(null).makeAbsolute();
-
+
if (HibernateRefactoringUtil.isAttributeChanged(relativePath.toOSString(), fOldPath)){
matchSegment = relativePath.matchingFirstSegments(fOldPath);
IPath newLaunchPath = fNewPath.append(relativePath.removeFirstSegments(matchSegment));
IFile[] files = root.findFilesForLocation(rootLoacation.append(newLaunchPath));
if (files.length > 0){
fLaunchConfiguration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(files[0]);
- }
- }
+ }
+ }
}
- fLaunchConfiguration = HibernateRefactoringUtil.updateLaunchConfig(fLaunchConfiguration, fOldPath, fNewPath);
+ fLaunchConfiguration = HibernateRefactoringUtil.updateLaunchConfig(fLaunchConfiguration, fOldPath, fNewPath);
return new LaunchConfigurationResourceNameChange(fLaunchConfiguration, fNewPath, fOldPath);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/MoveResourceParticipant.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -12,9 +12,10 @@
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
public class MoveResourceParticipant extends MoveParticipant {
-
+
private IResource fResource;
public RefactoringStatus checkConditions(IProgressMonitor pm,
@@ -25,8 +26,8 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedLaunchConfigurations(fResource.getFullPath());
-
- List<Change> changes = new ArrayList<Change>();
+
+ List<Change> changes = new ArrayList<Change>();
LaunchConfigurationResourceNameChange change = null;
for (int i= 0; i < configs.length; i++) {
change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(), ((IResource)getArguments().getDestination()).getFullPath().append(fResource.getName()));
@@ -37,10 +38,10 @@
}
public String getName() {
- return "Launch Configurations updates";
+ return HibernateConsoleMessages.MoveResourceParticipant_launch_configurations_updates;
}
- protected boolean initialize(Object element) {
+ protected boolean initialize(Object element) {
fResource = (IResource) element;
return true;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/RenameResourceParticipant.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -22,13 +22,14 @@
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
/**
* @author Dmitry Geraskov
*
*/
public class RenameResourceParticipant extends RenameParticipant {
-
+
private IResource fResource;
/* (non-Javadoc)
@@ -45,31 +46,31 @@
public Change createChange(IProgressMonitor pm) throws CoreException,
OperationCanceledException {
ILaunchConfiguration[] configs = HibernateRefactoringUtil.getAffectedLaunchConfigurations(fResource.getFullPath());
-
- List<Change> changes = new ArrayList<Change>();
+
+ List<Change> changes = new ArrayList<Change>();
LaunchConfigurationResourceNameChange change = null;
for (int i= 0; i < configs.length; i++) {
- change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(),
+ change = new LaunchConfigurationResourceNameChange(configs[i], fResource.getFullPath(),
fResource.getParent().getFullPath().append(getArguments().getNewName()));
changes.add(change);
}
return HibernateRefactoringUtil.createChangesFromList(changes, getName());
}
-
-
-
+
+
+
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#getName()
*/
public String getName() {
- return "Launch Configurations updates";
+ return HibernateConsoleMessages.RenameResourceParticipant_launch_configurations_updates;
}
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant#initialize(java.lang.Object)
*/
- protected boolean initialize(Object element) {
+ protected boolean initialize(Object element) {
fResource = (IResource) element;
return true;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java 2008-06-10 12:21:54 UTC (rev 8676)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/nature/HibernateNature.java 2008-06-10 13:18:48 UTC (rev 8677)
@@ -48,19 +48,20 @@
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.eclipse.builder.HibernateBuilder;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.Table;
import org.osgi.service.prefs.Preferences;
public class HibernateNature implements IProjectNature {
- final public static String ID = "org.hibernate.eclipse.console.hibernateNature";
-
+ final public static String ID = "org.hibernate.eclipse.console.hibernateNature"; //$NON-NLS-1$
+
private IProject project;
public void configure() throws CoreException {
//HibernateConsolePlugin.getDefault().log("Configuring " + project + " as a Hibernate project");
-
+
IProjectDescription desc = project.getDescription();
ICommand[] commands = desc.getBuildSpec();
boolean found = false;
@@ -71,7 +72,7 @@
break;
}
}
- if (!found) {
+ if (!found) {
//add builder to project
ICommand command = desc.newCommand();
command.setBuilderName(HibernateBuilder.BUILDER_ID);
@@ -91,38 +92,38 @@
return project;
}
- public void setProject(IProject project) {
+ public void setProject(IProject project) {
this.project = project;
}
public ConsoleConfiguration getDefaultConsoleConfiguration() {
String cfg = getDefaultConsoleConfigurationName();
ConsoleConfiguration configuration = KnownConfigurations.getInstance().find(cfg);
- return configuration;
+ return configuration;
}
-
+
public String getDefaultConsoleConfigurationName() {
IJavaProject prj = JavaCore.create(project);
IScopeContext scope = new ProjectScope(prj.getProject() );
-
- Preferences node = scope.getNode("org.hibernate.eclipse.console");
-
+
+ Preferences node = scope.getNode("org.hibernate.eclipse.console"); //$NON-NLS-1$
+
if(node!=null) {
- String cfg = node.get("default.configuration", prj.getProject().getName() );
- return cfg;
+ String cfg = node.get("default.configuration", prj.getProject().getName() ); //$NON-NLS-1$
+ return cfg;
} else {
return null;
}
}
-
+
List tables = null;
private ReadDatabaseMetaData job;
-
+
public List getTables() {
ConsoleConfiguration ccfg = getDefaultConsoleConfiguration();
if(ccfg==null) return Collections.EMPTY_LIST;
-
+
if(tables!=null) {
return tables;
} else {
@@ -136,21 +137,21 @@
return Collections.EMPTY_LIST;
}
}
-
+
public class ReadDatabaseMetaData extends Job {
-
+
private ConsoleConfiguration ccfg;
public ReadDatabaseMetaData(ConsoleConfiguration ccfg) {
- super("Reading database metadata for " + getProject().getName() );
+ super(HibernateConsoleMessages.HibernateNature_reading_database_metadata_for + getProject().getName() );
this.ccfg = ccfg;
}
-
+
protected IStatus run(IProgressMonitor monitor) {
Configuration cfg = ccfg.buildWith(null, false);
final JDBCMetaDataConfiguration jcfg = new JDBCMetaDataConfiguration();
jcfg.setProperties(cfg.getProperties());
- monitor.beginTask("Reading database metadata", IProgressMonitor.UNKNOWN);
+ monitor.beginTask(HibernateConsoleMessages.HibernateNature_reading_database_metadata, IProgressMonitor.UNKNOWN);
try {
ccfg.execute(new Command() {
public Object execute() {
@@ -158,24 +159,24 @@
return null;
}
});
-
-
+
+
List result = new ArrayList();
Iterator tabs = jcfg.getTableMappings();
-
+
while (tabs.hasNext() ) {
Table table = (Table) tabs.next();
monitor.subTask(table.getName() );
result.add(table);
}
-
+
tables = result;
monitor.done();
return Status.OK_STATUS;
} catch(Throwable t) {
- return new Status(IStatus.ERROR, HibernateConsolePlugin.ID, 1, "Error while performing background reading of database schema", t);
+ return new Status(IStatus.ERROR, HibernateConsolePlugin.ID, 1, HibernateConsoleMessages.HibernateNature_error_while_performing_background_reading_of_database_schema, t);
}
- }
+ }
}
@@ -191,7 +192,7 @@
return result;
}
- public Table getTable(TableIdentifier nearestTableName) {
+ public Table getTable(TableIdentifier nearestTableName) {
// TODO: can be made MUCH more efficient with proper indexing of the tables.
// TODO: handle catalog/schema properly
Iterator tableMappings = getTables().iterator();
@@ -203,7 +204,7 @@
}
return null;
}
-
+
/** return HibernateNature or null for a project **/
public static HibernateNature getHibernateNature(IJavaProject project) {
try {
@@ -213,9 +214,9 @@
}
}
catch (CoreException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage( "Exception when trying to locate Hibernate Nature", e );
- }
+ HibernateConsolePlugin.getDefault().logErrorMessage( HibernateConsoleMessages.HibernateNature_exception_when_trying_to_locate_hibernate_nature, e );
+ }
return null;
- }
+ }
}
17 years, 10 months
JBoss Tools SVN: r8676 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-06-10 08:21:54 -0400 (Tue, 10 Jun 2008)
New Revision: 8676
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
Log:
JBIDE-1189 hanglers package added to Provide-Package again
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2008-06-10 12:16:13 UTC (rev 8675)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2008-06-10 12:21:54 UTC (rev 8676)
@@ -10,6 +10,7 @@
Provide-Package: org.jboss.tools.seam.pages.xml,
org.jboss.tools.seam.pages.xml.model,
org.jboss.tools.seam.pages.xml.model.helpers,
+ org.jboss.tools.seam.pages.xml.model.handlers,
org.jboss.tools.seam.pages.xml.model.impl
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui.ide,
17 years, 10 months
JBoss Tools SVN: r8675 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-10 08:16:13 -0400 (Tue, 10 Jun 2008)
New Revision: 8675
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
system.out.println deleted
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-06-10 12:15:16 UTC (rev 8674)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-06-10 12:16:13 UTC (rev 8675)
@@ -849,7 +849,6 @@
bundle = Platform.getBundle(confElement.getNamespaceIdentifier());
} else {
bundle = Platform.getBundle(nameSpaceIdentifyer);
- System.out.println(nameSpaceIdentifyer);
}
Class templateClass = bundle.loadClass(templateClassName);
template = (VpeTemplate)templateClass.newInstance();
17 years, 10 months
JBoss Tools SVN: r8674 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-06-10 08:15:16 -0400 (Tue, 10 Jun 2008)
New Revision: 8674
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
message severity changed from warning to error. bundle ID added to error message
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-06-10 11:21:08 UTC (rev 8673)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-06-10 12:15:16 UTC (rev 8674)
@@ -848,8 +848,8 @@
bundle = Platform.getBundle(confElement.getNamespaceIdentifier());
} else {
-
bundle = Platform.getBundle(nameSpaceIdentifyer);
+ System.out.println(nameSpaceIdentifyer);
}
Class templateClass = bundle.loadClass(templateClassName);
template = (VpeTemplate)templateClass.newInstance();
@@ -860,9 +860,9 @@
} catch (Exception e2) {
String message = e.getMessage();
if(message==null) {
- message = "Can't get VPE template class: " + templateClassName; //$NON-NLS-1$
+ message = "Can't get VPE template class: " + templateClassName + ", from bundle:" + nameSpaceIdentifyer; //$NON-NLS-1$
}
- VpePlugin.getPluginLog().logWarning(message, e);
+ VpePlugin.getPluginLog().logError(message, e);
return null;
}
}
17 years, 10 months