JBoss Tools SVN: r33455 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-02 12:59:20 -0400 (Tue, 02 Aug 2011)
New Revision: 33455
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
Log:
JBIDE-9441
https://issues.jboss.org/browse/JBIDE-9441
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-08-02 16:57:19 UTC (rev 33454)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-08-02 16:59:20 UTC (rev 33455)
@@ -34,6 +34,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -408,27 +409,34 @@
//ignore
}
File file = getStorageFile();
- file.getParentFile().mkdirs();
+ if(file != null) {
+ file.getParentFile().mkdirs();
- Element root = XMLUtilities.createDocumentElement("kb-project"); //$NON-NLS-1$
- storeProjectDependencies(root);
+ Element root = XMLUtilities.createDocumentElement("kb-project"); //$NON-NLS-1$
+ storeProjectDependencies(root);
- storeSourcePaths2(root);
+ storeSourcePaths2(root);
- if(validationContext != null) validationContext.store(root);
+ if(validationContext != null) validationContext.store(root);
- XMLUtilities.serialize(root, file.getAbsolutePath());
+ XMLUtilities.serialize(root, file.getAbsolutePath());
- modifications = 0;
+ modifications = 0;
+ }
}
/*
*
*/
private File getStorageFile() {
- IPath path = WebKbPlugin.getDefault().getStateLocation();
- File file = new File(path.toFile(), "projects/" + project.getName() + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
- return file;
+ WebKbPlugin plugin = WebKbPlugin.getDefault();
+ if( plugin != null) {
+ IPath path = plugin.getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName() + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ return file;
+ } else {
+ return null;
+ }
}
public void clearStorage() {
13 years, 5 months
JBoss Tools SVN: r33454 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-08-02 12:57:19 -0400 (Tue, 02 Aug 2011)
New Revision: 33454
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-9441
https://issues.jboss.org/browse/JBIDE-9441
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2011-08-02 16:13:18 UTC (rev 33453)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2011-08-02 16:57:19 UTC (rev 33454)
@@ -531,23 +531,25 @@
*/
public void store() throws IOException {
File file = getStorageFile();
- file.getParentFile().mkdirs();
+ if(file != null) {
+ file.getParentFile().mkdirs();
- Element root = XMLUtilities.createDocumentElement("seam-project"); //$NON-NLS-1$
- storeProjectDependencies(root);
+ Element root = XMLUtilities.createDocumentElement("seam-project"); //$NON-NLS-1$
+ storeProjectDependencies(root);
- storeNamespaces(root);
+ storeNamespaces(root);
// storeSourcePaths(root);
- storeSourcePaths2(root);
+ storeSourcePaths2(root);
- if(validationContext != null) validationContext.store(root);
+ if(validationContext != null) validationContext.store(root);
- XMLUtilities.serialize(root, file.getAbsolutePath());
+ XMLUtilities.serialize(root, file.getAbsolutePath());
- modifications = 0;
- namespaces.modifications = 0;
- components.modifications = 0;
- factories.modifications = 0;
+ modifications = 0;
+ namespaces.modifications = 0;
+ components.modifications = 0;
+ factories.modifications = 0;
+ }
}
/*
13 years, 5 months
JBoss Tools SVN: r33453 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-08-02 12:13:18 -0400 (Tue, 02 Aug 2011)
New Revision: 33453
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
Log:
JBIDE-9414
CA incorrectly inserts a long-named properties from resource bundles
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-08-02 13:14:32 UTC (rev 33452)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/FaceletsELCompletionProposalComputer.java 2011-08-02 16:13:18 UTC (rev 33453)
@@ -190,7 +190,13 @@
for (TextProposal textProposal : proposals) {
int replacementOffset = beginChangeOffset;
int replacementLength = prefix.getLength();
- String replacementString = prefix.getText().substring(0, replacementLength) + textProposal.getReplacementString();
+ String replacementString = prefix.getText().substring(0, replacementLength);
+ if (textProposal.getReplacementString().trim().startsWith("[") && replacementString.endsWith(".")) { //$NON-NLS-1$ //$NON-NLS-2$
+ // Need to include last '.' (dot) char into the string to replace
+ replacementString = replacementString.substring(0, replacementString.length() - 1);
+ }
+ replacementString += textProposal.getReplacementString();
+
int cursorPosition = replacementString.length();
// Check if it is a long named property to be inserted
@@ -231,6 +237,11 @@
// Closing ']' is to be added
replacementString += ']';
}
+ } else {
+ if (replacementString.endsWith("]") && restOfValue.indexOf(']') != -1) {
+ replacementString = replacementString.substring(0, replacementString.length() -1);
+ cursorPosition = replacementString.length(); // Cursor will be put right after the replacement (not after the closing square bracket in this case)
+ }
}
if (restOfLine.indexOf('}') == -1) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-08-02 13:14:32 UTC (rev 33452)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/computers/XmlELCompletionProposalComputer.java 2011-08-02 16:13:18 UTC (rev 33453)
@@ -187,7 +187,12 @@
for (TextProposal textProposal : proposals) {
int replacementOffset = beginChangeOffset;
int replacementLength = prefix.getLength();
- String replacementString = prefix.getText().substring(0, replacementLength) + textProposal.getReplacementString();
+ String replacementString = prefix.getText().substring(0, replacementLength);
+ if (textProposal.getReplacementString().trim().startsWith("[") && replacementString.endsWith(".")) { //$NON-NLS-1$ //$NON-NLS-2$
+ // Need to include last '.' (dot) char into the string to replace
+ replacementString = replacementString.substring(0, replacementString.length() - 1);
+ }
+ replacementString += textProposal.getReplacementString();
char quoteChar = prefix.isAttributeValue() && prefix.hasOpenQuote() ? prefix.getQuoteChar() : '"';
// if (prefix.isAttributeValue() && !prefix.hasOpenQuote()) {
@@ -234,6 +239,11 @@
// Closing ']' is to be added
replacementString += ']';
}
+ } else {
+ if (replacementString.endsWith("]") && restOfValue.indexOf(']') != -1) {
+ replacementString = replacementString.substring(0, replacementString.length() -1);
+ cursorPosition = replacementString.length(); // Cursor will be put right after the replacement (not after the closing square bracket in this case)
+ }
}
if (prefix.isAttributeValue() && prefix.hasOpenQuote() && endPosition == -1) {
13 years, 5 months
JBoss Tools SVN: r33452 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-08-02 09:14:32 -0400 (Tue, 02 Aug 2011)
New Revision: 33452
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PollerSection.java
Log:
rogue @Override tag breaking build
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PollerSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PollerSection.java 2011-08-02 12:23:54 UTC (rev 33451)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PollerSection.java 2011-08-02 13:14:32 UTC (rev 33452)
@@ -201,7 +201,6 @@
server.removePropertyChangeListener(this);
}
- @Override
public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if( propertyName.equals(IJBossToolingConstants.IGNORE_LAUNCH_COMMANDS)) {
13 years, 5 months
JBoss Tools SVN: r33451 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config.
by jbosstools-commits@lists.jboss.org
Author: lzoubek(a)redhat.com
Date: 2011-08-02 08:23:54 -0400 (Tue, 02 Aug 2011)
New Revision: 33451
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
Log:
JBQA-4861 swtbotext: substitute system properties in config prop file
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2011-08-02 11:44:22 UTC (rev 33450)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2011-08-02 12:23:54 UTC (rev 33451)
@@ -5,6 +5,8 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.jboss.tools.ui.bot.ext.Activator;
@@ -12,13 +14,21 @@
import org.jboss.tools.ui.bot.ext.config.TestConfigurator.Keys;
import org.jboss.tools.ui.bot.ext.config.TestConfigurator.Values;
+/**
+ * This class represents 1 test configuration. Every instance is filled by 1
+ * properties file which defines : which server/seam/esb/bpm .. runtimes will be
+ * present etc
+ *
+ * @author lzoubek(a)redhat.com
+ */
public class TestConfiguration {
private static final Logger log = Logger.getLogger(TestConfiguration.class);
+ private static final Pattern propPattern = Pattern
+ .compile("\\$\\{([^\\}]+)\\}");
+ private Properties configProperties = new Properties();
- private Properties swtTestProperties = new Properties();
-
public String getProperty(String key) {
- return swtTestProperties.getProperty(key);
+ return configProperties.getProperty(key);
}
private final String propName;
@@ -32,28 +42,31 @@
private DBBean db;
private RemoteSystemBean remoteSystem;
private SecureStorage secureStorage;
-
+
public TestConfiguration(String propName, String propFile) throws Exception {
this.propName = propName;
this.propFile = propFile;
if (!"".equals(propFile)) {
if (new File(propFile).exists()) {
log.info("Loading configuration file '" + propFile + "'");
- swtTestProperties.load(new FileInputStream(propFile));
+ configProperties.load(new FileInputStream(propFile));
} else {
- throw new IOException(propName + " " + propFile + " does not exist!");
+ throw new IOException(propName + " " + propFile
+ + " does not exist!");
}
} else {
log.info("Loading default configuration");
- swtTestProperties.load(new FileInputStream(SWTUtilExt
+ configProperties.load(new FileInputStream(SWTUtilExt
.getResourceFile(Activator.PLUGIN_ID,
"/SWTBotTest-default.properties")));
}
// properties got loaded
+ substSystemProperties();
java = JavaBean.fromString(getProperty(Keys.JAVA));
printConfig(Keys.JAVA, java);
- server = ServerBean.fromString(getProperty(Keys.SERVER),getProperty(Keys.SERVER+TestConfigurator.RUNTIME_URL_SUFFIX));
+ server = ServerBean.fromString(getProperty(Keys.SERVER),
+ getProperty(Keys.SERVER + TestConfigurator.RUNTIME_URL_SUFFIX));
printConfig(Keys.SERVER, server);
remoteSystem = RemoteSystemBean.fromString(getProperty(Keys.RS));
printConfig(Keys.RS, remoteSystem);
@@ -64,13 +77,32 @@
jbpm = JBPMBean.fromString(getProperty(Keys.JBPM));
printConfig(Keys.JBPM, jbpm);
db = DBBean.fromString(getProperty(Keys.DB));
- printConfig(Keys.DB,db);
+ printConfig(Keys.DB, db);
secureStorage = SecureStorage.fromString(Keys.SS, getProperty(Keys.SS));
- printConfig("Secure Storage",secureStorage);
+ printConfig("Secure Storage", secureStorage);
checkConfig();
}
-
+ /**
+ * replaces system properties in configuration property values
+ */
+ private void substSystemProperties() {
+ Matcher m;
+ for (Object key : configProperties.keySet()) {
+ String val = configProperties.getProperty(key.toString());
+ if (val != null) {
+ m = propPattern.matcher(val);
+ while (m.find()) {
+ val = val.replaceFirst(
+ propPattern.toString(),
+ Matcher.quoteReplacement(System.getProperty(
+ m.group(1), "${" + m.group(1) + "}")));
+ }
+ configProperties.put(key, val);
+ }
+ }
+ }
+
private static void printConfig(String propName, Object bean) {
if (bean == null) {
log.info("Property " + propName + " not found, " + propName
@@ -81,64 +113,64 @@
}
private boolean checkConfig() throws Exception {
- if (java != null)
- checkDirExists(java.runtimeHome);
- if (seam != null)
- checkDirExists(seam.runtimeHome);
- if (server != null)
- checkDirExists(server.runtimeHome);
- if (esb != null)
- checkDirExists(esb.runtimeHome);
- if (jbpm != null)
- checkDirExists(jbpm.runtimeHome);
- if (db != null) {
- if (!db.internal)
- checkFileExists(db.driverPath);
- if (!db.scriptPath.isEmpty())
- checkFileExists(db.scriptPath);
- }
- // special checks capturing dependency of server on java
- if (java == null
- && server != null
- && !server.withJavaVersion
- .equals(Values.SERVER_WITH_DEFAULT_JAVA)) {
+ if (java != null)
+ checkDirExists(java.runtimeHome);
+ if (seam != null)
+ checkDirExists(seam.runtimeHome);
+ if (server != null)
+ checkDirExists(server.runtimeHome);
+ if (esb != null)
+ checkDirExists(esb.runtimeHome);
+ if (jbpm != null)
+ checkDirExists(jbpm.runtimeHome);
+ if (db != null) {
+ if (!db.internal)
+ checkFileExists(db.driverPath);
+ if (!db.scriptPath.isEmpty())
+ checkFileExists(db.scriptPath);
+ }
+ // special checks capturing dependency of server on java
+ if (java == null
+ && server != null
+ && !server.withJavaVersion
+ .equals(Values.SERVER_WITH_DEFAULT_JAVA)) {
+ throw new Exception(
+ "Server is configured to run with java version="
+ + server.withJavaVersion
+ + " but no JAVA is configured");
+ }
+ if (java != null && server != null) {
+ if (!java.version.equals(server.withJavaVersion)
+ && !Values.SERVER_WITH_DEFAULT_JAVA
+ .equals(server.withJavaVersion)) {
throw new Exception(
"Server is configured to run with java version="
+ server.withJavaVersion
- + " but no JAVA is configured");
+ + " but JAVA is configured with "
+ + java.version);
}
- if (java != null && server!=null) {
- if (!java.version.equals(server.withJavaVersion)
- && !Values.SERVER_WITH_DEFAULT_JAVA
- .equals(server.withJavaVersion)) {
- throw new Exception(
- "Server is configured to run with java version="
- + server.withJavaVersion
- + " but JAVA is configured with "
- + java.version);
- }
- }
+ }
- if (server!=null) {
- if (server.remoteSystem!=null) {
- if (remoteSystem!=null) {
- if (!server.remoteSystem.equals(remoteSystem.host)) {
- throw new Exception("Server is configured with remote system called "
+ if (server != null) {
+ if (server.remoteSystem != null) {
+ if (remoteSystem != null) {
+ if (!server.remoteSystem.equals(remoteSystem.host)) {
+ throw new Exception(
+ "Server is configured with remote system called "
+ server.remoteSystem
- +" but RS is configured as "
+ + " but RS is configured as "
+ remoteSystem.host
- +" these names must be equal");
- }
+ + " these names must be equal");
}
- else {
- throw new Exception(
- "Server is configured to run with remote system "
- + server.remoteSystem
- + " but no RS is configured");
- }
+ } else {
+ throw new Exception(
+ "Server is configured to run with remote system "
+ + server.remoteSystem
+ + " but no RS is configured");
}
}
- return true;
+ }
+ return true;
}
private static void checkDirExists(String dir) throws FileNotFoundException {
@@ -147,10 +179,12 @@
+ "' does not exist or is not directory");
}
}
-
- private static void checkFileExists(String path) throws FileNotFoundException {
+
+ private static void checkFileExists(String path)
+ throws FileNotFoundException {
if (!new File(path).exists() || !new File(path).isFile()) {
- throw new FileNotFoundException("File " + path + " not exist or is not file");
+ throw new FileNotFoundException("File " + path
+ + " not exist or is not file");
}
}
@@ -177,17 +211,19 @@
public String getPropName() {
return propName;
}
-
+
public JBPMBean getJBPM() {
return jbpm;
}
-
+
public DBBean getDB() {
return db;
}
+
public RemoteSystemBean getRemoteSystem() {
return remoteSystem;
}
+
public SecureStorage getSecureStorage() {
return secureStorage;
}
13 years, 5 months
JBoss Tools SVN: r33450 - trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-08-02 07:44:22 -0400 (Tue, 02 Aug 2011)
New Revision: 33450
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithExprHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithNoExprHyperlinkPartitioner.java
Log:
JBIDE-9288
Open On for bundle messages doesn't work for CDI projects with International Module enabled
Deprecated hyperlink classes were removed
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithExprHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithExprHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithExprHyperlinkPartitioner.java 2011-08-02 11:44:22 UTC (rev 33450)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.text.ext.facelets.hyperlink;
-
-import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPElementAttributeValueHyperlinkPartitioner;
-
-public class FaceletsAttributeValueWithExprHyperlinkPartitioner extends JSPElementAttributeValueHyperlinkPartitioner {
- public static final String FACELETS_ATTRIBUTE_VALUE_WITH_EXPR_PARTITION = "org.jboss.tools.common.text.ext.jsp.FACELETS_ATTRIBUTE_VALUE_WITH_EXPR"; //$NON-NLS-1$
-
- protected String getPartitionType() {
- return FACELETS_ATTRIBUTE_VALUE_WITH_EXPR_PARTITION;
- }
-
- public boolean excludes(String partitionType, IDocument document, IHyperlinkRegion superRegion) {
- if (JSPExprHyperlinkPartitioner.JSP_EXPRESSION_PARTITION.equals(partitionType))
- return true;
- return false;
- }
-
- public String getExclusionPartitionType() {
- return null;
- }
-
-}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithNoExprHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithNoExprHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/src/org/jboss/tools/jsf/text/ext/facelets/hyperlink/FaceletsAttributeValueWithNoExprHyperlinkPartitioner.java 2011-08-02 11:44:22 UTC (rev 33450)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.text.ext.facelets.hyperlink;
-
-
-import org.eclipse.jface.text.IDocument;
-
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPElementAttributeValueHyperlinkPartitioner;
-
-public class FaceletsAttributeValueWithNoExprHyperlinkPartitioner extends JSPElementAttributeValueHyperlinkPartitioner {
- public static final String FACELETS_ATTRIBUTE_VALUE_WITH_NO_EXPR_PARTITION = "org.jboss.tools.common.text.ext.jsp.FACELETS_ATTRIBUTE_VALUE_WITH_NO_EXPR"; //$NON-NLS-1$
-
- protected String getPartitionType() {
- return FACELETS_ATTRIBUTE_VALUE_WITH_NO_EXPR_PARTITION;
- }
-
- public boolean excludes(String partitionType, IDocument document, IHyperlinkRegion superRegion) {
- if (JSPExprHyperlinkPartitioner.JSP_EXPRESSION_PARTITION.equals(partitionType))
- return true;
- return false;
- }
-
- public String getExclusionPartitionType() {
- return null;
- }
-
-
-}
13 years, 5 months
JBoss Tools SVN: r33449 - in trunk: jsf/plugins/org.jboss.tools.jsf.text.ext.facelets and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-08-02 07:43:54 -0400 (Tue, 02 Aug 2011)
New Revision: 33449
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
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
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFXMLContextParamLinkHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java
Log:
JBIDE-9288
Open On for bundle messages doesn't work for CDI projects with International Module enabled
Deprecated hyperlink classes were removed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleBasenameHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2011 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
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.jsf.text.ext.hyperlink;
@@ -19,23 +19,19 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.ClassHyperlink;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.StructuredModelWrapper;
@@ -55,8 +51,6 @@
*/
public class BundleBasenameHyperlink extends ClassHyperlink {
private static final String FILESYSTEMS = "/FileSystems/"; //$NON-NLS-1$
- private static final String LIB = "/lib-"; //$NON-NLS-1$
- private static final String SEPARATOR = "/"; //$NON-NLS-1$
protected void doHyperlink(IRegion region) {
try {
@@ -336,31 +330,7 @@
return null;
}
}
-
- private IFile getFileToOpenOld(String fileName, String fileExt) {
- IFile documentFile = getFile();
- try {
- IProject project = documentFile.getProject();
-
- String name = fileName.replace('.','/')+ (fileExt != null ? "." + fileExt : ""); //$NON-NLS-1$ //$NON-NLS-2$
-
- if(project == null || !project.isOpen()) return null;
- if(!project.hasNature(JavaCore.NATURE_ID)) return null;
- IJavaProject javaProject = JavaCore.create(project);
- IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() != IClasspathEntry.CPE_SOURCE) continue;
- IFile file = (IFile)project.getFile(es[i].getPath().removeFirstSegments(1) + "/" + name); //$NON-NLS-1$
- if(file != null && file.exists()) return file;
- }
- return null;
- } catch (CoreException x) {
- JSFExtensionsPlugin.log("", x); //$NON-NLS-1$
- return null;
- }
- }
-
IRegion fLastRegion = null;
/**
* @see com.ibm.sse.editor.AbstractHyperlink#doGetHyperlinkRegion(int)
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/BundleHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.jsf.text.ext.hyperlink;
-
-import java.text.MessageFormat;
-import java.util.Properties;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegment;
-import org.jboss.tools.common.text.ext.hyperlink.XModelBasedHyperlink;
-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.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner.ExpressionStructure;
-import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * @author Jeremy
- */
-public class BundleHyperlink extends XModelBasedHyperlink {
-
- private static final String VIEW_TAGNAME = "view"; //$NON-NLS-1$
- private static final String LOCALE_ATTRNAME = "locale"; //$NON-NLS-1$
- private static final String PREFIX_SEPARATOR = ":"; //$NON-NLS-1$
-
- private String getPageLocale(IRegion region) {
- if(getDocument() == null || region == null) return null;
-
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(getDocument());
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return null;
-
- Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
- if (!(n instanceof Attr) ) return null;
-
- Element el = ((Attr)n).getOwnerElement();
-
- Element jsfCoreViewTag = null;
- String nodeToFind = PREFIX_SEPARATOR + VIEW_TAGNAME;
-
- while (el != null) {
- if (el.getNodeName() != null && el.getNodeName().endsWith(nodeToFind)) {
- jsfCoreViewTag = el;
- break;
- }
- Node parent = el.getParentNode();
- el = (parent instanceof Element ? (Element)parent : null);
- }
-
- if (jsfCoreViewTag == null || !jsfCoreViewTag.hasAttribute(LOCALE_ATTRNAME)) return null;
-
- String locale = Utils.trimQuotes((jsfCoreViewTag.getAttributeNode(LOCALE_ATTRNAME)).getValue());
- if (locale == null || locale.length() == 0) return null;
- return locale;
- } finally {
- smw.dispose();
- }
- }
-
- IRegion fLastRegion = null;
-
- /**
- * @see com.ibm.sse.editor.AbstractHyperlink#doGetHyperlinkRegion(int)
- */
- protected IRegion doGetHyperlinkRegion(int offset) {
- fLastRegion = JSPBundleHyperlinkPartitioner.getRegion(getDocument(), offset);
- return fLastRegion;
- }
-
- protected String getRequestMethod() {
- return requestProperties != null && requestProperties.getProperty(WebPromptingProvider.KEY) == null ?
- WebPromptingProvider.JSF_OPEN_BUNDLE : WebPromptingProvider.JSF_OPEN_KEY;
- }
-
- protected Properties getRequestProperties(IRegion region) {
- ELContext context = JSPExprHyperlinkPartitioner.getELContext(getDocument());
- if(context != null){
- ExpressionStructure eStructure = JSPExprHyperlinkPartitioner.getExpression(context, getOffset());
- if(eStructure != null){
- ELInvocationExpression invocationExpression = JSPExprHyperlinkPartitioner.getInvocationExpression(eStructure.reference, eStructure.expression, getOffset());
- if(invocationExpression != null){
- for(ELResolver resolver : context.getElResolvers()){
- ELResolution resolution = resolver.resolve(context, invocationExpression, getOffset());
- if(resolution==null) {
- continue;
- }
- ELSegment segment = resolution.findSegmentByOffset(getOffset()-eStructure.reference.getStartPosition());
-
- if (segment != null && segment.isResolved() && segment instanceof MessagePropertyELSegment) {
- MessagePropertyELSegment mpSegment = (MessagePropertyELSegment)segment;
- String bundleBasename = mpSegment.getBaseName();
- String property = mpSegment.isBundle() ? null : trimQuotes(mpSegment.getToken().getText());
- String locale = getPageLocale(region);
-
- Properties p = new Properties();
- if (bundleBasename != null) {
- p.put(WebPromptingProvider.BUNDLE, bundleBasename);
- }
-
- if (property != null) {
- p.put(WebPromptingProvider.KEY, property);
- }
-
- if (locale != null) {
- p.setProperty(WebPromptingProvider.LOCALE, locale);
- }
-
- return p;
- }
- }
- }
- }
- }
- return null;
- }
-
- private String trimQuotes(String value) {
- if(value == null)
- return null;
-
- if(value.startsWith("'") || value.startsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
- value = value.substring(1);
- }
-
- if(value.endsWith("'") || value.endsWith("\"")) { //$NON-NLS-1$ //$NON-NLS-2$
- value = value.substring(0, value.length() - 1);
- }
- return value;
- }
-
-
- /**
- * Returns the text to be shown for Open action
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- Properties p = getRequestProperties(fLastRegion);
- String baseName = p == null ? null : p.getProperty(WebPromptingProvider.BUNDLE);
- String propertyName = p == null ? null : p.getProperty(WebPromptingProvider.KEY);
- if (baseName == null || propertyName == null)
- return MessageFormat.format(Messages.OpenA, Messages.BundleProperty);
-
- return MessageFormat.format(Messages.OpenBundleProperty, propertyName, baseName);
- }
-
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ConverterHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -58,7 +58,7 @@
}
private String getConverterID (IRegion region) {
- IRegion localRegion = getRegion(region.getOffset());
+ getRegion(region.getOffset());
String converterID = null;
if(getDocument() != null && region != null) {
try {
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ExpressionHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 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.jsf.text.ext.hyperlink;
-
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
-import org.jboss.tools.jsf.text.ext.JSFExtensionsPlugin;
-import org.jboss.tools.jsf.text.ext.JSFTextExtMessages;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner.ExpressionStructure;
-
-/**
- * @author Daniel
- */
-public class ExpressionHyperlink extends AbstractHyperlink{
- private JavaMemberELSegment javaSegment=null;
-
- protected IRegion doGetHyperlinkRegion(int offset) {
- javaSegment = null;
- ELContext context = JSPExprHyperlinkPartitioner.getELContext(getDocument());
- ExpressionStructure eStructure = JSPExprHyperlinkPartitioner.getExpression(context, offset);
- ELInvocationExpression invocationExpression = JSPExprHyperlinkPartitioner.getInvocationExpression(eStructure.reference, eStructure.expression, offset);
- if(invocationExpression != null){
- for(ELResolver resolver : context.getElResolvers()){
- ELResolution resolution = resolver.resolve(context, invocationExpression, offset);
- if(resolution==null) {
- continue;
- }
- ELSegment segment = resolution.findSegmentByOffset(offset-eStructure.reference.getStartPosition());
- if(segment != null){
- if(segment instanceof JavaMemberELSegment){
- javaSegment = (JavaMemberELSegment)segment;
- if(javaSegment.getJavaElement() != null){
- Region region = new Region(eStructure.reference.getStartPosition()+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
-
- return region;
- }
- }
- }
- }
- }
- return null;
- }
-
- protected void doHyperlink(IRegion region) {
- IEditorPart part = null;
-
- if(javaSegment != null){
- if (javaSegment.getJavaElement() != null){
- try{
- part = JavaUI.openInEditor(javaSegment.getJavaElement());
- }catch(JavaModelException ex){
- JSFExtensionsPlugin.log(ex);
- }catch(PartInitException ex){
- JSFExtensionsPlugin.log(ex);
- }
- if (part != null) {
- JavaUI.revealInEditor(part, javaSegment.getJavaElement());
- }
- }
- }
- if (part == null)
- openFileFailed();
- }
-
- public String getHyperlinkText() {
- return JSFTextExtMessages.OpenJavaElement;
- }
-
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/ForIDHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -18,8 +18,6 @@
import org.eclipse.jface.text.Region;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
-import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
-import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
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.StructuredSelectionHelper;
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.text.ext.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.Region;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.PositionHolder;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlink;
-import org.jboss.tools.common.text.ext.util.StructuredSelectionHelper;
-import org.jboss.tools.jsf.text.ext.JSFTextExtMessages;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner.ExpressionStructure;
-
-/**
- *
- * @author Victor V. Rubezhny
- *
- */
-public class JSF2CCAttrsHyperlink extends AbstractHyperlink {
- IRegion fLastRegion = null;
-
- @Override
- protected IRegion doGetHyperlinkRegion(int offset) {
- fLastRegion = JSF2CCAttrsHyperlinkPartitioner.getRegion(getDocument(), offset);
- return fLastRegion;
- }
-
- @Override
- protected void doHyperlink(IRegion region) {
- XModelObject attrObject = null;
- IRegion attrRegion = null;
-
- ELContext context = JSPExprHyperlinkPartitioner.getELContext(getDocument());
- if(context != null){
- ExpressionStructure eStructure = JSPExprHyperlinkPartitioner.getExpression(context, getOffset());
- if(eStructure != null){
- ELInvocationExpression invocationExpression = JSPExprHyperlinkPartitioner.getInvocationExpression(eStructure.reference, eStructure.expression, getOffset());
- if(invocationExpression != null){
-
- ELResolution resolution = JSF2CCAttrsHyperlinkPartitioner.getResolution(context, invocationExpression, getOffset()-eStructure.reference.getStartPosition(), getOffset());
- if (resolution == null)
- return;
-
- ELSegment segment = resolution.findSegmentByOffset(getOffset()-eStructure.reference.getStartPosition());
- if(segment != null && segment.isResolved()){
- // Find text for the part of operand
- StringBuffer sbBuffer = new StringBuffer();
- for (ELSegment s : resolution.getSegments()) {
- sbBuffer.append(s.getToken().getText());
- if (s == segment) {
- break;
- }
- sbBuffer.append('.'); // Use default separator for ELs here
- }
-
- String text = sbBuffer.toString();
-
- attrObject = JSF2CCAttrsHyperlinkPartitioner.findJSF2CCAttributeXModelObject(text, getFile());
- if (attrObject != null) {
- PositionHolder h = PositionHolder.getPosition(attrObject, null);
- h.update();
- if (h.getStart() == -1 || h.getEnd() == -1) {
- openFileFailed();
- return;
- }
- attrRegion = new Region(h.getStart(), h.getEnd() - h.getStart());
- }
- }
- }
- }
- }
- if (attrObject != null && attrRegion != null) {
- IFile file = (IFile)attrObject.getAdapter(IFile.class);
- if (file != null) {
- if (openFileInEditor(file) != null) {
- StructuredSelectionHelper.setSelectionAndRevealInActiveEditor(attrRegion);
- return;
- }
- }
- }
-
- openFileFailed();
- }
-
- @Override
- public String getHyperlinkText() {
- return JSFTextExtMessages.OpenJsf2CCAttribute;
- }
-
-}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlinkPartitioner.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSF2CCAttrsHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.text.ext.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.text.IDocument;
-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.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
-import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
-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.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.Utils;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner.ExpressionStructure;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
-import org.w3c.dom.Document;
-
-/**
- *
- * @author Victor V. Rubezhny
- *
- */
-public class JSF2CCAttrsHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
- public static final String JSF2_CC_ATTRIBUTE_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSF2_CC_ATTRIBUTE"; //$NON-NLS-1$
-
- protected String getPartitionType() {
- return JSF2_CC_ATTRIBUTE_PARTITION;
- }
-
- /**
- * Recognizes the region as having JSF2 CC Attribute reference
- */
- public boolean recognize(IDocument document, IHyperlinkRegion region) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(document);
- try {
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return false;
-
- Utils.findNodeForOffset(xmlDocument, region.getOffset());
-
- return (getRegion(document, region.getOffset()) != null);
- } finally {
- smw.dispose();
- }
- }
-
- @Override
- protected IHyperlinkRegion parse(IDocument document, IHyperlinkRegion superRegion) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(document);
- try {
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return null;
-
- Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
- if (!recognize(document, superRegion)) return null;
- IHyperlinkRegion r = getRegion(document, superRegion.getOffset());
- if (r == null) return null;
-
- String axis = getAxis(document, superRegion);
- String contentType = superRegion.getContentType();
- String type = getPartitionType();
- int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
- int offset = superRegion.getOffset();
-
- IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
- return region;
- } finally {
- smw.dispose();
- }
- }
-
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) + "/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
- }
-
- public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
- ELContext context = JSPExprHyperlinkPartitioner.getELContext(document);
- if(context != null){
- ExpressionStructure eStructure = JSPExprHyperlinkPartitioner.getExpression(context, offset);
- if(eStructure != null){
- ELInvocationExpression invocationExpression = JSPExprHyperlinkPartitioner.getInvocationExpression(eStructure.reference, eStructure.expression, offset);
- if(invocationExpression != null){
- ELSegment segment = decide(context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition(), offset, getFile(document));
- if (segment != null) {
- IHyperlinkRegion region = new HyperlinkRegion(eStructure.reference.getStartPosition() + segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength(), null, null, null);
- return region;
- }
- }
- }
- }
- return null;
- }
-
- static String[] vs = {"cc.attrs", "compositeComponent.attrs"};
-
- public static XModelObject findJSF2CCAttributeXModelObject(String varName, IFile file) {
- XModelObject xModelObject = EclipseResourceUtil.createObjectForResource(file);
- if(xModelObject == null) return null;
- if(!"FileJSF2Component".equals(xModelObject.getModelEntity().getName())) return null;
-
- IJavaProject javaProject = EclipseResourceUtil.getJavaProject(file.getProject());
- XModelObject is = xModelObject.getChildByPath("Interface");
- if(is != null && javaProject != null) {
- for (int i = 0; i < vs.length; i++) {
- if (vs[i].equals(varName)) return is;
- }
- XModelObject[] cs = is.getChildren("JSF2ComponentAttribute");
-
- for (int i = 0; i < cs.length; i++) {
- String name = cs[i].getAttributeValue("name");
- String[] names = {vs[0] + "." + name, vs[1] + "." + name};
- for (String n: names) {
- if (n.equals(varName)) return cs[i];
- }
- }
- }
- return null;
- }
-
- private static IFile getFile(IDocument document) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- try {
- smw.init(document);
- return smw.getFile();
- } finally {
- smw.dispose();
- }
- }
-
- private static ELSegment decide(ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset, int globalOffset, IFile file){
- ELResolution resolution = getResolution(context, invocationExpression, offset, globalOffset);
- if (resolution == null)
- return null;
-
- ELSegment segment = resolution.findSegmentByOffset(offset);
- if(segment != null && segment.isResolved()){
- // Find text for the part of operand
- StringBuffer sbBuffer = new StringBuffer();
- for (ELSegment s : resolution.getSegments()) {
- sbBuffer.append(s.getToken().getText());
- if (s == segment) {
- break;
- }
- sbBuffer.append('.'); // Use default separator for ELs here
- }
-
- String text = sbBuffer.toString();
- if (findJSF2CCAttributeXModelObject(text, file) != null) {
- return segment;
- }
- }
- return null;
- }
-
- static ELResolution getResolution(ELContext context, ELInvocationExpression invocationExpression, int offset, int globalOffset) {
- for(ELResolver resolver : context.getElResolvers()){
- ELResolution resolution = resolver.resolve(context, invocationExpression, globalOffset);
- if(resolution==null) {
- continue;
- }
- ELSegment segment = resolution.findSegmentByOffset(offset);
- if(segment != null && segment.isResolved()){
- return resolution;
- }
- }
- return null;
-
- }
-
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFXMLContextParamLinkHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFXMLContextParamLinkHyperlinkPartitioner.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSFXMLContextParamLinkHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -124,11 +124,9 @@
int start = Utils.getValueStart(text);
if(start < 0) continue;
int end = Utils.getValueEnd(text);
- if (paramNameValue == null) {
- paramNameValue = Utils.trimQuotes(document.get(start, end - start));
- } else {
- paramNameValue += Utils.trimQuotes(document.get(start, end - start));
- }
+ if (paramNameValue == null)
+ paramNameValue = "";
+ paramNameValue += Utils.trimQuotes(document.get(start, end - start));
}
}
if (paramNameValue == null) return false;
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.jsf.text.ext.hyperlink;
-
-import org.eclipse.jface.text.IDocument;
-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.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegment;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
-import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
-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.util.StructuredModelWrapper;
-import org.jboss.tools.common.text.ext.util.Utils;
-import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner.ExpressionStructure;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
-import org.jboss.tools.jst.text.ext.util.TaglibManagerWrapper;
-import org.w3c.dom.Document;
-
-/**
- * @author Jeremy
- */
-public class JSPBundleHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
- public static final String JSP_BUNDLE_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_BUNDLE"; //$NON-NLS-1$
-
- protected String getPartitionType() {
- return JSP_BUNDLE_PARTITION;
- }
-
- /**
- * @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- protected IHyperlinkRegion parse(IDocument document, IHyperlinkRegion superRegion) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(document);
- try {
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return null;
-
- Utils.findNodeForOffset(xmlDocument, superRegion.getOffset());
- if (!recognize(document, superRegion)) return null;
- IHyperlinkRegion r = getRegion(document, superRegion.getOffset());
- if (r == null) return null;
-
- String axis = getAxis(document, superRegion);
- String contentType = superRegion.getContentType();
- String type = getPartitionType();
- int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
- int offset = superRegion.getOffset();
-
- IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
- return region;
- } finally {
- smw.dispose();
- }
- }
-
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) + "/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
- }
-
- public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
- ELContext context = JSPExprHyperlinkPartitioner.getELContext(document);
- if(context != null){
- ExpressionStructure eStructure = JSPExprHyperlinkPartitioner.getExpression(context, offset);
- if(eStructure != null){
- ELInvocationExpression invocationExpression = JSPExprHyperlinkPartitioner.getInvocationExpression(eStructure.reference, eStructure.expression, offset);
- if(invocationExpression != null){
- ELSegment segment = decide(context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition(), offset);
- if (segment != null) {
- IHyperlinkRegion region = new HyperlinkRegion(eStructure.reference.getStartPosition() + segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength(), null, null, null);
- return region;
- }
- }
- }
- }
- return null;
- }
-
- private static ELSegment decide(ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset, int globalOffset){
- for(ELResolver resolver : context.getElResolvers()){
- ELResolution resolution = resolver.resolve(context, invocationExpression, globalOffset);
- if(resolution==null) {
- continue;
- }
- ELSegment segment = resolution.findSegmentByOffset(offset);
- if(segment != null && segment.isResolved()){
- if (segment != null && segment.isResolved() && segment instanceof MessagePropertyELSegment) {
- return segment;
- }
- }
- }
- return null;
- }
-
- /**
- * @see com.ibm.sse.editor.extensions.hyperlink.IHyperlinkPartitionRecognizer#recognize(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- public boolean recognize(IDocument document, IHyperlinkRegion region) {
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(document);
- try {
- Document xmlDocument = smw.getDocument();
- if (xmlDocument == null) return false;
-
- Utils.findNodeForOffset(xmlDocument, region.getOffset());
-
- return (getRegion(document, region.getOffset()) != null);
- } finally {
- smw.dispose();
- }
- }
-
- /**
- * @deprecated
- */
- protected String[] getLoadBundleTagPrefixes(IDocument document, int offset) {
- TaglibManagerWrapper tmw = new TaglibManagerWrapper();
- tmw.init(document, offset);
- if(!tmw.exists()) return null;
-
- return new String[] {tmw.getCorePrefix()};
- }
-}
\ No newline at end of file
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPExprHyperlinkPartitioner.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.jsf.text.ext.hyperlink;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.jboss.tools.common.el.core.ELReference;
-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.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
-import org.jboss.tools.common.el.core.resolver.MessagePropertyELSegment;
-import org.jboss.tools.common.text.ext.hyperlink.AbstractHyperlinkPartitioner;
-import org.jboss.tools.common.text.ext.hyperlink.HyperlinkRegion;
-import org.jboss.tools.common.text.ext.hyperlink.IExclusiblePartitionerRecognition;
-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.util.StructuredModelWrapper;
-import org.jboss.tools.jsf.text.ext.JSFExtensionsPlugin;
-import org.jboss.tools.jst.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
-import org.jboss.tools.jst.web.kb.PageContextFactory;
-
-/**
- * @author Jeremy and Daniel
- */
-@SuppressWarnings("restriction")
-public class JSPExprHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer, IExclusiblePartitionerRecognition {
- public static final String JSP_EXPRESSION_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_EXPRESSION"; //$NON-NLS-1$
- public static final String EXPRESSION_PARTITION = "org.jboss.tools.common.text.ext.jsp.EXPRESSION"; //$NON-NLS-1$
- public static final String DOT_EXPRESSION_PARTITION = "org.jboss.tools.common.text.ext.jsp.DOT_EXPRESSION"; //$NON-NLS-1$
-
- private static final String DOT = ".";
-
- private boolean jspExpression = false;
-
- private boolean dotExpression = false;
-
- protected String getPartitionType() {
- if(dotExpression)
- return DOT_EXPRESSION_PARTITION;
-
- if(jspExpression)
- return EXPRESSION_PARTITION;
- else
- return JSP_EXPRESSION_PARTITION;
- }
-
- /**
- * @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- protected IHyperlinkRegion parse(IDocument document, IHyperlinkRegion superRegion) {
- IHyperlinkRegion r = getRegion(document, superRegion.getOffset());
- if (r == null) return null;
-
- String axis = getAxis(document, superRegion);
- String contentType = superRegion.getContentType();
- String type = getPartitionType();
- int length = r.getLength() - (superRegion.getOffset() - r.getOffset());
- int offset = superRegion.getOffset();
-
- IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType, type);
- return region;
- }
-
- protected String getAxis(IDocument document, IHyperlinkRegion superRegion) {
- if (superRegion.getAxis() == null || superRegion.getAxis().length() == 0) {
- return JSPRootHyperlinkPartitioner.computeAxis(document, superRegion.getOffset()) + "/"; //$NON-NLS-1$
- }
- return superRegion.getAxis();
- }
-
- private IHyperlinkRegion getRegion(IDocument document, final int offset) {
- jspExpression = false;
- dotExpression = false;
- ELContext context = getELContext(document);
- if(context != null){
- ExpressionStructure eStructure = getExpression(context, offset);
- if(eStructure != null){
- ELInvocationExpression invocationExpression = getInvocationExpression(eStructure.reference, eStructure.expression, offset);
- if(invocationExpression != null){
- jspExpression = decide(context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition(), offset);
- if(jspExpression){
- IHyperlinkRegion region = new HyperlinkRegion(eStructure.reference.getStartPosition() + invocationExpression.getStartPosition(), invocationExpression.getLength(), null, null, null);
- return region;
- }
- dotExpression = checkDot(document, offset, context, eStructure.expression, invocationExpression, offset-eStructure.reference.getStartPosition());
-
- IHyperlinkRegion region = new HyperlinkRegion(eStructure.reference.getStartPosition() + invocationExpression.getStartPosition(), eStructure.expression.getLength(), null, null, null);
- return region;
- }
- }
- }
- return null;
- }
-
- public static ExpressionStructure getExpression(ELContext context, final int offset){
- ELReference[] references = context.getELReferences();
-
- for(ELReference reference : references){
- for(ELExpression expression : reference.getEl()){
- if (reference.getStartPosition()+expression.getStartPosition() <= offset && reference.getStartPosition()+expression.getEndPosition() > offset)
- return new ExpressionStructure(reference, expression);
- }
- }
- return null;
- }
-
- public static ELContext getELContext(IDocument document){
- StructuredModelWrapper smw = new StructuredModelWrapper();
- smw.init(document);
- try {
- IFile file = smw.getFile();
- ELContext context = PageContextFactory.getInstance().createPageContext(file);
- return context;
- } finally {
- smw.dispose();
- }
- }
-
- public static ELInvocationExpression getInvocationExpression(ELReference reference, ELExpression expression, int offset){
- if(expression == null || reference == null)
- return null;
-
- for(ELInvocationExpression ie : expression.getInvocations()){
- if (reference.getStartPosition()+ie.getStartPosition() <= offset && reference.getStartPosition()+ie.getEndPosition() > offset) {
- return ie;
- }
- }
- return null;
- }
-
- public boolean decide(ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset, int globalOffset){
- for(ELResolver resolver : context.getElResolvers()){
- ELResolution resolution = resolver.resolve(context, invocationExpression, globalOffset);
- if(resolution==null) {
- continue;
- }
- ELSegment segment = resolution.findSegmentByOffset(offset);
- if(segment != null && segment.isResolved()){
- if(segment instanceof JavaMemberELSegment){
- JavaMemberELSegment javaSegment = (JavaMemberELSegment)segment;
- if(javaSegment.getJavaElement() != null){
- return true;
- }
- }
- if (segment instanceof MessagePropertyELSegment) {
- return false;
- }
- }
- }
- return false;
- }
-
- public boolean checkDot(IDocument document, int superOffset, ELContext context, ELExpression expression, ELInvocationExpression invocationExpression, int offset){
- try{
- String text = document.get(superOffset, 1);
- if(DOT.equals(text)){
- if(decide(context, expression, invocationExpression, offset+1, superOffset+1))
- return true;
- else if(decide(context, expression, invocationExpression, offset-1, superOffset-1))
- return true;
- }
- }catch(BadLocationException ex){
- JSFExtensionsPlugin.log(ex);
- }
- return false;
- }
-
- /**
- * @see com.ibm.sse.editor.extensions.hyperlink.IHyperlinkPartitionRecognizer#recognize(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
- */
- public boolean recognize(IDocument document, IHyperlinkRegion region) {
- if(document == null || region == null) return false;
-
- return (getRegion(document, region.getOffset()) != null);
- }
-
- public boolean excludes(String partitionType, IDocument document, IHyperlinkRegion superRegion) {
- return false;
- }
-
- public String getExclusionPartitionType() {
- return getPartitionType();
- }
-
- public static class ExpressionStructure{
- public ELReference reference;
- public ELExpression expression;
-
- public ExpressionStructure(ELReference reference, ELExpression expression){
- this.reference = reference;
- this.expression = expression;
- }
-
- }
-
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPTagAttributeHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -163,7 +163,6 @@
Node n = Utils.findNodeForOffset(xmlDocument, region.getOffset());
- Node node = null;
if (n instanceof Attr) {
return ((Attr)n).getName();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/plugin.xml 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.facelets/plugin.xml 2011-08-02 11:43:54 UTC (rev 33449)
@@ -92,7 +92,7 @@
</contentType>
</hyperlinkPartitioner>
- <hyperlinkPartitioner
+ <!-- hyperlinkPartitioner
id="org.jboss.tools.common.text.ext.jsf.facelets.hyperlink.FaceletsAttributeValueWithExprHyperlinkPartitioner"
class="org.jboss.tools.jsf.text.ext.facelets.hyperlink.FaceletsAttributeValueWithExprHyperlinkPartitioner">
<contentType id="org.eclipse.jst.jsp.core.jspsource">
@@ -165,9 +165,9 @@
<axis path="*/[http://java.sun.com/jsf/facelets]:param/value/" />
</partitionType>
</contentType>
- </hyperlinkPartitioner>
+ </hyperlinkPartitioner -->
- <hyperlinkPartitioner
+ <!-- hyperlinkPartitioner
id="org.jboss.tools.common.text.ext.jsf.facelets.hyperlink.FaceletsAttributeValueWithNoExprHyperlinkPartitioner"
class="org.jboss.tools.jsf.text.ext.facelets.hyperlink.FaceletsAttributeValueWithNoExprHyperlinkPartitioner">
<contentType id="org.eclipse.jst.jsp.core.jspsource">
@@ -195,7 +195,7 @@
<axis path="*/[http://java.sun.com/jsf/facelets]:component/hotkey/" />
</partitionType>
</contentType>
- </hyperlinkPartitioner>
+ </hyperlinkPartitioner -->
<hyperlinkPartitioner
id="org.jboss.tools.jsf.text.ext.facelets.hyperlink.FaceletsCSSClassHyperlinkPartitioner"
Deleted: 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/SeamELInJavaStringHyperlink.java 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-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;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.IRegion;
-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.core.ISeamMessages;
-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, ISeamMessages> fMessages;
- /**
- * Creates a new Seam EL in Java string hyperlink.
- */
- SeamELInJavaStringHyperlink(IRegion region, IJavaElement[] elements) {
- Assert.isNotNull(region);
- Assert.isNotNull(elements);
-
- fRegion = region;
- fElements = elements;
- fMessages = null;
- }
-
- /**
- * Creates a new Seam EL in Java string hyperlink for messages.
- */
- SeamELInJavaStringHyperlink(IRegion region, Map<String, ISeamMessages> 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
- */
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#open()
- * @since 3.1
- */
- public void open() {
- 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, ISeamMessages> messages = fMessages;
- if (messages == null || messages.isEmpty()) {
- // Nothing to open
- return;
- }
-
- for (String property : messages.keySet()) {
- ISeamMessages messagesComponent = messages.get(property);
- Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.isEmpty())
- 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
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- if (fElements == null || fElements.length == 0)
- return MessageFormat.format(Messages.OpenA, Messages.Bean);
-
- return MessageFormat.format(Messages.Open, fElements[0].getElementName());
- }
-
-
-}
Deleted: 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 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2011 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-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.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
-import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-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.ISeamMessages;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
-import org.jboss.tools.seam.text.ext.SeamExtPlugin;
-
-public class SeamELInJavaStringHyperlinkDetector extends
- AbstractHyperlinkDetector {
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer,
- IRegion region, boolean canShowMultipleHyperlinks) {
- ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
- if (region == null /*|| canShowMultipleHyperlinks*/ || !(textEditor instanceof JavaEditor))
- return null;
-
- int offset= region.getOffset();
-
- IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, false);
- if (input == null)
- return null;
-
- IDocument document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- IRegion wordRegion = JavaWordFinder.findWord(document, offset);
-
- if (wordRegion == null)
- return null;
-
- int[] range = null;
- FastJavaPartitionScanner scanner = new FastJavaPartitionScanner();
- scanner.setRange(document, 0, document.getLength());
- while(true) {
- IToken token = scanner.nextToken();
- if(token == null || token.isEOF()) break;
- int start = scanner.getTokenOffset();
- int end = start + scanner.getTokenLength();
- if(start <= offset && end >= offset) {
- range = new int[]{start, end};
- break;
- }
- if(start > offset) break;
- }
-
- if (!checkStartPosition(document, offset))
- return null;
-
- IFile file = null;
-
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- // Ignore. It is probably because of Java element's resource is not found
- }
-
- if(range == null) range = new int[]{0, document.getLength()};
-
- Map<String, ISeamMessages> messages = findMessagesComponents(document, file, wordRegion, range[0], range[1]);
- if (messages != null && !messages.isEmpty())
- 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)};
-
- return null;
- }
-
- public static IJavaElement[] findJavaElements(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();
-
- String prefix= engine.getJavaElementExpression(document, region.getOffset(), region, start, end);
- prefix = (prefix == null ? "" : prefix);
-
- List<IJavaElement> javaElements = null;
-
- try {
- javaElements = engine.getJavaElementsForExpression(
- seamProject, file, prefix, region.getOffset());
- } catch (StringIndexOutOfBoundsException e) {
- SeamExtPlugin.getPluginLog().logError(e);
- } catch (BadLocationException e) {
- SeamExtPlugin.getPluginLog().logError(e);
- }
-
- return javaElements == null ? new IJavaElement[0] : javaElements.toArray(new IJavaElement[0]);
- }
-
- public static Map<String, ISeamMessages> 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();
-
- 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(seamProject, file, 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, ISeamMessages> messages = new HashMap<String, ISeamMessages>();
- if (map != null && !map.isEmpty()) {
- for (ELInvocationExpression l : map.keySet()) {
- List<ISeamContextVariable> variables = map.get(l);
- for (ISeamContextVariable variable : variables) {
- ISeamMessages messagesVariable = SeamELCompletionEngine.getSeamMessagesComponentVariable(variable);
- if (messagesVariable != null) {
- messages.put(propertyName, messagesVariable);
- }
- }
- }
- }
-
- return messages;
-
-
- }
-
- /*
- * Checks if the EL start starting characters are present
- * @param viewer
- * @param offset
- * @return
- * @throws BadLocationException
- */
- private boolean checkStartPosition(IDocument document, int offset) {
- try {
- while (--offset >= 0) {
- if ('}' == document.getChar(offset))
- return false;
-
-
- if ('"' == document.getChar(offset) &&
- (offset - 1) >= 0 && '\\' != document.getChar(offset - 1)) {
- return false;
- }
-
-
- if ('{' == document.getChar(offset) &&
- (offset - 1) >= 0 &&
- ('#' == document.getChar(offset - 1) ||
- '$' == document.getChar(offset - 1))) {
- return true;
- }
- }
- } catch (BadLocationException e) {
- SeamExtPlugin.getPluginLog().logError(e);
- }
- return false;
- }
-
-}
Deleted: 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 2011-08-02 11:17:09 UTC (rev 33448)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2011-08-02 11:43:54 UTC (rev 33449)
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * 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.Map;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IRegion;
-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.core.ISeamMessages;
-
-/**
- * @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, ISeamMessages> messages = SeamBeanHyperlinkPartitioner.findMessagesComponents(getDocument(), region);
- if (messages == null || messages.isEmpty()) {
- // Nothing to open
- openFileFailed();
- return;
- }
-
- for (String property : messages.keySet()) {
- ISeamMessages messagesComponent = messages.get(property);
- Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.isEmpty())
- 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
13 years, 5 months
JBoss Tools SVN: r33448 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-08-02 07:17:09 -0400 (Tue, 02 Aug 2011)
New Revision: 33448
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
Log:
https://issues.jboss.org/browse/JBIDE-9438
Added a bug reference comment
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java 2011-08-02 11:11:19 UTC (rev 33447)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java 2011-08-02 11:17:09 UTC (rev 33448)
@@ -23,7 +23,8 @@
/**
* @author Dmitry Geraskov
- *
+ * Remove the class when https://bugs.eclipse.org/bugs/show_bug.cgi?id=353495
+ * will be fixed
*/
public class JavaPackageInfoResourceModelProviderPatched implements
JpaResourceModelProvider {
13 years, 5 months
JBoss Tools SVN: r33447 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal: jpa2 and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-08-02 07:11:19 -0400 (Tue, 02 Aug 2011)
New Revision: 33447
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
Log:
https://issues.jboss.org/browse/JBIDE-9438
Fix NPE for package-info placed in default package
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java 2011-08-02 10:29:43 UTC (rev 33446)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaPlatformProvider.java 2011-08-02 11:11:19 UTC (rev 33447)
@@ -25,7 +25,6 @@
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaPackageInfoResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
@@ -103,7 +102,7 @@
// order should not be important here
protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaPackageInfoResourceModelProvider.instance(),
+ JavaPackageInfoResourceModelProviderPatched.instance(),//replace with original when NPE will be fixed
JavaResourceModelProvider.instance(),
JarResourceModelProvider.instance(),
PersistenceResourceModelProvider.instance(),
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JavaPackageInfoResourceModelProviderPatched.java 2011-08-02 11:11:19 UTC (rev 33447)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jpt.common.core.JptCommonCorePlugin;
+import org.eclipse.jpt.jpa.core.JpaProject;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
+import org.eclipse.jpt.jpa.core.resource.java.JavaResourceCompilationUnit;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class JavaPackageInfoResourceModelProviderPatched implements
+ JpaResourceModelProvider {
+ // singleton
+ private static final JpaResourceModelProvider INSTANCE = new JavaPackageInfoResourceModelProviderPatched();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaResourceModelProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private JavaPackageInfoResourceModelProviderPatched() {
+ super();
+ }
+
+ public IContentType getContentType() {
+ return JptCommonCorePlugin.JAVA_SOURCE_PACKAGE_INFO_CONTENT_TYPE;
+ }
+
+ public JavaResourceCompilationUnit buildResourceModel(
+ JpaProject jpaProject, IFile file) {
+ ICompilationUnit cu = JavaCore.createCompilationUnitFrom(file);
+ try {
+ if (cu.getPackageDeclarations().length > 0){
+ return new SourcePackageInfoCompilationUnit(
+ cu,
+ jpaProject.getJpaPlatform().getAnnotationProvider(),
+ jpaProject.getJpaPlatform().getAnnotationEditFormatter(),
+ jpaProject.getModifySharedDocumentCommandExecutor());
+ } else {
+ //ignore package-info placed in default package as
+ //it doesn't have package declaration and can't hold annotations
+ return null;
+ }
+ } catch (JavaModelException e) {
+ // Ignore -- project is in a bad state. This will get recalled if necessary
+ return null;
+ }
+ }
+
+}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2011-08-02 10:29:43 UTC (rev 33446)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/jpa2/HibernateJpa2_0PlatformProvider.java 2011-08-02 11:11:19 UTC (rev 33447)
@@ -25,7 +25,6 @@
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaPackageInfoResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
@@ -37,6 +36,7 @@
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedMappingDefinition2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToManyMappingDefinition2_0;
+import org.jboss.tools.hibernate.jpt.core.internal.JavaPackageInfoResourceModelProviderPatched;
import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaBasicMappingDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.definition.HibernateJavaEntityDefinition;
import org.jboss.tools.hibernate.jpt.core.internal.context.orm.HibernateOrmXmlDefinition;
@@ -106,7 +106,7 @@
// order should not be important here
protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaPackageInfoResourceModelProvider.instance(),
+ JavaPackageInfoResourceModelProviderPatched.instance(),//replace with original when NPE will be fixed
JavaResourceModelProvider.instance(),
JarResourceModelProvider.instance(),
PersistenceResourceModelProvider.instance(),
13 years, 5 months
JBoss Tools SVN: r33446 - trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-08-02 06:29:43 -0400 (Tue, 02 Aug 2011)
New Revision: 33446
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerJMXRunner.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXClassLoaderRepository.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXSafeRunner.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/SecurityFailureHandler.java
Log:
Copyright dates
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/Activator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/Activator.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/Activator.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ide.eclipse.as.jmx.integration;
import org.eclipse.core.runtime.Plugin;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnectionProvider.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnectionProvider.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerJMXRunner.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerJMXRunner.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerJMXRunner.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ide.eclipse.as.jmx.integration;
import javax.management.MBeanServerConnection;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXClassLoaderRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXClassLoaderRepository.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXClassLoaderRepository.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXPoller.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXProvider.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ide.eclipse.as.jmx.integration;
import org.eclipse.core.runtime.NullProgressMonitor;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXSafeRunner.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXSafeRunner.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXSafeRunner.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXUtil.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JMXUtil.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2011 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,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/SecurityFailureHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/SecurityFailureHandler.java 2011-08-02 10:17:58 UTC (rev 33445)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/SecurityFailureHandler.java 2011-08-02 10:29:43 UTC (rev 33446)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.ide.eclipse.as.jmx.integration;
import java.util.List;
13 years, 5 months