JBoss Tools SVN: r12144 - trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2008-11-29 00:07:22 -0500 (Sat, 29 Nov 2008)
New Revision: 12144
Modified:
trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/build.properties
trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml
Log:
[JBIDE-3216] fix feature
Modified: trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/build.properties
===================================================================
--- trunk/birt/features/org.jboss.tools.…
[View More]birt.integration.wtp.feature/build.properties 2008-11-28 20:49:04 UTC (rev 12143)
+++ trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/build.properties 2008-11-29 05:07:22 UTC (rev 12144)
@@ -1,2 +1,3 @@
bin.includes = feature.xml,\
- feature.properties
+ feature.properties,\
+ license.html
Modified: trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml
===================================================================
--- trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml 2008-11-28 20:49:04 UTC (rev 12143)
+++ trunk/birt/features/org.jboss.tools.birt.integration.wtp.feature/feature.xml 2008-11-29 05:07:22 UTC (rev 12144)
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.birt.integration.wtp.feature"
- label="%featureName"
- version="0.0.1"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <url>
- <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
- <discovery label="%birtUpdateSiteName" url="http://download.eclipse.org/birt/update-site/2.3"/>
- </url>
-
- <plugin
- id="org.eclipse.birt.integration.wtp.ui"
- download-size="0"
- install-size="0"
- version="0.0.0">
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.birt.integration.wtp.feature"
+ label="%featureName"
+ version="0.0.1"
+ provider-name="%providerName">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable"/>
+ <discovery label="%birtUpdateSiteName" url="http://download.eclipse.org/birt/update-site/2.3"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.birt.integration.wtp.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
[View Less]
16 years, 1 month
JBoss Tools SVN: r12143 - trunk/documentation/qa/docs/test-cases.
by jbosstools-commits@lists.jboss.org
Author: anis
Date: 2008-11-28 15:49:04 -0500 (Fri, 28 Nov 2008)
New Revision: 12143
Added:
trunk/documentation/qa/docs/test-cases/JBDS_testcases.rar
Log:
Added a file remotely
Added: trunk/documentation/qa/docs/test-cases/JBDS_testcases.rar
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/docs/test-cases/JBDS_testcases.rar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 1 month
JBoss Tools SVN: r12142 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-11-28 13:34:39 -0500 (Fri, 28 Nov 2008)
New Revision: 12142
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
…
[View More]Log:
https://jira.jboss.org/jira/browse/JBIDE-3312
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-11-28 18:32:39 UTC (rev 12141)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2008-11-28 18:34:39 UTC (rev 12142)
@@ -425,6 +425,8 @@
public static String POJO_CLASS_ALREADY_EXISTS;
public static String ENTITY_CLASS_ALREADY_EXISTS;
+ public static String PAGE_ALREADY_EXISTS;
+ public static String MASTER_PAGE_ALREADY_EXISTS;
public static String FIND_DECLARATIONS_ACTION_ACTION_NAME;
public static String FIND_DECLARATIONS_ACTION_DESCRIPTION;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-11-28 18:32:39 UTC (rev 12141)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2008-11-28 18:34:39 UTC (rev 12142)
@@ -240,4 +240,6 @@
SeamQuickFixFindDeclarations=Find Seam declarations for ''{0}''
SeamQuickFixFindReferences=Find Seam references for ''{0}''
POJO_CLASS_ALREADY_EXISTS=Such POJO class already exists!
-ENTITY_CLASS_ALREADY_EXISTS=Such entity class already exists!
\ No newline at end of file
+ENTITY_CLASS_ALREADY_EXISTS=Such entity class already exists!
+PAGE_ALREADY_EXISTS=Such page already exists!
+MASTER_PAGE_ALREADY_EXISTS=Such master page already exists!
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2008-11-28 18:32:39 UTC (rev 12141)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2008-11-28 18:34:39 UTC (rev 12142)
@@ -18,10 +18,12 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.core.IJavaProject;
@@ -37,6 +39,7 @@
import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
@@ -310,6 +313,19 @@
}
}
+ IPath webContent = InnerModelHelper.getWebInfPath(project).removeLastSegments(1);
+
+ IPath page = webContent.append(editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue()+".xhtml");
+
+ IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(page);
+ if(file.exists()){
+ setErrorMessage(null);
+ setMessage(SeamUIMessages.PAGE_ALREADY_EXISTS, IMessageProvider.WARNING);
+ setPageComplete(true);
+ return;
+ }
+
+
setErrorMessage(null);
setMessage(getDefaultMessageText());
setPageComplete(true);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2008-11-28 18:32:39 UTC (rev 12141)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2008-11-28 18:34:39 UTC (rev 12142)
@@ -14,7 +14,10 @@
import java.beans.PropertyChangeEvent;
import java.util.Map;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.core.IJavaProject;
@@ -26,6 +29,7 @@
import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
@@ -191,6 +195,29 @@
SeamGuiPlugin.getPluginLog().logError(ex);
}
}
+
+ IPath webContent = InnerModelHelper.getWebInfPath(project).removeLastSegments(1);
+
+ IPath masterPage = webContent.append(editorRegistry.get(IParameter.SEAM_MASTER_PAGE_NAME).getValue()+".xhtml");
+
+ IFile masterPageFile = ResourcesPlugin.getWorkspace().getRoot().getFile(masterPage);
+ if(masterPageFile.exists()){
+ setErrorMessage(null);
+ setMessage(SeamUIMessages.MASTER_PAGE_ALREADY_EXISTS, IMessageProvider.WARNING);
+ setPageComplete(true);
+ return;
+ }
+
+ IPath page = webContent.append(editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue()+".xhtml");
+
+ IFile pageFile = ResourcesPlugin.getWorkspace().getRoot().getFile(page);
+ if(pageFile.exists()){
+ setErrorMessage(null);
+ setMessage(SeamUIMessages.PAGE_ALREADY_EXISTS, IMessageProvider.WARNING);
+ setPageComplete(true);
+ return;
+ }
+
setErrorMessage(null);
setMessage(getDefaultMessageText());
setPageComplete(true);
[View Less]
16 years, 1 month
JBoss Tools SVN: r12141 - in documentation/trunk/movies: index/en and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-11-28 13:32:39 -0500 (Fri, 28 Nov 2008)
New Revision: 12141
Modified:
documentation/trunk/movies/Reverse_engineering_and_code_generation/Reverse_engineering_and_code_generation.wnk
documentation/trunk/movies/index/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-352
the index page of demos is updates, as 2 new demos were added
and one demo itself is updated a bit
Modified: documentation/trunk/movies/Reverse_engineering_and_code_generation/…
[View More]Reverse_engineering_and_code_generation.wnk
===================================================================
(Binary files differ)
Modified: documentation/trunk/movies/index/en/master.xml
===================================================================
--- documentation/trunk/movies/index/en/master.xml 2008-11-28 18:18:13 UTC (rev 12140)
+++ documentation/trunk/movies/index/en/master.xml 2008-11-28 18:32:39 UTC (rev 12141)
@@ -94,6 +94,23 @@
<para>This movie shows you step-by-step how to crete a new seam project</para>
</listitem>
+ <listitem>
+ <para>
+ <ulink url="demos/connecting_to_db_and_reverse_engineering_db_table/connecting_to_db_and_reverse_engineering_db_table.htm">Connecting to a database and reverse engineering a database table</ulink>
+ </para>
+ <para>The movie shows how to use establish database connection and reverse engineer a database table</para>
+ </listitem>
+
+
+ <listitem>
+ <para>
+ <ulink url="demos/building_web_page_using_JSF_RichFaces_Facelets/building_web_page_using_JSF_RichFaces_Facelets.htm">Building a web page using JSF, RichFaces, Facelets</ulink>
+ </para>
+ <para>In this part of the video cast about Seam it will be shown how to create a web page that displays database entries and adds a new entry to the database reusing generated code. You will practically learn how to use JSF, RichFaces and Facelets.</para>
+ </listitem>
+
+
+
</itemizedlist>
<itemizedlist>
<title>Project Archives Demos</title>
[View Less]
16 years, 1 month
JBoss Tools SVN: r12140 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-28 13:18:13 -0500 (Fri, 28 Nov 2008)
New Revision: 12140
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
Log:
JBIDE-2820: Add supports for new jsf 2.0 elements .
https://jira.jboss.org/jira/browse/JBIDE-2820
Test of h:outputStylesheet has been fixed.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java
===…
[View More]================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2008-11-28 18:17:56 UTC (rev 12139)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/Jsf20ComponentContentTest.java 2008-11-28 18:18:13 UTC (rev 12140)
@@ -19,9 +19,7 @@
*
*/
public class Jsf20ComponentContentTest extends ComponentContentTest {
- public static final String OUTPUT_SCRIPT_ID = "outputScript1"; //$NON-NLS-1$
-
public Jsf20ComponentContentTest(String name) {
super(name);
setCheckWarning(false);
@@ -44,11 +42,11 @@
}
public void testOutputScript() throws Throwable {
- performInvisibleTagTest("components/outputScript.xhtml", OUTPUT_SCRIPT_ID); //$NON-NLS-1$
+ performInvisibleTagTest("components/outputScript.xhtml", "outputScript1"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void testOutputStylesheet() throws Throwable {
- performContentTest("components/outputStylesheet.xhtml"); //$NON-NLS-1$
+ performInvisibleTagTest("components/outputStylesheet.xhtml", "outputStylesheetBlue"); //$NON-NLS-1$ //$NON-NLS-2$
}
protected String getTestProjectName() {
[View Less]
16 years, 1 month
JBoss Tools SVN: r12139 - in trunk/smooks/docs: reference and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-11-28 13:17:56 -0500 (Fri, 28 Nov 2008)
New Revision: 12139
Added:
trunk/smooks/docs/reference/
trunk/smooks/docs/reference/en/
trunk/smooks/docs/reference/en/images/
trunk/smooks/docs/reference/en/images/favicon.ico
trunk/smooks/docs/reference/en/master.xml
trunk/smooks/docs/reference/en/modules/
trunk/smooks/docs/reference/en/modules/quick_start.xml
trunk/smooks/docs/reference/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3296
an …
[View More]empty broject for docs is created
Added: trunk/smooks/docs/reference/en/images/favicon.ico
===================================================================
(Binary files differ)
Property changes on: trunk/smooks/docs/reference/en/images/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/smooks/docs/reference/en/master.xml
===================================================================
--- trunk/smooks/docs/reference/en/master.xml (rev 0)
+++ trunk/smooks/docs/reference/en/master.xml 2008-11-28 18:17:56 UTC (rev 12139)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.docbook.org/xml/4.3/docbookx.dtd"
+
+[
+<!--ENTITY intro SYSTEM "modules/intro.xml">
+<!ENTITY creating_new_seam SYSTEM "modules/creating_new_seam.xml">
+<!ENTITY directory_structure SYSTEM "modules/directory_structure.xml">
+<!ENTITY menus_and_actions SYSTEM "modules/seam_menus_and_actions.xml">
+<!ENTITY seam_wizards SYSTEM "modules/seam_wizards.xml">
+<!ENTITY generate_entities SYSTEM "modules/generate_entities.xml">
+<!ENTITY seam_editors SYSTEM "modules/seam_editors.xml">
+<!ENTITY seam_view SYSTEM "modules/seam_view.xml">
+ <!ENTITY seam_preferences SYSTEM "modules/seam_preferences.xml">
+<!ENTITY crud_database_application SYSTEM "modules/crud_database_application.xml">
+<!ENTITY crud_application_walkthrough SYSTEM "modules/crud_application_walkthrough.xml">
+<!ENTITY business_application SYSTEM "modules/business_application.xml">
+<!ENTITY testng SYSTEM "modules/testng.xml"-->
+
+<!ENTITY seamlink "../../seam/html_single/index.html">
+<!ENTITY aslink "../../as/html_single/index.html">
+<!ENTITY esblink "../../esb_ref_guide/html_single/index.html">
+<!ENTITY gsglink "../../GettingStartedGuide/html_single/index.html">
+<!ENTITY hibernatelink "../../hibernatetools/html_single/index.html">
+<!ENTITY jbpmlink "../../jbpm/html_single/index.html">
+<!ENTITY jsflink "../../jsf/html_single/index.html">
+<!ENTITY jsfreflink "../../jsf_tools_ref_guide/html_single/index.html">
+<!ENTITY jsftutoriallink "../../jsf_tools_tutorial/html_single/index.html">
+<!ENTITY strutsreflink "../../struts_tools_ref_guide/html_single/index.html">
+<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+
+
+]>
+<book>
+
+ <bookinfo>
+
+ <title>Smooks Dev Tools Reference Guide</title>
+ <author><firstname>Dart</firstname><surname>Peng</surname></author>
+
+ <pubdate>November 2008</pubdate>
+ <copyright>
+ <year>2008</year>
+ <holder>JBoss, a division of Red Hat Inc.</holder>
+ </copyright>
+ <releaseinfo>
+ Version: 3.0.0.CR1
+ </releaseinfo>
+
+<abstract>
+ <title/>
+ <para>
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/smooks/pdf/Smooks_Re...">PDF version</ulink>
+ </para>
+</abstract>
+
+
+ </bookinfo>
+ <toc/>
+
+<!--&testng;-->
+
+
+</book>
Added: trunk/smooks/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/smooks/docs/reference/en/modules/quick_start.xml (rev 0)
+++ trunk/smooks/docs/reference/en/modules/quick_start.xml 2008-11-28 18:17:56 UTC (rev 12139)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="intro" xreflabel="intro">
+ <?dbhtml filename="intro.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Seam</keyword>
+ <keyword>JBDS</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Quick Start</title>
+
+ <section>
+ </section>
+</chapter>
Added: trunk/smooks/docs/reference/pom.xml
===================================================================
--- trunk/smooks/docs/reference/pom.xml (rev 0)
+++ trunk/smooks/docs/reference/pom.xml 2008-11-28 18:17:56 UTC (rev 12139)
@@ -0,0 +1,113 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>smooks-ref-guide-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>Smooks_Reference_Guide</name>
+
+ <profiles>
+ <profile>
+ <id>diffmk</id>
+ <properties>
+ <master>master_output.xml</master>
+ </properties>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <sourceDocumentName>${master}</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <cssResource>
+ <directory>${pom.basedir}/${cssdir}</directory>
+ </cssResource>
+
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
+ <master>master.xml</master>
+ <translation>en-US</translation>
+ </properties>
+</project>
[View Less]
16 years, 1 month
JBoss Tools SVN: r12138 - trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-11-28 12:58:16 -0500 (Fri, 28 Nov 2008)
New Revision: 12138
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
Log:
JBIDE-1975 OpenOn for #{messages.***} in Seam EL.
Issue is fixed for Seam EL in Java-Strings
Modified: trunk/seam/plugins/org.…
[View More]jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2008-11-28 17:55:49 UTC (rev 12137)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2008-11-28 17:58:16 UTC (rev 12138)
@@ -12,7 +12,9 @@
package org.jboss.tools.seam.text.ext.hyperlink;
import java.text.MessageFormat;
+import java.util.Map;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaModelException;
@@ -21,14 +23,18 @@
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
+import org.jboss.tools.seam.internal.core.SeamMessagesComponent;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
public class SeamELInJavaStringHyperlink implements IHyperlink {
private final IRegion fRegion;
private final IJavaElement[] fElements;
-
+ private final Map<String, SeamMessagesComponent> fMessages;
/**
* Creates a new Seam EL in Java string hyperlink.
*/
@@ -38,8 +44,21 @@
fRegion = region;
fElements = elements;
+ fMessages = null;
}
+ /**
+ * Creates a new Seam EL in Java string hyperlink for messages.
+ */
+ SeamELInJavaStringHyperlink(IRegion region, Map<String, SeamMessagesComponent> messages) {
+ Assert.isNotNull(region);
+ Assert.isNotNull(messages);
+
+ fRegion = region;
+ fElements = null;
+ fMessages = messages;
+ }
+
/*
* @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkRegion()
* @since 3.1
@@ -53,24 +72,62 @@
* @since 3.1
*/
public void open() {
- try {
- IEditorPart part = null;
- for (int i = 0; fElements != null && i < fElements.length; i++) {
- part = JavaUI.openInEditor(fElements[i]);
- if (part != null) {
- if (fElements[i] != null)
- JavaUI.revealInEditor(part, fElements[i]);
- break;
- }
+ if (fMessages != null && fElements == null) {
+ openMessages();
+ } else if (fElements != null && fMessages == null) {
+ try {
+ IEditorPart part = null;
+ for (int i = 0; fElements != null && i < fElements.length; i++) {
+ part = JavaUI.openInEditor(fElements[i]);
+ if (part != null) {
+ if (fElements[i] != null)
+ JavaUI.revealInEditor(part, fElements[i]);
+ break;
+ }
+ }
+
+ } catch (PartInitException e) {
+ SeamExtPlugin.getPluginLog().logError(e);
+ } catch (JavaModelException e) {
+ // Ignore. It is probably because of Java element is not found
}
+ }
+ }
+
+ private void openMessages() {
+ Map <String, SeamMessagesComponent> messages = fMessages;
+ if (messages == null || messages.size() == 0) {
+ // Nothing to open
+ return;
+ }
- } catch (PartInitException e) {
- SeamExtPlugin.getPluginLog().logError(e);
- } catch (JavaModelException e) {
- // Ignore. It is probably because of Java element is not found
+ for (String property : messages.keySet()) {
+ SeamMessagesComponent messagesComponent = messages.get(property);
+ Map <String, IResource> resources = messagesComponent.getResourcesMap();
+ if (resources == null || resources.size() == 0)
+ continue;
+
+ for (String bundle : resources.keySet()) {
+ IResource resource = resources.get(bundle);
+ XModelObject xmo = EclipseResourceUtil.getObjectByResource(resource);
+ if (xmo == null)
+ continue;
+
+ XModelObject xmoChild = xmo.getChildByPath(property);
+ if (xmoChild == null)
+ continue;
+
+ int result = FindObjectHelper.findModelObject(xmoChild, FindObjectHelper.IN_EDITOR_ONLY);
+ if (result == 0) {
+ // Success
+ return;
+ }
+ }
}
+ // could not open editor
+
}
-
+
/*
* @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getTypeLabel()
* @since 3.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2008-11-28 17:55:49 UTC (rev 12137)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2008-11-28 17:58:16 UTC (rev 12138)
@@ -11,7 +11,10 @@
package org.jboss.tools.seam.text.ext.hyperlink;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -30,9 +33,20 @@
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.ISeamXmlFactory;
+import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamMessagesComponent;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.internal.core.el.SeamExpressionResolver;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
public class SeamELInJavaStringHyperlinkDetector extends
@@ -86,6 +100,10 @@
if(range == null) range = new int[]{0, document.getLength()};
+ Map<String, SeamMessagesComponent> messages = findMessagesComponents(document, file, wordRegion, range[0], range[1]);
+ if (messages != null && messages.size() > 0)
+ return new IHyperlink[] {new SeamELInJavaStringHyperlink(wordRegion, messages)};
+
IJavaElement[] elements = findJavaElements(document, file, wordRegion, range[0], range[1]);
if (elements != null && elements.length > 0)
return new IHyperlink[] {new SeamELInJavaStringHyperlink(wordRegion, elements)};
@@ -119,7 +137,110 @@
return javaElements == null ? new IJavaElement[0] : javaElements.toArray(new IJavaElement[0]);
}
+
+ public static Map<String, SeamMessagesComponent> findMessagesComponents(IDocument document, IFile file, IRegion region, int start, int end) {
+ IProject project = (file == null ? null : file.getProject());
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return null;
+
+ SeamELCompletionEngine engine = new SeamELCompletionEngine(seamProject);
+
+ String prefix= engine.getJavaElementExpression(document, region.getOffset(), region, start, end);
+ prefix = (prefix == null ? "" : prefix);
+
+ ELExpression exp = engine.parseOperand(prefix);
+ if (exp == null)
+ return null; // No EL Operand found
+
+ Map<ELInvocationExpression, List<ISeamContextVariable>> map = new HashMap<ELInvocationExpression, List<ISeamContextVariable>>();
+
+ exp.getModel().shift(region.getOffset() - exp.getFirstToken().getStart());
+
+ if ( !(exp instanceof ELInvocationExpression) &&
+ !(exp instanceof ELPropertyInvocation) &&
+ !(exp instanceof ELArgumentInvocation))
+ return null;
+
+ String propertyName = null;
+ if (exp instanceof ELPropertyInvocation) {
+ propertyName = ((ELPropertyInvocation)exp).getMemberName();
+ } else if (exp instanceof ELArgumentInvocation) {
+ propertyName = Utils.trimQuotes(
+ ((ELArgumentInvocation)exp).getArgument().getArgument().getText());
+
+ }
+
+ if (propertyName == null)
+ return null;
+
+ ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
+
+ ELInvocationExpression expr = (ELInvocationExpression)exp;
+
+ ELInvocationExpression left = expr;
+
+ if (expr.getLeft() != null) {
+ while (left != null) {
+ List<ISeamContextVariable> resolvedVars = new ArrayList<ISeamContextVariable>();
+ resolvedVars = engine.resolveVariables(scope, left,
+ left == expr, true);
+ if (resolvedVars != null && !resolvedVars.isEmpty()) {
+ map.put(left, resolvedVars);
+ break;
+ }
+ left = (ELInvocationExpression) left.getLeft();
+ }
+ }
+
+
+ // At the moment map contains the resolved EL parts mapped to their vars
+ // And now we need to extract SeamXmlFactory vars to the real ones
+ // and filter out all non-SeamMessagesComponent vars
+ // Next we need to map the SeamMessagesComponent vars to properties
+ Map<String, SeamMessagesComponent> messages = new HashMap<String, SeamMessagesComponent>();
+ if (map != null && !map.isEmpty()) {
+ for (ELInvocationExpression l : map.keySet()) {
+ List<ISeamContextVariable> variables = map.get(l);
+ for (ISeamContextVariable variable : variables) {
+ if (variable instanceof SeamMessagesComponent) {
+ messages.put(propertyName, (SeamMessagesComponent)variable);
+ } else if (variable instanceof ISeamXmlFactory) {
+ ISeamXmlFactory factory = (ISeamXmlFactory)variable;
+ String value = factory.getValue();
+ if (value != null && value.length() > 0) {
+ if (value.startsWith("#{") || value.startsWith("${")) //$NON-NLS-1$ //$NON-NLS-2$
+ value = value.substring(2);
+ if (value.endsWith("}")) //$NON-NLS-1$
+ value = value.substring(0, value.length() - 1);
+ }
+ if (value != null && value.length() > 0) {
+ // TODO: Need to make sure that it's correct way to get the project and
+ // the scope from the factory
+ ISeamProject p = ((ISeamElement)factory).getSeamProject();
+ if (p != null) {
+ List<ISeamContextVariable> resolvedValues = SeamExpressionResolver.resolveVariables(p, null, value, true);
+ for (ISeamContextVariable var : resolvedValues) {
+ if (var.getName().equals(value)) {
+ if (var instanceof SeamMessagesComponent) {
+ messages.put(propertyName,(SeamMessagesComponent)var);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ return messages;
+
+
+ }
+
/*
* Checks if the EL start starting characters are present
* @param viewer
[View Less]
16 years, 1 month
JBoss Tools SVN: r12137 - in trunk: vpe/plugins/org.jboss.tools.vpe/resources/help and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-28 12:55:49 -0500 (Fri, 28 Nov 2008)
New Revision: 12137
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
trunk/vpe/plugins/org.jboss.…
[View More]tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
JBIDE-2773
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/GlobalElVariablesComposite.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/GlobalElVariablesComposite.java 2008-11-28 17:19:43 UTC (rev 12136)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/GlobalElVariablesComposite.java 2008-11-28 17:55:49 UTC (rev 12137)
@@ -49,7 +49,7 @@
*/
@Override
protected String getEntity() {
- return (file != null) ? "VPEGlobalElReference" : "VPEGlobalElReferenceExt";
+ return "VPEGlobalElReference";
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-11-28 17:19:43 UTC (rev 12136)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-11-28 17:55:49 UTC (rev 12137)
@@ -8,9 +8,6 @@
VPETLDReference_AddItem.Title=Add TLD Item
VPETLDReference_EditItem.Title=Edit TLD Item
-VPEElReference_AddItem.Title=Add El Item
-VPEElReference_EditItem.Title=Edit EL Item
-
VpeImageReferencesDialog.WindowTitle=References to Images Files
VpeImageReferencesDialog.Title=Visual Page Editor
VPEImageReference.location=Path to Folder
@@ -20,20 +17,18 @@
VPEElReference.location=El Value
VPEElReference.prefix=Value
+VPEElReferenceEditItem.Title=Edit El Item Title
+VPEElReferenceEditItem.Message=Edit El variable, which is substituted in a visual part for generating a preview
+VPEElReferenceAddItem.Message=Add El variable, which will be substituted in a visual part for generating a preview
+VPEElReferenceAddItem.Title=Add El Item
-VPEElReferenceExt.location=El Value
-VPEElReferenceExt.prefix=Value
-
VPEGlobalElReference.location=El Value
VPEGlobalElReference.prefix=Value
-VPEGlobalElReference_AddItem.Title=Add El Item
-VPEGlobalElReference_EditItem.Title=Edit EL Item
+VPEGlobalElReferenceAddItem.Title=Add El Item
+VPEGlobalElReferenceEditItem.Title=Edit EL Item
+VPEGlobalElReferenceAddItem.Message=Add global El variable, which will be substituted in a visual part for generating a preview
+VPEGlobalElReferenceEditItem.Message=Edit global El variable, which is substituted in a visual part for generating a preview
-VPEGlobalElReferenceExt.location=El Value
-VPEGlobalElReferenceExt.prefix=Value
-VPEGlobalElReferenceExt_AddItem.Title=Add El Item
-VPEGlobalElReferenceExt_EditItem.Title=Edit EL Item
-
VpeResourcesDialog.WindowTitle=References to Resources
VpeResourcesDialog.Title=Page Design Options
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-11-28 17:19:43 UTC (rev 12136)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-11-28 17:55:49 UTC (rev 12137)
@@ -138,7 +138,8 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport,
+ key=VPEElReferenceAddItem"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -149,7 +150,8 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport,
+ key=VPEElReferenceEditItem"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -162,62 +164,7 @@
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%Regular%" name="VPEElReferenceExt">
-
- <XChildrenEntities/>
- <XEntityRenderer>
- <ICONS>
- <ICON info="action.empty" type="main"/>
- </ICONS>
- </XEntityRenderer>
- <XModelAttributes>
- <XModelAttribute name="location" xmlname="location"/>
- <XModelAttribute PROPERTIES="border=true"
- default="Folder: Any Page at the Same Folder" name="scope" xmlname="scope">
- <Constraint loader="ListString">
- <value name="Page: Only This Page"/>
- <value name="Folder: Any Page at the Same Folder"/>
- </Constraint>
- <Editor name="RadioArray"/>
- </XModelAttribute>
- <XModelAttribute name="prefix">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- </XModelAttributes>
- <XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions">
- <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
- displayName="Add El Reference..." kind="action" name="AddItem">
- <EntityData EntityName="VPEElReferenceExt">
- <AttributeData AttributeName="location"/>
- <AttributeData AttributeName="scope" Mandatory="no"/>
- <AttributeData AttributeName="prefix" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
- <XActionItem kind="list" name="EditActions">
- <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
- displayName="Edit El Reference..." kind="action" name="EditItem">
- <EntityData EntityName="VPEElReference">
- <AttributeData AttributeName="location"/>
- <AttributeData AttributeName="scope" Mandatory="no"/>
- <AttributeData AttributeName="prefix" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
- </XActionItem>
- <XDependencies/>
- </XModelEntity>
- <!-- -->
-
-
-
-
-
<!-- Added by estherbin https://jira.jboss.org/jira/browse/JBIDE-2594 -->
<XModelEntity ImplementingClass="%Regular%" name="VPEGlobalElReference">
@@ -228,59 +175,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute name="location" xmlname="location">
- <Constraint loader="ListString">
- <value name="Global: For all projects in workspace"/>
- </Constraint>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="prefix">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- </XModelAttributes>
- <XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions">
- <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
- displayName="Add El Reference..." kind="action" name="AddItem">
- <EntityData EntityName="VPEGlobalElReference">
- <AttributeData AttributeName="location" Mandatory="no"/>
- <!--AttributeData AttributeName="scope" Mandatory="no"/-->
- <AttributeData AttributeName="prefix" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
- <XActionItem kind="list" name="EditActions">
- <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
- displayName="Edit El Reference..." kind="action" name="EditItem">
- <EntityData EntityName="VPEGlobalElReference">
- <AttributeData AttributeName="location"/>
- <!--AttributeData AttributeName="scope" Mandatory="no"/-->
- <AttributeData AttributeName="prefix" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
- </XActionItem>
- <XDependencies/>
- </XModelEntity>
-
- <XModelEntity ImplementingClass="%Regular%" name="VPEGlobalElReferenceExt">
-
-
- <XChildrenEntities/>
- <XEntityRenderer>
- <ICONS>
- <ICON info="action.empty" type="main"/>
- </ICONS>
- </XEntityRenderer>
- <XModelAttributes>
- <XModelAttribute name="location" xmlname="location">
+ <XModelAttribute name="location" xmlname="location">
<Constraint/>
<Editor/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="border=true"
+ <XModelAttribute PROPERTIES="border=true"
default="Folder: Any Page at the Same Folder" name="scope" xmlname="scope">
<Constraint loader="ListString">
<value name="Global: For all projects in workspace"/>
@@ -295,9 +194,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport,
+ key=VPEGlobalElReferenceAddItem"
displayName="Add El Reference..." kind="action" name="AddItem">
- <EntityData EntityName="VPEGlobalElReferenceExt">
+ <EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
<AttributeData AttributeName="prefix" Mandatory="no"/>
@@ -306,9 +206,10 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport,
+ key=VPEGlobalElReferenceEditItem"
displayName="Edit El Reference..." kind="action" name="EditItem">
- <EntityData EntityName="VPEGlobalElReferenceExt">
+ <EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
<AttributeData AttributeName="prefix" Mandatory="no"/>
@@ -318,11 +219,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <!-- -->
+
-
-
-
<XModelEntity ImplementingClass="%Regular%" name="VPEFolderReference">
<XChildrenEntities/>
<XEntityRenderer>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-28 17:19:43 UTC (rev 12136)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-11-28 17:55:49 UTC (rev 12137)
@@ -3119,7 +3119,7 @@
// synced = false;
return;
}
- // TODO Max Areshkau Adjust this code, now we haven's source mode
+
if (editPart.getVisualMode() != VpeEditorPart.SOURCE_MODE) {
if (toolbarFormatControllerManager != null)
toolbarFormatControllerManager.selectionChanged();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java 2008-11-28 17:19:43 UTC (rev 12136)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java 2008-11-28 17:55:49 UTC (rev 12137)
@@ -34,7 +34,7 @@
*/
@Override
protected String getEntity() {
- return (file != null) ? "VPEElReference" : "VPEElReferenceExt"; //$NON-NLS-1$//$NON-NLS-2$
+ return "VPEElReference";
}
/**c
[View Less]
16 years, 1 month
JBoss Tools SVN: r12136 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-11-28 12:19:43 -0500 (Fri, 28 Nov 2008)
New Revision: 12136
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
Log:
JBIDE-2773
It is not good just copy subtitle to message area.
Meaningful message can be set with key '%action-key-id%.Message' along with '%action-key-id%.Title'.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/…
[View More]model/ui/wizards/standard/DefaultStandardWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-11-28 17:13:25 UTC (rev 12135)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-11-28 17:19:43 UTC (rev 12136)
@@ -113,14 +113,13 @@
String message = validator.getErrorMessage();
isFinishEnabled = validator.isCommandEnabled(SpecialWizardSupport.FINISH);
DefaultStandardStep wizardStep = steps[support.getStepId()];
+ String m = support.getMessage(support.getStepId());
if(wizardStep != null && !wizardStep.isDataChanged()) {
- String m = support.getMessage(support.getStepId());
if (m == null || m.length() == 0) m = message;
wizardStep.setDescription(m);
- wizardStep.setMessage(support.getSubtitle());
wizardStep.setErrorMessage(null);
} else {
- wizardStep.setDescription(null);
+ wizardStep.setDescription(m);
if(message == null && !isFinishEnabled) {
message = support.getMessage(support.getStepId());
if(message != null && message.trim().length() == 0) {
[View Less]
16 years, 1 month
JBoss Tools SVN: r12135 - in trunk/seam/plugins/org.jboss.tools.seam.text.ext: src/org/jboss/tools/seam/text/ext/hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-11-28 12:13:25 -0500 (Fri, 28 Nov 2008)
New Revision: 12135
Added:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
Log:
JBIDE-1975 OpenOn for #{messages.***} in Seam EL.
Issue is fixed
…
[View More]Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2008-11-28 17:11:00 UTC (rev 12134)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/plugin.xml 2008-11-28 17:13:25 UTC (rev 12135)
@@ -230,6 +230,41 @@
<partitiontype id="org.jboss.tools.seam.text.ext.SEAM_BEAN" />
</contenttypeidentifier>
</hyperlink>
+
+ <hyperlink
+ class="org.jboss.tools.seam.text.ext.hyperlink.SeamMessagesBeanHyperlink"
+ id="org.jboss.tools.seam.text.ext.hyperlink.SeamBeanHyperlink">
+ <contenttypeidentifier id="org.eclipse.jst.jsp.core.jspsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.eclipse.wst.html.core.htmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.eclipse.core.runtime.xml">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.common.model.ui.xml">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.pages12xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.page12xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.pages20xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.page20xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.pages21xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ <contenttypeidentifier id="org.jboss.tools.seam.xml.ui.page21xmlsource">
+ <partitiontype id="org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN" />
+ </contenttypeidentifier>
+ </hyperlink>
<hyperlink
class="org.jboss.tools.seam.text.ext.hyperlink.SeamViewHyperlink"
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-11-28 17:11:00 UTC (rev 12134)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-11-28 17:13:25 UTC (rev 12135)
@@ -10,17 +10,31 @@
******************************************************************************/
package org.jboss.tools.seam.text.ext.hyperlink;
+import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.jboss.tools.common.el.core.model.ELArgumentInvocation;
import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELObjectType;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELOperandResolveStatus;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
@@ -29,11 +43,18 @@
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkPartitionRecognizer;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
+import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
import org.jboss.tools.common.text.ext.util.Utils;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.ISeamXmlFactory;
+import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamMessagesComponent;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.internal.core.el.SeamExpressionResolver;
import org.jboss.tools.seam.text.ext.SeamExtPlugin;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -45,7 +66,10 @@
*/
public class SeamBeanHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer, IHyperLinkPartitionPriority {
public static final String SEAM_BEAN_PARTITION = "org.jboss.tools.seam.text.ext.SEAM_BEAN";
+ public static final String SEAM_MESSAGES_BEAN_PARTITION = "org.jboss.tools.seam.text.ext.SEAM_MESSAGES_BEAN";
+ private ELParserFactory factory = ELParserUtil.getJbossFactory();
+
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
*/
@@ -62,19 +86,40 @@
if (r == null) return null;
r = getWordRegion(document, superRegion.getOffset());
if (r == null) return null;
+
+ Map<String, SeamMessagesComponent> messages = findMessagesComponents(document, superRegion);
- String axis = getAxis(document, superRegion);
- String contentType = superRegion.getContentType();
- String type = SEAM_BEAN_PARTITION;
- int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
- int offset = superRegion.getOffset();
+ if (messages != null && messages.size() > 0) {
+ String axis = getAxis(document, superRegion);
+ String contentType = superRegion.getContentType();
+ String type = SEAM_MESSAGES_BEAN_PARTITION;
+
+ int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
+ int offset = superRegion.getOffset();
+
+ IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
+ return region;
+ }
- IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
- return region;
+ List<IJavaElement> javaElements = findJavaElements(document, superRegion);
+ if (javaElements != null && javaElements.size() > 0) {///
+ String axis = getAxis(document, superRegion);
+ String contentType = superRegion.getContentType();
+ String type = SEAM_BEAN_PARTITION;
+ int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
+ int offset = superRegion.getOffset();
+
+ IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
+ return region;
+ }
+
+ return null;
} finally {
smw.dispose();
}
}
+
+
protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
@@ -233,9 +278,17 @@
Utils.findNodeForOffset(xmlDocument, region.getOffset());
+ Map<String, SeamMessagesComponent> messages = findMessagesComponents(document, region);
+ if (messages != null && messages.size() > 0) {
+ return true;
+ }
+
List<IJavaElement> javaElements = findJavaElements(document, region);
-
- return (javaElements != null && javaElements.size() > 0);
+ if (javaElements != null || javaElements.size() > 0) {
+ return true;
+ }
+
+ return false;
} finally {
smw.dispose();
}
@@ -329,6 +382,186 @@
}
}
+ public static Map<String, SeamMessagesComponent> findMessagesComponents(IDocument document, IRegion region) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ try {
+ smw.init(document);
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ IHyperlinkRegion r = getRegion(document, region.getOffset());
+ if (r == null) return null;
+
+ String propText = document.get(r.getOffset(), r.getLength());
+
+
+ IFile file = smw.getFile();
+ IProject project = (file == null ? null : file.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return null;
+
+ SeamELCompletionEngine engine= new SeamELCompletionEngine(seamProject);
+
+ String prefix = propText;
+ ELExpression exp = engine.parseOperand(prefix);
+ if (exp == null)
+ return null; // No EL Operand found
+
+ Map<ELInvocationExpression, List<ISeamContextVariable>> map = new HashMap<ELInvocationExpression, List<ISeamContextVariable>>();
+
+ exp.getModel().shift(r.getOffset() - exp.getFirstToken().getStart());
+
+ if ( !(exp instanceof ELInvocationExpression) &&
+ !(exp instanceof ELPropertyInvocation) &&
+ !(exp instanceof ELArgumentInvocation))
+ return null;
+
+ String propertyName = null;
+ if (exp instanceof ELPropertyInvocation) {
+ propertyName = ((ELPropertyInvocation)exp).getMemberName();
+ } else if (exp instanceof ELArgumentInvocation) {
+ propertyName = Utils.trimQuotes(
+ ((ELArgumentInvocation)exp).getArgument().getArgument().getText());
+
+ }
+
+ if (propertyName == null)
+ return null;
+
+ ScopeType scope = SeamELCompletionEngine.getScope(seamProject, file);
+
+ ELInvocationExpression expr = (ELInvocationExpression)exp;
+
+ ELInvocationExpression left = expr;
+
+ if (expr.getLeft() != null) {
+ while (left != null) {
+ List<ISeamContextVariable> resolvedVars = new ArrayList<ISeamContextVariable>();
+ resolvedVars = engine.resolveVariables(scope, left,
+ left == expr, true);
+ if (resolvedVars != null && !resolvedVars.isEmpty()) {
+ map.put(left, resolvedVars);
+ break;
+ }
+ left = (ELInvocationExpression) left.getLeft();
+ }
+ }
+
+
+ // At the moment map contains the resolved EL parts mapped to their vars
+ // And now we need to extract SeamXmlFactory vars to the real ones
+ // and filter out all non-SeamMessagesComponent vars
+ // Next we need to map the SeamMessagesComponent vars to properties
+ Map<String, SeamMessagesComponent> messages = new HashMap<String, SeamMessagesComponent>();
+ if (map != null && !map.isEmpty()) {
+ for (ELInvocationExpression l : map.keySet()) {
+ List<ISeamContextVariable> variables = map.get(l);
+ for (ISeamContextVariable variable : variables) {
+ if (variable instanceof SeamMessagesComponent) {
+ messages.put(propertyName, (SeamMessagesComponent)variable);
+ } else if (variable instanceof ISeamXmlFactory) {
+ ISeamXmlFactory factory = (ISeamXmlFactory)variable;
+ String value = factory.getValue();
+ if (value != null && value.length() > 0) {
+ if (value.startsWith("#{") || value.startsWith("${")) //$NON-NLS-1$ //$NON-NLS-2$
+ value = value.substring(2);
+ if (value.endsWith("}")) //$NON-NLS-1$
+ value = value.substring(0, value.length() - 1);
+ }
+ if (value != null && value.length() > 0) {
+ // TODO: Need to make sure that it's correct way to get the project and
+ // the scope from the factory
+ ISeamProject p = ((ISeamElement)factory).getSeamProject();
+ if (p != null) {
+ List<ISeamContextVariable> resolvedValues = SeamExpressionResolver.resolveVariables(p, null, value, true);
+ for (ISeamContextVariable var : resolvedValues) {
+ if (var.getName().equals(value)) {
+ if (var instanceof SeamMessagesComponent) {
+ messages.put(propertyName,(SeamMessagesComponent)var);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ return messages;
+ } catch (BadLocationException x) {
+ SeamExtPlugin.getPluginLog().logError(x);
+ return null;
+ } finally {
+ smw.dispose();
+ }
+ }
+
+ public static IHyperlinkRegion getMessagesPropertyRegion(IDocument document, int offset) {
+ StructuredModelWrapper smw = new StructuredModelWrapper();
+ try {
+ smw.init(document);
+ Document xmlDocument = smw.getDocument();
+ if (xmlDocument == null) return null;
+
+ IHyperlinkRegion r = getRegion(document, offset);
+ if (r == null) return null;
+
+ String propText = document.get(r.getOffset(), r.getLength());
+
+ IFile file = smw.getFile();
+ IProject project = (file == null ? null : file.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return null;
+
+ SeamELCompletionEngine engine= new SeamELCompletionEngine(seamProject);
+
+ String prefix = propText;
+ ELExpression exp = engine.parseOperand(prefix);
+ if (exp == null)
+ return null; // No EL Operand found
+
+ Map<ELInvocationExpression, List<ISeamContextVariable>> map = new HashMap<ELInvocationExpression, List<ISeamContextVariable>>();
+
+ exp.getModel().shift(r.getOffset() - exp.getFirstToken().getStart());
+
+ if ( !(exp instanceof ELInvocationExpression) &&
+ !(exp instanceof ELPropertyInvocation) &&
+ !(exp instanceof ELArgumentInvocation))
+ return null;
+
+ String propertyName = null;
+ if (exp instanceof ELPropertyInvocation) {
+ propertyName = ((ELPropertyInvocation)exp).getMemberName();
+
+ int start = ((ELPropertyInvocation)exp).getLastToken().getStart();
+ int length = ((ELPropertyInvocation)exp).getLastToken().getLength();
+
+ return new HyperlinkRegion(start, length);
+ } else if (exp instanceof ELArgumentInvocation) {
+ propertyName = Utils.trimQuotes(
+ ((ELArgumentInvocation)exp).getArgument().getArgument().getText());
+ int start = ((ELArgumentInvocation)exp).getArgument().getArgument().getStartPosition();
+ int length = ((ELArgumentInvocation)exp).getArgument().getArgument().getEndPosition() -
+ ((ELArgumentInvocation)exp).getArgument().getArgument().getStartPosition();
+
+ return new HyperlinkRegion(start, length);
+ }
+
+ return null;
+ } catch (BadLocationException x) {
+ SeamExtPlugin.getPluginLog().logError(x);
+ return null;
+ } finally {
+ smw.dispose();
+ }
+ }
+
public int getPriority() {
return 0; // to be first
}
Added: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2008-11-28 17:13:25 UTC (rev 12135)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.text.ext.hyperlink;
+
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.ui.JavaUI;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
+import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
+import org.jboss.tools.seam.internal.core.SeamMessagesComponent;
+
+/**
+ * @author Jeremy
+ */
+
+public class SeamMessagesBeanHyperlink extends AbstractHyperlink {
+
+ /**
+ * @see com.ibm.sse.editor.AbstractHyperlink#doHyperlink(org.eclipse.jface.text.IRegion)
+ */
+ protected void doHyperlink(IRegion region) {
+ Map <String, SeamMessagesComponent> messages = SeamBeanHyperlinkPartitioner.findMessagesComponents(getDocument(), region);
+ if (messages == null || messages.size() == 0) {
+ // Nothing to open
+ openFileFailed();
+ return;
+ }
+
+ for (String property : messages.keySet()) {
+ SeamMessagesComponent messagesComponent = messages.get(property);
+ Map <String, IResource> resources = messagesComponent.getResourcesMap();
+ if (resources == null || resources.size() == 0)
+ continue;
+
+ for (String bundle : resources.keySet()) {
+ IResource resource = resources.get(bundle);
+ XModelObject xmo = EclipseResourceUtil.getObjectByResource(resource);
+ if (xmo == null)
+ continue;
+
+ XModelObject xmoChild = xmo.getChildByPath(property);
+ if (xmoChild == null)
+ continue;
+
+ int result = FindObjectHelper.findModelObject(xmoChild, FindObjectHelper.IN_EDITOR_ONLY);
+ if (result == 0) {
+ // Success
+ return;
+ }
+ }
+ }
+ // could not open editor
+ openFileFailed();
+ }
+
+ IRegion fLastRegion = null;
+ /**
+ * @see com.ibm.sse.editor.AbstractHyperlink#doGetHyperlinkRegion(int)
+ */
+ protected IRegion doGetHyperlinkRegion(int offset) {
+ fLastRegion = SeamBeanHyperlinkPartitioner.getMessagesPropertyRegion(getDocument(), offset);
+ return fLastRegion;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see IHyperlink#getHyperlinkText()
+ */
+ public String getHyperlinkText() {
+
+ String beanName;
+ try {
+ beanName = getDocument().get(fLastRegion.getOffset(), fLastRegion.getLength());
+ } catch (BadLocationException e) {
+ beanName = null;
+ }
+
+ if (beanName == null)
+ return MessageFormat.format(Messages.NotFound, Messages.Bean);
+
+ return MessageFormat.format(Messages.OpenBean, beanName);
+ }
+}
\ No newline at end of file
[View Less]
16 years, 1 month