JBoss Tools SVN: r19375 - in trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools: ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 19:18:38 -0500 (Wed, 16 Dec 2009)
New Revision: 19375
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
Log:
String externalization
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2009-12-17 00:02:59 UTC (rev 19374)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.java 2009-12-17 00:18:38 UTC (rev 19375)
@@ -65,6 +65,10 @@
public static String EjbJarPreview;
public static String EjbJarDescription;
+ public static String ReferenceWizard_title;
+ public static String ReferenceWizard_description;
+
+
static {
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.properties 2009-12-17 00:02:59 UTC (rev 19374)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/Messages.properties 2009-12-17 00:18:38 UTC (rev 19375)
@@ -47,4 +47,9 @@
Preview=Preview
BuildArchive=Build Archive
EjbJarPreview=EJB JAR Preview
-EjbJarDescription=Preview the EJB JAR\nLater, you can customize this structure further.
\ No newline at end of file
+EjbJarDescription=Preview the EJB JAR\nLater, you can customize this structure further.
+
+# fileset references (modulecore)
+ReferenceWizard_title=Add a fileset reference
+ReferenceWizard_description=A fileset reference can copy resources from a folder inside the workspace. Use the include and exclude fields to specify which resources should be copied.
+ReferenceWizard_rootFolder=Root Folder
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java 2009-12-17 00:02:59 UTC (rev 19374)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/ui/FilesetReferenceWizardFragment.java 2009-12-17 00:18:38 UTC (rev 19375)
@@ -24,6 +24,7 @@
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.server.ui.wizard.IWizardHandle;
import org.eclipse.wst.server.ui.wizard.WizardFragment;
+import org.jboss.ide.eclipse.archives.webtools.Messages;
import org.jboss.ide.eclipse.archives.webtools.filesets.vcf.WorkspaceFilesetVirtualComponent;
import org.jboss.ide.eclipse.as.wtp.ui.propertypage.IReferenceEditor;
import org.jboss.ide.eclipse.as.wtp.ui.propertypage.NewReferenceWizard;
@@ -42,19 +43,19 @@
private String includes, excludes, folder;
public Composite createComposite(Composite parent, IWizardHandle handle) {
hasEntered = true;
- handle.setTitle("Add a fileset reference"); //$NON-NLS-1$
- handle.setDescription("This will let you select a root folder and some matching patterns"); //$NON-NLS-1$
+ handle.setTitle(Messages.ReferenceWizard_title);
+ handle.setDescription(Messages.ReferenceWizard_description);
Composite child = new Composite(parent, SWT.NONE);
// root folder, text, browse
child.setLayout(new FormLayout());
Control top = null;
- addLabel("Root Folder", child, top); //$NON-NLS-1$
+ addLabel(Messages.FilesetsNewRootDir, child, top);
top = rootText = addText(child, top, true);
- addLabel("Includes", child, top); //$NON-NLS-1$
+ addLabel(Messages.FilesetsNewIncludes, child, top);
top = incText = addText(child, top, false);
- addLabel("Excludes", child, top); //$NON-NLS-1$
+ addLabel(Messages.FilesetsNewExcludes, child, top);
top = excText = addText(child, top, false);
ModifyListener listener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -87,7 +88,7 @@
Button b = null;
if( includeBrowse ) {
b = new Button(parent, SWT.NONE);
- b.setText("Browse..."); //$NON-NLS-1$
+ b.setText(Messages.FilesetsNewBrowse);
addBrowseListener(b,t);
FormData bData = new FormData();
bData.right = new FormAttachment(100,-5);
15 years
JBoss Tools SVN: r19374 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 19:02:59 -0500 (Wed, 16 Dec 2009)
New Revision: 19374
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
Log:
Name should not have WS in it
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-16 23:54:27 UTC (rev 19373)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-17 00:02:59 UTC (rev 19374)
@@ -408,10 +408,10 @@
}
/**
- * Wizard page for editing JBossWS Runtime parameters
+ * Wizard page for editing JBoss ESB Runtime parameters
*
*/
- public static class JBossWSRuntimeWizardPage extends WizardPage implements
+ public static class JBossESBRuntimeWizardPage extends WizardPage implements
PropertyChangeListener {
private static final String SRT_NAME = "name"; //$NON-NLS-1$
@@ -442,7 +442,7 @@
JBossESBRuntime source = null;
IFieldEditor jars = null;
- public JBossWSRuntimeWizardPage(List<JBossESBRuntime> editedList, JBossESBRuntime source) {
+ public JBossESBRuntimeWizardPage(List<JBossESBRuntime> editedList, JBossESBRuntime source) {
super(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
@@ -771,7 +771,7 @@
*/
public static class JBossRuntimeNewWizard extends Wizard {
- JBossWSRuntimeWizardPage page1 = null;
+ JBossESBRuntimeWizardPage page1 = null;
List<JBossESBRuntime> added = null;
List<JBossESBRuntime> value = null;
@@ -779,7 +779,7 @@
List<JBossESBRuntime> added) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
- page1 = new JBossWSRuntimeWizardPage(exist, null);
+ page1 = new JBossESBRuntimeWizardPage(exist, null);
addPage(page1);
this.value = exist;
this.added = added;
@@ -811,7 +811,7 @@
*
*/
public static class JBossWSRuntimeEditWizard extends Wizard {
- JBossWSRuntimeWizardPage page1 = null;
+ JBossESBRuntimeWizardPage page1 = null;
List<JBossESBRuntime> added = null;
Map<JBossESBRuntime, JBossESBRuntime> changed = null;
List<JBossESBRuntime> value = null;
@@ -835,7 +835,7 @@
Map<JBossESBRuntime, JBossESBRuntime> changed) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Edit_Runtime);
- page1 = new JBossWSRuntimeWizardPage(existing, source);
+ page1 = new JBossESBRuntimeWizardPage(existing, source);
page1
.setMessage(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Modify_Runtime);
page1
15 years
JBoss Tools SVN: r19373 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 18:54:27 -0500 (Wed, 16 Dec 2009)
New Revision: 19373
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-5495 - NPE if non-jbt servers are in the workspace.
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16 23:37:40 UTC (rev 19372)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16 23:54:27 UTC (rev 19373)
@@ -170,7 +170,8 @@
String runtimeType = ((IRuntime)element).getRuntimeType().getId();
if(location == null) return false;
IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)((IRuntime)element).loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
-
+ if( jbossRuntime == null )
+ return false;
return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType, jbossRuntime.getJBossConfiguration());
}
return true;
15 years
JBoss Tools SVN: r19372 - in trunk/esb/plugins: org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 18:37:40 -0500 (Wed, 16 Dec 2009)
New Revision: 19372
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java
Removed:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
The classname for an esb runtime was way off and should clearly mention it being an ESB runtime
Copied: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java (from rev 19370, trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java)
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossESBRuntime.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.esb.core.runtime;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Denny Xu
+ */
+public class JBossESBRuntime {
+
+ String name = null;
+
+ String homeDir = null;
+
+ String version = null;
+
+ String configuration = "";
+
+ boolean defaultRt = false;
+
+ List<String> libraries;
+
+ private boolean userConfigClasspath;
+
+ /**
+ * Default constructor
+ */
+ public JBossESBRuntime() {
+ libraries = new ArrayList<String>();
+ }
+
+ /**
+ * Get JBossWSRuntime name
+ *
+ * @return name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get path to home directory
+ *
+ * @return home directory path as string
+ */
+ public String getHomeDir() {
+ return homeDir;
+ }
+
+
+ /**
+ * Get jboss server configuration
+ *
+ * @return JBoss configuration as string
+ */
+ public String getConfiguration(){
+ return configuration;
+ }
+
+ /**
+ * Set JBossWSRuntime name
+ *
+ * @param name
+ * new JBossWSRuntime name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set home directory
+ *
+ * @param homeDir
+ * new JBossWSRuntime's home directory
+ */
+ public void setHomeDir(String homeDir) {
+ this.homeDir = homeDir;
+ }
+
+
+
+ /**
+ * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
+ *
+ * @param configuration
+ * new JBossWSRuntime's configuration
+ */
+ public void setConfiguration(String configuration){
+ this.configuration = configuration;
+ }
+
+ /**
+ * Mark runtime as default
+ *
+ * @param b
+ * new value for default property
+ */
+ public void setDefault(boolean b) {
+ this.defaultRt = b;
+ }
+
+ /**
+ * Get default flag
+ *
+ * @return default property
+ */
+ public boolean isDefault() {
+ return defaultRt;
+ }
+
+ public List<String> getLibraries(){
+
+ return this.libraries;
+ }
+
+ public void setLibraries(List<String> libraries){
+ this.libraries = libraries;
+ }
+
+ public boolean isUserConfigClasspath(){
+ return this.userConfigClasspath;
+ }
+
+ public void setUserConfigClasspath(boolean userConfigClasspath){
+ this.userConfigClasspath = userConfigClasspath;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
Deleted: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -1,147 +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
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.esb.core.runtime;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Denny Xu
- */
-public class JBossRuntime {
-
- String name = null;
-
- String homeDir = null;
-
- String version = null;
-
- String configuration = "";
-
- boolean defaultRt = false;
-
- List<String> libraries;
-
- private boolean userConfigClasspath;
-
- /**
- * Default constructor
- */
- public JBossRuntime() {
- libraries = new ArrayList<String>();
- }
-
- /**
- * Get JBossWSRuntime name
- *
- * @return name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get path to home directory
- *
- * @return home directory path as string
- */
- public String getHomeDir() {
- return homeDir;
- }
-
-
- /**
- * Get jboss server configuration
- *
- * @return JBoss configuration as string
- */
- public String getConfiguration(){
- return configuration;
- }
-
- /**
- * Set JBossWSRuntime name
- *
- * @param name
- * new JBossWSRuntime name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Set home directory
- *
- * @param homeDir
- * new JBossWSRuntime's home directory
- */
- public void setHomeDir(String homeDir) {
- this.homeDir = homeDir;
- }
-
-
-
- /**
- * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
- *
- * @param configuration
- * new JBossWSRuntime's configuration
- */
- public void setConfiguration(String configuration){
- this.configuration = configuration;
- }
-
- /**
- * Mark runtime as default
- *
- * @param b
- * new value for default property
- */
- public void setDefault(boolean b) {
- this.defaultRt = b;
- }
-
- /**
- * Get default flag
- *
- * @return default property
- */
- public boolean isDefault() {
- return defaultRt;
- }
-
- public List<String> getLibraries(){
-
- return this.libraries;
- }
-
- public void setLibraries(List<String> libraries){
- this.libraries = libraries;
- }
-
- public boolean isUserConfigClasspath(){
- return this.userConfigClasspath;
- }
-
- public void setUserConfigClasspath(boolean userConfigClasspath){
- this.userConfigClasspath = userConfigClasspath;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
-}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -149,7 +149,7 @@
} else {
- JBossRuntime jbws = JBossRuntimeManager.getInstance()
+ JBossESBRuntime jbws = JBossRuntimeManager.getInstance()
.findRuntimeByName(segment);
if (jbws != null) {
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -51,9 +51,9 @@
* TODO - write converter from old serialization format to XML?
* TODO - handle errors in string format
*/
- public Map<String, JBossRuntime> getMap(String input) {
+ public Map<String, JBossESBRuntime> getMap(String input) {
- Map<String, JBossRuntime> result = new HashMap<String, JBossRuntime>();
+ Map<String, JBossESBRuntime> result = new HashMap<String, JBossESBRuntime>();
if (input == null || EMPTY_STRING.equals(input.trim())) {
return result;
}
@@ -61,7 +61,7 @@
while (runtimes.hasMoreTokens()) {
String runtime = runtimes.nextToken();
String[] map = runtime.split(REGEXP_ESCAPE + FIELD_SEPARATOR);
- JBossRuntime rt = new JBossRuntime();
+ JBossESBRuntime rt = new JBossESBRuntime();
final int step = 2;
for (int i = 0; i < map.length; i += step) {
String name = map[i];
@@ -124,10 +124,10 @@
* @return
* String representation of String to JBossWS Runtime map
*/
- public String getString(Map<String, JBossRuntime> runtimeMap) {
+ public String getString(Map<String, JBossESBRuntime> runtimeMap) {
StringBuffer buffer = new StringBuffer();
- JBossRuntime[] runtimes = runtimeMap.values().toArray(
- new JBossRuntime[runtimeMap.size()]);
+ JBossESBRuntime[] runtimes = runtimeMap.values().toArray(
+ new JBossESBRuntime[runtimeMap.size()]);
for (int i = 0; i < runtimes.length; i++) {
buffer.append(NAME).append(FIELD_SEPARATOR);
buffer.append(runtimes[i].getName());
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -42,7 +42,7 @@
private static JBossRuntimeListConverter converter = new JBossRuntimeListConverter();
- private Map<String, JBossRuntime> runtimes = new HashMap<String, JBossRuntime>();
+ private Map<String, JBossESBRuntime> runtimes = new HashMap<String, JBossESBRuntime>();
static final String PLUGIN_ID = "org.jboss.tools.esb.project.core"; //$NON-NLS-1$
@@ -84,9 +84,9 @@
*
* @return JBossWSRuntime[]
*/
- public JBossRuntime[] getRuntimes() {
- Collection<JBossRuntime> c = runtimes.values();
- return c.toArray(new JBossRuntime[runtimes.size()]);
+ public JBossESBRuntime[] getRuntimes() {
+ Collection<JBossESBRuntime> c = runtimes.values();
+ return c.toArray(new JBossESBRuntime[runtimes.size()]);
}
/**
@@ -95,12 +95,12 @@
* @param runtime
* JBossWSRuntime
*/
- public void addRuntime(JBossRuntime runtime) {
+ public void addRuntime(JBossESBRuntime runtime) {
if (runtimes.size() == 0) {
runtime.setDefault(true);
}
- JBossRuntime oldDefaultRuntime = getDefaultRuntime();
+ JBossESBRuntime oldDefaultRuntime = getDefaultRuntime();
if (oldDefaultRuntime != null && runtime.isDefault()) {
oldDefaultRuntime.setDefault(false);
}
@@ -122,7 +122,7 @@
*/
public void addRuntime(String name, String path, String version,
boolean defaultRt) {
- JBossRuntime jbossWSRt = new JBossRuntime();
+ JBossESBRuntime jbossWSRt = new JBossESBRuntime();
jbossWSRt.setHomeDir(path);
jbossWSRt.setName(name);
jbossWSRt.setVersion(version);
@@ -137,8 +137,8 @@
* String - JBossWSRuntime name
* @return JBossWSRuntime - found JBossWSRuntime instance or null
*/
- public JBossRuntime findRuntimeByName(String name) {
- for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ public JBossESBRuntime findRuntimeByName(String name) {
+ for (JBossESBRuntime jbossWSRuntime : runtimes.values()) {
if (jbossWSRuntime.getName().equals(name)) {
return jbossWSRuntime;
}
@@ -146,20 +146,20 @@
return null;
}
- public JBossRuntime[] findRuntimeByVersion(String version) {
+ public JBossESBRuntime[] findRuntimeByVersion(String version) {
if(version == null || "".equals(version)){
return getRuntimes();
}
- List<JBossRuntime> rts = new ArrayList<JBossRuntime>();
- for (JBossRuntime jbossWSRuntime : runtimes.values()) {
+ List<JBossESBRuntime> rts = new ArrayList<JBossESBRuntime>();
+ for (JBossESBRuntime jbossWSRuntime : runtimes.values()) {
if (jbossWSRuntime.getVersion().equals(version)) {
rts.add(jbossWSRuntime);
}
}
- return rts.toArray(new JBossRuntime[]{});
+ return rts.toArray(new JBossESBRuntime[]{});
}
- public List<String> getAllRuntimeJars(JBossRuntime rt, String esbVersion){
+ public List<String> getAllRuntimeJars(JBossESBRuntime rt, String esbVersion){
List<String> jarList = new ArrayList<String>();
if (rt != null) {
if (rt.isUserConfigClasspath()) {
@@ -200,7 +200,7 @@
* @param rt
* JBossWSRuntime
*/
- public void removeRuntime(JBossRuntime rt) {
+ public void removeRuntime(JBossESBRuntime rt) {
runtimes.remove(rt.getName());
}
@@ -227,8 +227,8 @@
*
* @param runtime
*/
- public void setDefaultRuntime(JBossRuntime runtime) {
- JBossRuntime[] runtimes = getRuntimes();
+ public void setDefaultRuntime(JBossESBRuntime runtime) {
+ JBossESBRuntime[] runtimes = getRuntimes();
for (int i = 0; i < runtimes.length; i++) {
runtimes[i].setDefault(false);
}
@@ -240,8 +240,8 @@
*
* @return JBossWSRuntime
*/
- public JBossRuntime getDefaultRuntime() {
- for (JBossRuntime rt : runtimes.values()) {
+ public JBossESBRuntime getDefaultRuntime() {
+ for (JBossESBRuntime rt : runtimes.values()) {
if (rt.isDefault()) {
return rt;
}
@@ -255,9 +255,9 @@
* @return List<String>
*/
public List<String> getRuntimeNames() {
- JBossRuntime[] rts = getRuntimes();
+ JBossESBRuntime[] rts = getRuntimes();
List<String> result = new ArrayList<String>();
- for (JBossRuntime jbossWSRuntime : rts) {
+ for (JBossESBRuntime jbossWSRuntime : rts) {
result.add(jbossWSRuntime.getName());
}
return result;
@@ -269,9 +269,9 @@
* @return List of all runtime names
*/
public List<String> getAllRuntimeNames() {
- JBossRuntime[] rts = getRuntimes();
+ JBossESBRuntime[] rts = getRuntimes();
List<String> result = new ArrayList<String>();
- for (JBossRuntime jbossWSRuntime : rts) {
+ for (JBossESBRuntime jbossWSRuntime : rts) {
result.add(jbossWSRuntime.getName());
}
return result;
@@ -286,7 +286,7 @@
* new runtime name
*/
public void changeRuntimeName(String oldName, String newName) {
- JBossRuntime o = findRuntimeByName(oldName);
+ JBossESBRuntime o = findRuntimeByName(oldName);
if (o == null) {
return;
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -22,7 +22,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -40,7 +40,7 @@
private static final int COLUMNS = 3;
JBossRuntimeListFieldEditor jbossRuntimes = new JBossRuntimeListFieldEditor(
- "rtlist", JBossESBUIMessages.JBoss_Preference_Page_Runtimes, new ArrayList<JBossRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()))); //$NON-NLS-1$
+ "rtlist", JBossESBUIMessages.JBoss_Preference_Page_Runtimes, new ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()))); //$NON-NLS-1$
/**
* Create contents of JBoss ESB preferences page. list editor
@@ -73,18 +73,18 @@
*/
@Override
protected void performApply() {
- for (JBossRuntime rt : jbossRuntimes.getAddedJBossRuntimes()) {
+ for (JBossESBRuntime rt : jbossRuntimes.getAddedJBossRuntimes()) {
JBossRuntimeManager.getInstance().addRuntime(rt);
}
jbossRuntimes.getAddedJBossRuntimes().clear();
- for (JBossRuntime rt : jbossRuntimes.getRemoved()) {
+ for (JBossESBRuntime rt : jbossRuntimes.getRemoved()) {
JBossRuntimeManager.getInstance().removeRuntime(rt);
}
jbossRuntimes.getRemoved().clear();
- JBossRuntime defaultRuntime = jbossRuntimes
+ JBossESBRuntime defaultRuntime = jbossRuntimes
.getDefaultJBossRuntime();
// reset default runtime
- for (JBossRuntime jbossWSRuntime : JBossRuntimeManager
+ for (JBossESBRuntime jbossWSRuntime : JBossRuntimeManager
.getInstance().getRuntimes()) {
jbossWSRuntime.setDefault(false);
}
@@ -93,10 +93,10 @@
defaultRuntime.setDefault(true);
}
jbossRuntimes.setDefaultJBossRuntime(null);
- Map<JBossRuntime, JBossRuntime> changed = jbossRuntimes
+ Map<JBossESBRuntime, JBossESBRuntime> changed = jbossRuntimes
.getChangedJBossRuntimes();
- for (JBossRuntime c : changed.keySet()) {
- JBossRuntime o = changed.get(c);
+ for (JBossESBRuntime c : changed.keySet()) {
+ JBossESBRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
o.setVersion(c.getVersion());
o.setConfiguration(c.getConfiguration());
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossLibraryListFieldEditor.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -48,7 +48,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Group;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.preference.JBossESBUIPlugin;
@@ -78,7 +78,7 @@
private ActionPanel actionPanel;
- private JBossRuntime tempJbesb;
+ private JBossESBRuntime tempJbesb;
@@ -100,9 +100,9 @@
* Object
*/
public JBossLibraryListFieldEditor(String name, String label,
- JBossRuntime jbws) {
+ JBossESBRuntime jbws) {
super(name, label, jbws);
- this.tempJbesb = new JBossRuntime();
+ this.tempJbesb = new JBossESBRuntime();
if(jbws != null){
this.tempJbesb.setUserConfigClasspath(jbws.isUserConfigClasspath());
this.tempJbesb.getLibraries().addAll(jbws.getLibraries());
@@ -203,8 +203,8 @@
listView.setContentProvider(new ITreeContentProvider() {
public Object[] getElements(Object inputElement) {
- if (inputElement instanceof JBossRuntime) {
- return ((JBossRuntime) inputElement).getLibraries().toArray();
+ if (inputElement instanceof JBossESBRuntime) {
+ return ((JBossESBRuntime) inputElement).getLibraries().toArray();
} else {
throw new IllegalArgumentException(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -65,7 +65,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.esb.core.ESBProjectConstant;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -95,13 +95,13 @@
private ActionPanel actionPanel;
- private Map<JBossRuntime, JBossRuntime> changed = new HashMap<JBossRuntime, JBossRuntime>();
+ private Map<JBossESBRuntime, JBossESBRuntime> changed = new HashMap<JBossESBRuntime, JBossESBRuntime>();
- private JBossRuntime checkedElement = new JBossRuntime();
+ private JBossESBRuntime checkedElement = new JBossESBRuntime();
- private List<JBossRuntime> added = new ArrayList<JBossRuntime>();
+ private List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
- private List<JBossRuntime> removed = new ArrayList<JBossRuntime>();
+ private List<JBossESBRuntime> removed = new ArrayList<JBossESBRuntime>();
// ------------------------------------------------------------------------
// Constructors
@@ -127,11 +127,11 @@
*
* @return JBossRuntime;
*/
- public JBossRuntime getDefaultJBossRuntime() {
+ public JBossESBRuntime getDefaultJBossRuntime() {
return checkedElement;
}
- public void setDefaultJBossRuntime(JBossRuntime rt) {
+ public void setDefaultJBossRuntime(JBossESBRuntime rt) {
checkedElement = rt;
}
@@ -140,7 +140,7 @@
*
* @return List<JBossRuntime>
*/
- public List<JBossRuntime> getAddedJBossRuntimes() {
+ public List<JBossESBRuntime> getAddedJBossRuntimes() {
return added;
}
@@ -149,7 +149,7 @@
*
* @return List<JBossRuntime>
*/
- public Map<JBossRuntime, JBossRuntime> getChangedJBossRuntimes() {
+ public Map<JBossESBRuntime, JBossESBRuntime> getChangedJBossRuntimes() {
return changed;
}
@@ -158,7 +158,7 @@
*
* @return List<JBossRuntime>
*/
- public List<JBossRuntime> getRemoved() {
+ public List<JBossESBRuntime> getRemoved() {
return removed;
}
@@ -223,7 +223,7 @@
public Object[] getElements(Object inputElement) {
if (inputElement instanceof List) {
- return ((List<JBossRuntime>) inputElement).toArray();
+ return ((List<JBossESBRuntime>) inputElement).toArray();
} else {
throw new IllegalArgumentException(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List);
@@ -264,7 +264,7 @@
}
public String getColumnText(Object element, int columnIndex) {
- JBossRuntime rt = (JBossRuntime) element;
+ JBossESBRuntime rt = (JBossESBRuntime) element;
if (columnIndex == TC_DEFAULT_NUMBER) {
return ""; //$NON-NLS-1$
}
@@ -286,13 +286,13 @@
tableView.getTable().setHeaderVisible(true);
tableView.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
- JBossRuntime selRt = (JBossRuntime) event.getElement();
+ JBossESBRuntime selRt = (JBossESBRuntime) event.getElement();
if (event.getChecked()) {
- JBossRuntime deselRt = null;
+ JBossESBRuntime deselRt = null;
Object[] selRts = tableView.getCheckedElements();
for (int i = 0; i < selRts.length; i++) {
- JBossRuntime rt = (JBossRuntime) selRts[i];
+ JBossESBRuntime rt = (JBossESBRuntime) selRts[i];
if (rt != selRt) {
deselRt = rt;
break;
@@ -304,7 +304,7 @@
checkedElement = null;
int i = 0;
for (Object object : selRts) {
- JBossRuntime rt = (JBossRuntime) object;
+ JBossESBRuntime rt = (JBossESBRuntime) object;
if (rt == selRt) {
newChecked[i] = rt;
checkedElement = rt;
@@ -313,7 +313,7 @@
}
tableView.setCheckedElements(newChecked);
} else {
- checkedElement = (JBossRuntime) event.getElement();
+ checkedElement = (JBossESBRuntime) event.getElement();
}
} else {
if (checkedElement == selRt) {
@@ -324,7 +324,7 @@
}
});
- for (JBossRuntime rt : (List<JBossRuntime>) getValue()) {
+ for (JBossESBRuntime rt : (List<JBossESBRuntime>) getValue()) {
if (rt.isDefault()) {
tableView.setChecked(rt, true);
checkedElement = rt;
@@ -343,9 +343,9 @@
*/
@SuppressWarnings("unchecked")
private void setDefaultRuntime() {
- List<JBossRuntime> runtimes = (List<JBossRuntime>) getValue();
+ List<JBossESBRuntime> runtimes = (List<JBossESBRuntime>) getValue();
boolean checked = false;
- for (JBossRuntime jbossRuntime : runtimes) {
+ for (JBossESBRuntime jbossRuntime : runtimes) {
if (checkedElement == jbossRuntime) {
checked = true;
@@ -421,7 +421,7 @@
private static final int GL_PARENT_COLUMNS = 1;
private static final int GL_CONTENT_COLUMNS = 3;
- List<JBossRuntime> value = null;
+ List<JBossESBRuntime> value = null;
IFieldEditor name = createTextEditor(SRT_NAME,
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Name2, ""); //$NON-NLS-1$
@@ -438,11 +438,11 @@
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Home_Folder,
""); //$NON-NLS-1$
- JBossRuntime current = null;
- JBossRuntime source = null;
+ JBossESBRuntime current = null;
+ JBossESBRuntime source = null;
IFieldEditor jars = null;
- public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList, JBossRuntime source) {
+ public JBossWSRuntimeWizardPage(List<JBossESBRuntime> editedList, JBossESBRuntime source) {
super(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
@@ -547,7 +547,7 @@
setPageComplete(false);
return;
}
- for (JBossRuntime rt : value) {
+ for (JBossESBRuntime rt : value) {
if (current != null && current.getName().equals(rt.getName())) {
continue;
}
@@ -560,7 +560,7 @@
}
}
- JBossRuntime jarJbws = (JBossRuntime) jars.getValue();
+ JBossESBRuntime jarJbws = (JBossESBRuntime) jars.getValue();
if (current != null
&& current.getName().equals(name.getValueAsString())
&& current.getHomeDir().equals(homeDir.getValueAsString())
@@ -678,13 +678,13 @@
*
* @return JBossRuntime instance
*/
- public JBossRuntime getRuntime() {
- JBossRuntime newRt = new JBossRuntime();
+ public JBossESBRuntime getRuntime() {
+ JBossESBRuntime newRt = new JBossESBRuntime();
newRt.setName(name.getValueAsString());
newRt.setVersion(version.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
newRt.setConfiguration(configuration.getText());
- JBossRuntime rt = (JBossRuntime) jars.getValue();
+ JBossESBRuntime rt = (JBossESBRuntime) jars.getValue();
newRt.setLibraries(rt.getLibraries());
newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
return newRt;
@@ -772,11 +772,11 @@
public static class JBossRuntimeNewWizard extends Wizard {
JBossWSRuntimeWizardPage page1 = null;
- List<JBossRuntime> added = null;
- List<JBossRuntime> value = null;
+ List<JBossESBRuntime> added = null;
+ List<JBossESBRuntime> value = null;
- public JBossRuntimeNewWizard(List<JBossRuntime> exist,
- List<JBossRuntime> added) {
+ public JBossRuntimeNewWizard(List<JBossESBRuntime> exist,
+ List<JBossESBRuntime> added) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
page1 = new JBossWSRuntimeWizardPage(exist, null);
@@ -792,14 +792,14 @@
*/
@Override
public boolean performFinish() {
- JBossRuntime rt = page1.getRuntime();
+ JBossESBRuntime rt = page1.getRuntime();
added.add(rt);
value.add(rt);
return true;
}
- protected JBossRuntime getRuntime() {
+ protected JBossESBRuntime getRuntime() {
return page1.getRuntime();
}
@@ -812,10 +812,10 @@
*/
public static class JBossWSRuntimeEditWizard extends Wizard {
JBossWSRuntimeWizardPage page1 = null;
- List<JBossRuntime> added = null;
- Map<JBossRuntime, JBossRuntime> changed = null;
- List<JBossRuntime> value = null;
- JBossRuntime source = null;
+ List<JBossESBRuntime> added = null;
+ Map<JBossESBRuntime, JBossESBRuntime> changed = null;
+ List<JBossESBRuntime> value = null;
+ JBossESBRuntime source = null;
/**
* Constructor with almost all initialization parameters
@@ -830,9 +830,9 @@
* @param changed
* List<JBossRuntime> - TBD
*/
- public JBossWSRuntimeEditWizard(List<JBossRuntime> existing,
- JBossRuntime source, List<JBossRuntime> added,
- Map<JBossRuntime, JBossRuntime> changed) {
+ public JBossWSRuntimeEditWizard(List<JBossESBRuntime> existing,
+ JBossESBRuntime source, List<JBossESBRuntime> added,
+ Map<JBossESBRuntime, JBossESBRuntime> changed) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Edit_Runtime);
page1 = new JBossWSRuntimeWizardPage(existing, source);
@@ -858,7 +858,7 @@
*/
@Override
public boolean performFinish() {
- JBossRuntime rt = page1.getRuntime();
+ JBossESBRuntime rt = page1.getRuntime();
if (added.contains(source) || changed.containsKey(source)) {
source.setName(rt.getName());
@@ -1018,7 +1018,7 @@
*/
public abstract class BaseAction extends Action {
- JBossRuntime[] runtimes = new JBossRuntime[0];
+ JBossESBRuntime[] runtimes = new JBossESBRuntime[0];
/**
* Constructor creates action with provided name
@@ -1039,13 +1039,13 @@
*/
public void setSelection(ISelection selection) {
if (selection instanceof IStructuredSelection) {
- List<JBossRuntime> rts = new ArrayList<JBossRuntime>();
+ List<JBossESBRuntime> rts = new ArrayList<JBossESBRuntime>();
for (Object rt : ((IStructuredSelection) selection).toArray()) {
- rts.add((JBossRuntime) rt);
+ rts.add((JBossESBRuntime) rt);
}
- runtimes = rts.toArray(new JBossRuntime[] {});
+ runtimes = rts.toArray(new JBossESBRuntime[] {});
} else {
- runtimes = new JBossRuntime[0];
+ runtimes = new JBossESBRuntime[0];
}
updateEnablement();
}
@@ -1085,7 +1085,7 @@
@Override
public void run() {
Wizard wiz = new JBossRuntimeNewWizard(
- (List<JBossRuntime>) getValue(), added);
+ (List<JBossESBRuntime>) getValue(), added);
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
dialog.open();
@@ -1128,15 +1128,15 @@
@SuppressWarnings("unchecked")
@Override
public void run() {
- JBossRuntime selected = runtimes[0];
+ JBossESBRuntime selected = runtimes[0];
Wizard wiz = new JBossWSRuntimeEditWizard(
- (List<JBossRuntime>) getValue(), runtimes[0], added,
+ (List<JBossESBRuntime>) getValue(), runtimes[0], added,
changed);
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
dialog.open();
tableView.refresh();
- JBossRuntime c = null;
+ JBossESBRuntime c = null;
if (changed.containsValue(selected)) {
c = findChangedRuntime(selected);
if (c != null) {
@@ -1149,8 +1149,8 @@
setDefaultRuntime();
}
- private JBossRuntime findChangedRuntime(JBossRuntime source) {
- for (JBossRuntime r : changed.keySet()) {
+ private JBossESBRuntime findChangedRuntime(JBossESBRuntime source) {
+ for (JBossESBRuntime r : changed.keySet()) {
if (source == changed.get(r)) {
return r;
}
@@ -1185,7 +1185,7 @@
*/
@Override
public void run() {
- for (JBossRuntime rt : runtimes) {
+ for (JBossESBRuntime rt : runtimes) {
removeRuntime(rt);
}
tableView.refresh();
@@ -1193,7 +1193,7 @@
}
@SuppressWarnings("unchecked")
- private void removeRuntime(JBossRuntime r) {
+ private void removeRuntime(JBossESBRuntime r) {
boolean used = JBossRuntimeManager.isRuntimeUsed(r.getName());
String title = JBossESBUIMessages.JBoss_Runtime_Delete_Confirm_Title;
String message = (used) ? NLS.bind(
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -60,7 +60,7 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
@@ -283,7 +283,7 @@
cmbRuntimes.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String runtimeName = cmbRuntimes.getText();
- JBossRuntime jr = (JBossRuntime) cmbRuntimes
+ JBossESBRuntime jr = (JBossESBRuntime) cmbRuntimes
.getData(runtimeName);
saveJBossESBRuntimeToModel(jr);
changePageStatus();
@@ -339,7 +339,7 @@
if(runtimename == null || runtimename.equals("")){ //$NON-NLS-1$
hasRuntime = false;
}
- JBossRuntime jbRuntime = JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
+ JBossESBRuntime jbRuntime = JBossRuntimeManager.getInstance().findRuntimeByName(runtimename);
if (jbRuntime != null) {
@@ -424,13 +424,13 @@
* create a new jboss ESB runtime and set user supplied runtime to the new one
*/
protected void newJBossRuntime() {
- List<JBossRuntime> exists = new ArrayList<JBossRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
- List<JBossRuntime> added = new ArrayList<JBossRuntime>();
+ List<JBossESBRuntime> exists = new ArrayList<JBossESBRuntime>(Arrays.asList(JBossRuntimeManager.getInstance().getRuntimes()));
+ List<JBossESBRuntime> added = new ArrayList<JBossESBRuntime>();
JBossRuntimeListFieldEditor.JBossRuntimeNewWizard newRtwizard = new JBossRuntimeListFieldEditor.JBossRuntimeNewWizard(
exists, added) {
public boolean performFinish() {
- JBossRuntime rt = getRuntime();
+ JBossESBRuntime rt = getRuntime();
rt.setDefault(true);
JBossRuntimeManager.getInstance().addRuntime(rt);
JBossRuntimeManager.getInstance().save();
@@ -446,8 +446,8 @@
}
protected void initializeRuntimesCombo(Combo cmRuntime, String runtimeName, String version) {
- JBossRuntime selectedJbRuntime = null;
- JBossRuntime defaultJbws = null;
+ JBossESBRuntime selectedJbRuntime = null;
+ JBossESBRuntime defaultJbws = null;
int selectIndex = 0;
int defaultIndex = 0;
@@ -455,10 +455,10 @@
if(runtimeName == null || "".equals(runtimeName)){ //$NON-NLS-1$
runtimeName = model.getStringProperty(IJBossESBFacetDataModelProperties.RUNTIME_ID);
}
- JBossRuntime[] runtimes = JBossRuntimeManager.getInstance()
+ JBossESBRuntime[] runtimes = JBossRuntimeManager.getInstance()
.findRuntimeByVersion(version);
for (int i = 0; i < runtimes.length; i++) {
- JBossRuntime jr = runtimes[i];
+ JBossESBRuntime jr = runtimes[i];
cmRuntime.add(jr.getName());
cmRuntime.setData(jr.getName(), jr);
@@ -508,7 +508,7 @@
}
- protected void saveJBossESBRuntimeToModel(JBossRuntime jbws) {
+ protected void saveJBossESBRuntimeToModel(JBossESBRuntime jbws) {
if (jbws != null) {
model.setStringProperty(
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16 23:34:11 UTC (rev 19371)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-16 23:37:40 UTC (rev 19372)
@@ -46,7 +46,7 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUICore;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
-import org.jboss.tools.esb.core.runtime.JBossRuntime;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
@@ -123,8 +123,8 @@
if(obj instanceof IRuntime){
path = path.append(JBossRuntimeClassPathInitializer.JBOSS_ESB_RUNTIME_CLASSPATH_SERVER_SUPPLIED);
path = path.append(((IRuntime)obj).getId());
- }else if(obj instanceof JBossRuntime){
- path = path.append(((JBossRuntime)obj).getName());
+ }else if(obj instanceof JBossESBRuntime){
+ path = path.append(((JBossESBRuntime)obj).getName());
}
entry = JavaCore.newContainerEntry(path);
return true;
@@ -141,9 +141,9 @@
private List getAllAvailableESBRuntimes(){
List runtimes = new ArrayList();
- JBossRuntime[] preRuntimes = JBossRuntimeManager.getInstance().getRuntimes();
+ JBossESBRuntime[] preRuntimes = JBossRuntimeManager.getInstance().getRuntimes();
IRuntime[] serverRuntimes = ServerCore.getRuntimes();
- List<JBossRuntime> preList = Arrays.asList(preRuntimes);
+ List<JBossESBRuntime> preList = Arrays.asList(preRuntimes);
List<IRuntime> serverRuntimeList = Arrays.asList(serverRuntimes);
runtimes.addAll(preList);
runtimes.addAll(serverRuntimeList);
@@ -198,14 +198,14 @@
case 0:
if(element instanceof IRuntime){
return serverLabel.getText(element);
- }else if(element instanceof JBossRuntime){
- return ((JBossRuntime)element).getName();
+ }else if(element instanceof JBossESBRuntime){
+ return ((JBossESBRuntime)element).getName();
}
break;
case 1:
if(element instanceof IRuntime){
return JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
- }else if(element instanceof JBossRuntime){
+ }else if(element instanceof JBossESBRuntime){
return JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
}
break;
15 years
JBoss Tools SVN: r19371 - in trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core: facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 18:34:11 -0500 (Wed, 16 Dec 2009)
New Revision: 19371
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/component/ESBVirtualComponent.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/UninstallJBossClassPathCommand.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/utils/JBossESBProjectUtil.java
Log:
adding headers and tiny cleanup
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/component/ESBVirtualComponent.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/component/ESBVirtualComponent.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/component/ESBVirtualComponent.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.component;
import org.jboss.ide.eclipse.as.wtp.core.vcf.JBTVirtualComponent;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossClassPathCommand.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -75,16 +75,12 @@
.setPersistentProperty(
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME,
runtimeName);
- project
- .setPersistentProperty(
+ project.setPersistentProperty(
IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION,
runtimeLocation);
project.setPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER, esbcontentFolder);
status = addClassPath(project, new String[]{runtimeName});
}
-
-
-
} catch (CoreException e) {
status = StatusUtils.errorStatus(
JBossFacetCoreMessages.Error_Add_Facet_JBossESB, e);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -20,7 +20,7 @@
public class JBossESBFacetDataModelProvider extends J2EEModuleFacetInstallDataModelProvider implements IJBossESBFacetDataModelProperties{
- private static final String JBOSSESB_PROJECT_FACET = "jst.jboss.esb";
+ private static final String JBOSSESB_PROJECT_FACET = ESBProjectConstant.ESB_PROJECT_FACET;
public Set getPropertyNames() {
Set names = super.getPropertyNames();
@@ -72,8 +72,4 @@
public IStatus validate(String propertyName) {
return OK_STATUS;
}
-
-
-
-
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetInstallationDelegate.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -37,6 +37,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.ide.eclipse.as.wtp.core.util.VCFUtil;
import org.jboss.ide.eclipse.as.wtp.core.vcf.OutputFoldersVirtualComponent;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.ESBProjectCorePlugin;
import org.jboss.tools.esb.core.component.ESBVirtualComponent;
import org.osgi.service.prefs.BackingStoreException;
@@ -134,11 +135,8 @@
}
esbContent.getFolder("lib").create(true, true, null);
- esbContent.getFolder("META-INF").create(true, true, null);
- createJBossESBXML(esbContent.getFolder("META-INF"));
-
-
-
+ esbContent.getFolder(ESBProjectConstant.META_INF).create(true, true, null);
+ createJBossESBXML(esbContent.getFolder(ESBProjectConstant.META_INF));
project.refreshLocal(IResource.DEPTH_ZERO, null);
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/UninstallJBossClassPathCommand.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/UninstallJBossClassPathCommand.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/UninstallJBossClassPathCommand.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -51,25 +51,12 @@
.getBoolean(project
.getPersistentProperty(IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME));
if (isServerSupplied) {
-// project
-// .getPersistentProperties()
-// .remove(
-// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME);
+ // TODO test
} else {
-// project
-// .getPersistentProperties()
-// .remove(
-// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME);
-// project
-// .getPersistentProperties()
-// .remove(
-// IJBossWSFacetDataModelProperties.PERSISTENCE_PROPERTY_RNTIME_LOCATION);
String runtimeName = project
.getPersistentProperty(IJBossESBFacetDataModelProperties.PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME);
-
status = removeClassPath(project, runtimeName);
}
-
} catch (CoreException e) {
status = StatusUtils.errorStatus(
JBossFacetCoreMessages.Error_Remove_Facet_JBossESB, e);
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.runtime;
import java.io.File;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.runtime;
import java.io.File;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.runtime;
import java.io.File;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.runtime;
import java.io.File;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/utils/JBossESBProjectUtil.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/utils/JBossESBProjectUtil.java 2009-12-16 23:02:22 UTC (rev 19370)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/utils/JBossESBProjectUtil.java 2009-12-16 23:34:11 UTC (rev 19371)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.esb.core.utils;
import org.eclipse.core.resources.IProject;
@@ -7,6 +17,9 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.esb.core.ESBProjectConstant;
+/*
+ * In WTP 3.2 this can be replaced with utility code in modulecore
+ */
public class JBossESBProjectUtil {
public static boolean isESBProject(IProject project) {
15 years
JBoss Tools SVN: r19370 - trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-12-16 18:02:22 -0500 (Wed, 16 Dec 2009)
New Revision: 19370
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/StatusUtils.java
Log:
JBIDE-5494 - plugin id is wrong
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/StatusUtils.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/StatusUtils.java 2009-12-16 19:54:12 UTC (rev 19369)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/StatusUtils.java 2009-12-16 23:02:22 UTC (rev 19370)
@@ -15,47 +15,37 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
-public class StatusUtils
-{
- public static IStatus errorStatus( String errorMessage )
- {
- return new Status( IStatus.ERROR, "id", 0, errorMessage, null );
+public class StatusUtils {
+ public static IStatus errorStatus( String errorMessage ) {
+ return new Status( IStatus.ERROR, ESBProjectCorePlugin.PLUGIN_ID, 0, errorMessage, null );
}
- public static IStatus errorStatus( Throwable exc )
- {
+ public static IStatus errorStatus( Throwable exc ) {
String message = exc.getMessage();
-
- return new Status( IStatus.ERROR, "id", 0, message == null ? "" : message, exc );
+ return new Status( IStatus.ERROR, ESBProjectCorePlugin.PLUGIN_ID, 0, message == null ? "" : message, exc );
}
- public static IStatus errorStatus( String message, Throwable exc )
- {
- return new Status( IStatus.ERROR, "id", 0, message, exc );
+ public static IStatus errorStatus( String message, Throwable exc ) {
+ return new Status( IStatus.ERROR, ESBProjectCorePlugin.PLUGIN_ID, 0, message, exc );
}
- public static MultiStatus multiStatus( String message, IStatus[] children, Throwable exc )
- {
- return new MultiStatus( "id", 0, children, message, exc );
+ public static MultiStatus multiStatus( String message, IStatus[] children, Throwable exc ) {
+ return new MultiStatus( ESBProjectCorePlugin.PLUGIN_ID, 0, children, message, exc );
}
- public static MultiStatus multiStatus( String message, IStatus[] children )
- {
- return new MultiStatus( "id", 0, children, message, null );
+ public static MultiStatus multiStatus( String message, IStatus[] children ) {
+ return new MultiStatus( ESBProjectCorePlugin.PLUGIN_ID, 0, children, message, null );
}
- public static IStatus warningStatus( String warningMessage )
- {
- return new Status( IStatus.WARNING, "id", 0, warningMessage, null );
+ public static IStatus warningStatus( String warningMessage ) {
+ return new Status( IStatus.WARNING, ESBProjectCorePlugin.PLUGIN_ID, 0, warningMessage, null );
}
- public static IStatus warningStatus( String warningMessage, Throwable exc )
- {
- return new Status( IStatus.WARNING, "id", 0, warningMessage, exc );
+ public static IStatus warningStatus( String warningMessage, Throwable exc ) {
+ return new Status( IStatus.WARNING, ESBProjectCorePlugin.PLUGIN_ID, 0, warningMessage, exc );
}
- public static IStatus infoStatus( String infoMessage )
- {
- return new Status( IStatus.INFO, "id", 0, infoMessage, null );
+ public static IStatus infoStatus( String infoMessage ) {
+ return new Status( IStatus.INFO, ESBProjectCorePlugin.PLUGIN_ID, 0, infoMessage, null );
}
}
\ No newline at end of file
15 years
JBoss Tools SVN: r19369 - in trunk: flow/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-12-16 14:54:12 -0500 (Wed, 16 Dec 2009)
New Revision: 19369
Modified:
trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties
trunk/flow/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties
trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5224 Some Plugins and Features has wrong or missing License or Copyright text.
Modified: trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties
===================================================================
--- trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties 2009-12-16 19:42:59 UTC (rev 19368)
+++ trunk/flow/features/org.jboss.tools.flow.common.feature/feature.properties 2009-12-16 19:54:12 UTC (rev 19369)
@@ -1,8 +1,8 @@
featureName=Flow Languages Common Tools
featureProvider=JBoss by Red Hat
-description=This feature includes common tools for flow languages. \
-copyright=Copyright 2009 Red Hat, Inc. \
-licenseURL=http://www.eclipse.org/legal/epl-v10.html \
+description=This feature includes common tools for flow languages.
+copyright=Copyright 2009 Red Hat, Inc.
+licenseURL=http://www.eclipse.org/legal/epl-v10.html
license=Red Hat, Inc. licenses these features and plugins to you under \
certain open source licenses (or aggregations of such licenses), which \
in a particular case may include the Eclipse Public License, the GNU \
Modified: trunk/flow/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/flow/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties 2009-12-16 19:42:59 UTC (rev 19368)
+++ trunk/flow/features/org.jboss.tools.flow.common.feature/sourceTemplateFeature/feature.properties 2009-12-16 19:54:12 UTC (rev 19369)
@@ -11,7 +11,7 @@
# "licenseURL" property - URL of the "Feature License"
# do not translate value - just change to point to a locale-specific HTML page
licenseURL=license.html
-
+copyright=Copyright 2009 Red Hat, Inc.
# START NON-TRANSLATABLE
# "license" property - text of the "Feature Update License"
# should be plain text version of license agreement pointed to be "licenseURL"
Modified: trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-12-16 19:42:59 UTC (rev 19368)
+++ trunk/jbpm/features/org.jboss.tools.flow.jpdl4.feature/sourceTemplateFeature/feature.properties 2009-12-16 19:54:12 UTC (rev 19369)
@@ -15,12 +15,12 @@
# START NON-TRANSLATABLE
# "license" property - text of the "Feature Update License"
# should be plain text version of license agreement pointed to be "licenseURL"
-license=Red Hat, Inc. licenses these features and plugins to you under
-certain open source licenses (or aggregations of such licenses), which
-in a particular case may include the Eclipse Public License, the GNU
-Lesser General Public License, and/or certain other open source
-licenses. For precise licensing details, consult the corresponding
-source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
Raleigh NC 27606 USA.
# END NON-TRANSLATABLE
########### end of license property ##########################################
15 years
JBoss Tools SVN: r19367 - in trunk: jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2009-12-16 13:32:41 -0500 (Wed, 16 Dec 2009)
New Revision: 19367
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
Log:
Some logic moved to common org.jboss.tools.iu.bot.ext plugin
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2009-12-16 17:56:27 UTC (rev 19366)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/smoke/AddRemoveJSFCapabilitiesTest.java 2009-12-16 18:32:41 UTC (rev 19367)
@@ -19,6 +19,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.jsf.ui.bot.test.JSFAutoTestCase;
+import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.helper.WidgetFinderHelper;
@@ -33,27 +34,10 @@
public class AddRemoveJSFCapabilitiesTest extends JSFAutoTestCase {
- private static final String WEB_PROJECT_JBT_JSF_POPUP_MENU = "JBoss Tools JSF";
- private static final String PACKAGE_EXPLORER_JBT_POPUP_MENU = "JBoss Tools";
- private static final String PACKAGE_EXPLORER_CONFIGURE_POPUP_MENU = "Configure";
- private static final String ADD_JSF_CAPABILITIES_POPUP_MENU = "Add JSF Capabilities...";
- private static final String CLOSE_PROJECT_POPUP_MENU = "Clo&se Project";
- private static final String OPEN_PROJECT_POPUP_MENU = "Op&en Project";
- private static final String DELETE_PROJECT_POPUP_MENU = "Delete";
- private static final String JBDS_REMOVE_JSF_CAPABILITIES_POPUP_MENU = "Remove Red Hat Capabilities";
- private static final String JBT_REMOVE_JSF_CAPABILITIES_POPUP_MENU = "Remove JSF Capabilities";
-
private MenuItem miRunOnServer = null;
public void testAddRemoveJSFCapabilities() {
- boolean jbdsIsRunning = false;
- // Check out if JBoss Developer Studio Is Running
- try{
- bot.menu(IDELabel.Menu.HELP).menu(IDELabel.Menu.ABOUT_JBOSS_DEVELOPER_STUDIO);
- jbdsIsRunning = true;
- }catch (WidgetNotFoundException wnfe){
- // do nothing
- }
+ boolean jbdsIsRunning = SWTEclipseExt.isJBDSRun(bot);
removeJSFCapabilities(jbdsIsRunning);
addJSFCapabilities();
// Test add/remove JSF capabilities after project is closed and reopened
@@ -229,7 +213,7 @@
ContextMenuHelper.prepareTreeItemForContextMenu(tree,
tree.getTreeItem(JBT_TEST_PROJECT_NAME));
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- DELETE_PROJECT_POPUP_MENU, false)).click();
+ IDELabel.Menu.DELETE, false)).click();
bot.shell("Delete Resources").activate();
bot.button(WidgetVariables.OK_BUTTON).click();
@@ -256,12 +240,12 @@
if (jbdsIsRunning){
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- JBDS_REMOVE_JSF_CAPABILITIES_POPUP_MENU, true)).click();
+ IDELabel.Menu.JBDS_REMOVE_JSF_CAPABILITIES, true)).click();
}
else{
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- WEB_PROJECT_JBT_JSF_POPUP_MENU, false)).menu(
- JBT_REMOVE_JSF_CAPABILITIES_POPUP_MENU).click();
+ IDELabel.Menu.WEB_PROJECT_JBT_JSF, false)).menu(
+ IDELabel.Menu.JBT_REMOVE_JSF_CAPABILITIES).click();
}
@@ -305,13 +289,13 @@
try{
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- PACKAGE_EXPLORER_JBT_POPUP_MENU, false)).menu(
- ADD_JSF_CAPABILITIES_POPUP_MENU).click();
+ IDELabel.Menu.PACKAGE_EXPLORER_JBT, false)).menu(
+ IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
} catch (WidgetNotFoundException wnfe){
// From 3.1.0.RC1 version this menu is moved to Configure submenu
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- PACKAGE_EXPLORER_CONFIGURE_POPUP_MENU, false)).menu(
- ADD_JSF_CAPABILITIES_POPUP_MENU).click();
+ IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false)).menu(
+ IDELabel.Menu.ADD_JSF_CAPABILITIES).click();
}
bot.shell("Add JSF Capabilities").activate();
@@ -366,12 +350,12 @@
tree.getTreeItem(JBT_TEST_PROJECT_NAME));
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- CLOSE_PROJECT_POPUP_MENU, false)).click();
+ IDELabel.Menu.CLOSE_PROJECT, false)).click();
delay();
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree,
- OPEN_PROJECT_POPUP_MENU, false)).click();
+ IDELabel.Menu.OPEN_PROJECT, false)).click();
delay();
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-16 17:56:27 UTC (rev 19366)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTEclipseExt.java 2009-12-16 18:32:41 UTC (rev 19367)
@@ -18,10 +18,12 @@
import org.apache.log4j.Logger;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory;
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
@@ -39,11 +41,11 @@
*/
public class SWTEclipseExt {
- SWTBotExt bot;
+ SWTWorkbenchBot bot;
SWTUtilExt util;
Logger log = Logger.getLogger(SWTEclipseExt.class);
- public SWTEclipseExt(SWTBotExt bot) {
+ public SWTEclipseExt(SWTWorkbenchBot bot) {
this.bot = bot;
util = new SWTUtilExt(bot);
}
@@ -311,4 +313,30 @@
if (save)
editor.save();
}
+ /**
+ * Check if JBoss Developer Studio Is Running
+ * Dynamic version of isJBDSRun Method
+ * @return
+ */
+ public boolean isJBDSRun (){
+ return SWTEclipseExt.isJBDSRun(bot);
+ }
+ /**
+ * Check if JBoss Developer Studio Is Running
+ * @param bot
+ * @return
+ */
+ public static boolean isJBDSRun (SWTWorkbenchBot bot){
+ boolean jbdsIsRunning = false;
+ try{
+ bot.menu(IDELabel.Menu.HELP).menu(IDELabel.Menu.ABOUT_JBOSS_DEVELOPER_STUDIO);
+ jbdsIsRunning = true;
+ }catch (WidgetNotFoundException wnfe){
+ // do nothing
+ }
+
+ return jbdsIsRunning;
+
+ }
+
}
Modified: trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-16 17:56:27 UTC (rev 19366)
+++ trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/types/IDELabel.java 2009-12-16 18:32:41 UTC (rev 19367)
@@ -43,6 +43,16 @@
public static final String REMOVE = "Remove";
public static final String IMPORT = "Import...";
public static final String RUN_AS = "Run As";
+ public static final String WEB_PROJECT_JBT_JSF = "JBoss Tools JSF";
+ public static final String PACKAGE_EXPLORER_JBT = "JBoss Tools";
+ public static final String PACKAGE_EXPLORER_CONFIGURE = "Configure";
+ public static final String ADD_JSF_CAPABILITIES = "Add JSF Capabilities...";
+ public static final String CLOSE_PROJECT = "Close Project";
+ public static final String OPEN_PROJECT = "Open Project";
+ public static final String DELETE = "Delete";
+ public static final String JBDS_REMOVE_JSF_CAPABILITIES = "Remove Red Hat Capabilities";
+ public static final String JBT_REMOVE_JSF_CAPABILITIES = "Remove JSF Capabilities";
+
}
public class Button {
15 years
JBoss Tools SVN: r19366 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-16 12:56:27 -0500 (Wed, 16 Dec 2009)
New Revision: 19366
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ActionProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CSSClassProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ConverterIDProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalTypeFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EmptyProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EnumerationProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FaceletsJsfCProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FacetNameProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/IDProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ModelProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/NameSpaceProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourceBundleNameProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourcePathProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ValidatorIDProposalType.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ConverterIDProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpaceProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourceBundleNameProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ValidatorIDProposalType.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/IDResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/composite/CompositeComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibraryManager.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/JsfCore.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3875
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResource.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -14,7 +14,7 @@
import org.jboss.tools.jst.jsp.outline.ValueHelper;
import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType.Param;
/**
* @author Igels
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/AttributeValueResourceFactory.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -15,8 +15,8 @@
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalTypeFactory;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalTypeFactory;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/EnumerationResourceElement.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.drop.treeviewer.model;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType.Param;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/IDResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/IDResourceElement.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/IDResourceElement.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -3,7 +3,7 @@
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
public class IDResourceElement extends AttributeValueResource {
IPageContext pageContext;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/drop/treeviewer/model/ImageFileResourceElement.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -16,7 +16,7 @@
import org.eclipse.ui.IEditorInput;
import org.jboss.tools.jst.jsp.support.kb.WTPKbImageFileResource;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType.Param;
/**
* @author Igels
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -45,9 +45,9 @@
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.PageProcessor;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.EmptyProposalType;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibAttribute;
-import org.jboss.tools.jst.web.kb.internal.taglib.EmptyProposalType;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-12-16 17:56:27 UTC (rev 19366)
@@ -33,6 +33,7 @@
org.jboss.tools.jst.web.kb.el,
org.jboss.tools.jst.web.kb.include,
org.jboss.tools.jst.web.kb.internal,
+ org.jboss.tools.jst.web.kb.internal.proposal,
org.jboss.tools.jst.web.kb.internal.scanner,
org.jboss.tools.jst.web.kb.internal.taglib,
org.jboss.tools.jst.web.kb.internal.taglib.composite,
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ActionProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ActionProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ActionProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
+import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ActionProposalType extends ModelProposalType {
+
+ private static final String IMAGE_NAME = "JSFActionProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ if (!isReadyToUse()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ XModelObject xModelObject = EclipseResourceUtil.getObjectByResource(context.getResource());
+ if(xModelObject==null) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ String path = XModelObjectLoaderUtil.getResourcePath(xModelObject);
+ if(path==null) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ Properties view = new Properties();
+ view.put(IWebPromptingProvider.VIEW_PATH, path);
+ List<Object> sourceList = provider.getList(xModel, WebPromptingProvider.JSF_VIEW_ACTIONS, "", view); //$NON-NLS-1$
+ if (sourceList != null && !sourceList.isEmpty()) {
+ Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+ Iterator<Object> it = sourceList.iterator();
+ while(it.hasNext()) {
+ sorted.add(it.next().toString());
+ }
+ for (String text : sorted) {
+ if (text.trim().length() > 0 && text.toLowerCase().startsWith(query.getValue().toLowerCase())) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(text.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+ proposals.add(proposal);
+ }
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ActionProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CSSClassProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CSSClassProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CSSClassProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.ICSSContainerSupport;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.PageContextFactory.CSSStyleSheetDescriptor;
+import org.w3c.dom.css.CSSRule;
+import org.w3c.dom.css.CSSRuleList;
+
+/**
+ * The CSS Class proposal type. Is used to collect and return the proposals on
+ * the CSS classes
+ *
+ * @author Victor Rubezhny
+ *
+ */
+@SuppressWarnings("restriction")
+public class CSSClassProposalType extends CustomProposalType {
+ private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ static String ID = "cssclass"; //$NON-NLS-1$
+ static String QUOTE_1 = "'"; //$NON-NLS-1$
+ static String QUOTE_2 = "\""; //$NON-NLS-1$
+ Set<String> idList = new TreeSet<String>();
+
+ @Override
+ protected void init(IPageContext context) {
+ idList.clear();
+ if (context instanceof ICSSContainerSupport) {
+ ICSSContainerSupport cssSource = (ICSSContainerSupport)context;
+
+ List<CSSStyleSheetDescriptor> descrs = cssSource.getCSSStyleSheetDescriptors();
+ if (descrs != null) {
+ for (CSSStyleSheetDescriptor descr : descrs) {
+ CSSRuleList rules = descr.sheet.getCssRules();
+ for (int i = 0; rules != null && i < rules.getLength(); i++) {
+ CSSRule rule = rules.item(i);
+ idList.addAll(getNamesFromCSSRule(rule));
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the style name found in the specified CSS Rule
+ *
+ * @param cssRule
+ * @param styleName
+ * @return
+ */
+ public static Set<String> getNamesFromCSSRule(CSSRule cssRule) {
+ Set<String> styleNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+
+ // get selector text
+ String selectorText = ((ICSSStyleRule) cssRule).getSelectorText();
+
+ if (selectorText != null) {
+ String styles[] = selectorText.trim().split(","); //$NON-NLS-1$
+ for (String styleText : styles) {
+ String[] styleWords = styleText.trim().split(" "); //$NON-NLS-1$
+ if (styleWords != null) {
+ for (String name : styleWords) {
+ if (name.startsWith(".")) //$NON-NLS-1$
+ continue;
+
+ if (name.indexOf("[") >= 0) { //$NON-NLS-1$
+ name = name.substring(0, name.indexOf("[")); //$NON-NLS-1$
+ }
+ if (name.indexOf(".") >= 0) { //$NON-NLS-1$
+ name = name.substring(0, name.indexOf(".")); //$NON-NLS-1$
+ }
+ if (name.indexOf(":") >= 0) { //$NON-NLS-1$
+ name = name.substring(0, name.indexOf(":")); //$NON-NLS-1$
+ }
+
+ // Use the first word as a style name
+ styleNames.add(name);
+ }
+ }
+ }
+ }
+ return styleNames;
+ }
+
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ String v = query.getValue();
+ int offset = v.length();
+ int b = v.lastIndexOf(',');
+ if(b < 0) b = 0; else b += 1;
+ String tail = v.substring(offset);
+ int e = tail.indexOf(',');
+ if(e < 0) e = v.length(); else e += offset;
+ String prefix = v.substring(b).trim();
+
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ for (String text: idList) {
+ if(text.startsWith(prefix)) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(b + text.length());
+ proposal.setStart(b);
+ proposal.setEnd(e);
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+
+ proposals.add(proposal);
+ }
+ }
+
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CSSClassProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ConverterIDProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ConverterIDProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ConverterIDProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ConverterIDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class ConverterIDProposalType extends ModelProposalType {
+
+ private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ public ConverterIDProposalType() {}
+
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ String v = query.getValue();
+
+ List<Object> list = provider.getList(xModel, getListID(), v, new Properties());
+ Set<String> idList = new TreeSet<String>();
+ if(list != null) {
+ for (Object o: list) idList.add(o.toString());
+ }
+
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ for (String text: idList) {
+ if(text.startsWith(v)) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(text.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+
+ proposals.add(proposal);
+ }
+ }
+
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ protected String getListID() {
+ return IWebPromptingProvider.JSF_CONVERTER_IDS;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ConverterIDProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IProposalProcessor;
+import org.jboss.tools.jst.web.kb.KbQuery;
+
+/**
+ * @author Alexey Kazakov
+ */
+public abstract class CustomProposalType implements IProposalProcessor {
+
+ protected Param[] params;
+ protected String type;
+ protected IPageContext context;
+
+ protected abstract void init(IPageContext context);
+
+ /**
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @param type the type to set
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the params
+ */
+ public Param[] getParams() {
+ if(params==null) {
+ params = new Param[0];
+ }
+ return params;
+ }
+
+ /**
+ * @param params the params to set
+ */
+ public void setParams(Param[] params) {
+ this.params = params;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ this.context = context;
+ init(context);
+ return getProposals(query);
+ }
+
+ /**
+ * @param name
+ * @return
+ */
+ public String getParamValue(String name) {
+ if(params==null) {
+ return null;
+ }
+ for (int i = 0; i < params.length; i++) {
+ if(name.equals(params[i].getName())) {
+ return params[i].getValue();
+ }
+ }
+ return null;
+ }
+
+ abstract public TextProposal[] getProposals(KbQuery query);
+
+ public static class Param {
+
+ private String name;
+ private String value;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * @param value the value to set
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalTypeFactory.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalTypeFactory.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalTypeFactory.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class CustomProposalTypeFactory {
+
+ private static final CustomProposalTypeFactory INSTANCE = new CustomProposalTypeFactory();
+
+ public static final String RESOURCE_BUNDLE_NAME_TYPE = "bundleName"; //$NON-NLS-1$
+ public static final String ACTION_TYPE = "viewActions"; //$NON-NLS-1$
+ public static final String RESOURCE_PATH_TYPE = "file"; //$NON-NLS-1$
+ public static final String ENUMERATION_TYPE = "enumeration"; //$NON-NLS-1$
+ public static final String FACELETS_JSFC_TYPE = "faceletsJsfCTags"; //$NON-NLS-1$
+ public static final String NAME_SPACE_TYPE = "taglib"; //$NON-NLS-1$
+ public static final String ID_TYPE = "id"; //$NON-NLS-1$
+ public static final String CONVERTER_ID_TYPE = "converterID"; //$NON-NLS-1$
+ public static final String VALIDATOR_ID_TYPE = "validatorID"; //$NON-NLS-1$
+ public static final String CSSCLASS_TYPE = "cssclass"; //$NON-NLS-1$
+ public static final String FACET_NAME_TYPE = "facetName"; //$NON-NLS-1$
+
+ private CustomProposalTypeFactory() {
+ }
+
+ /**
+ * @return an instance of this factory.
+ */
+ public static CustomProposalTypeFactory getInstance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Creates Custom Proposal Type by name
+ * @param type
+ * @return
+ */
+ public CustomProposalType createProposalType(String type) {
+ if(RESOURCE_BUNDLE_NAME_TYPE.equals(type)) {
+ return new ResourceBundleNameProposalType();
+ }
+ if(ACTION_TYPE.equals(type)) {
+ return new ActionProposalType();
+ }
+ if(RESOURCE_PATH_TYPE.equals(type)) {
+ return new ResourcePathProposalType();
+ }
+ if(ENUMERATION_TYPE.equals(type)) {
+ return new EnumerationProposalType();
+ }
+ if(FACELETS_JSFC_TYPE.equals(type)) {
+ return new FaceletsJsfCProposalType();
+ }
+ if(NAME_SPACE_TYPE.equals(type)) {
+ return new NameSpaceProposalType();
+ }
+ if(ID_TYPE.equals(type)) {
+ return new IDProposalType();
+ }
+ if(CONVERTER_ID_TYPE.equals(type)) {
+ return new ConverterIDProposalType();
+ }
+ if(VALIDATOR_ID_TYPE.equals(type)) {
+ return new ValidatorIDProposalType();
+ }
+ if(CSSCLASS_TYPE.equals(type)) {
+ return new CSSClassProposalType();
+ }
+ if(FACET_NAME_TYPE.equals(type)) {
+ return new FacetNameProposalType();
+ }
+
+ //WebKbPlugin.getDefault().logError("Unknown proposal type: " + type); //$NON-NLS-1$
+ //ExtendedProposalType will report if necessary
+
+ EmptyProposalType proposalType = new EmptyProposalType();
+
+ return proposalType;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/CustomProposalTypeFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EmptyProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EmptyProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EmptyProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+
+public class EmptyProposalType extends CustomProposalType {
+
+ public EmptyProposalType() {}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EmptyProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EnumerationProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EnumerationProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EnumerationProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class EnumerationProposalType extends CustomProposalType {
+
+ private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ if(params==null) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ for (int i = 0; i < params.length; i++) {
+ String text = params[i].getValue();
+ if(text.startsWith(query.getValue())) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(text.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+ proposals.add(proposal);
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/EnumerationProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FaceletsJsfCProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FaceletsJsfCProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FaceletsJsfCProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
+import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
+import org.jboss.tools.jst.web.kb.taglib.CustomTagLibManager;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.INameSpace;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * @author Alexey Kazakov
+ */
+@SuppressWarnings("restriction")
+public class FaceletsJsfCProposalType extends CustomProposalType {
+
+ private static Image ICON;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ // trim first spaces
+ String value = query.getValue();
+ while(true) {
+ if(value.startsWith(" ")) { //$NON-NLS-1$
+ value = value.substring(1);
+ } else {
+ break;
+ }
+ }
+ KbQuery kbQuery = new KbQuery();
+ kbQuery.setMask(query.isMask());
+ kbQuery.setType(KbQuery.Type.TAG_NAME);
+ kbQuery.setValue(query.getValue());
+ kbQuery.setOffset(query.getOffset());
+
+ IComponent[] components = null;
+ List<TextProposal> proposals = null;
+ components = PageProcessor.getInstance().getComponents(kbQuery, context);
+ if(components.length==0) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ proposals = new ArrayList<TextProposal>();
+ Map<String, List<String>> prefixes = new HashMap<String, List<String>>();
+ for (int i = 0; i < components.length; i++) {
+ ITagLibrary lib = components[i].getTagLib();
+ if(ignoreTagLib(lib)) {
+ continue;
+ }
+ List<String> pfx = prefixes.get(lib.getURI());
+ if(pfx==null) {
+ pfx = getPrefixes((IPageContext)context, components[i], kbQuery);
+ prefixes.put(lib.getURI(), pfx);
+ }
+ for (String prefix : pfx) {
+ TextProposal proposal = getProposal(prefix, components[i]);
+ proposals.add(proposal);
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ private boolean ignoreTagLib(ITagLibrary lib) {
+ return CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(lib.getURI()) || CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI.equals(lib.getURI());
+ }
+
+ private TextProposal getProposal(String prefix, IComponent component) {
+ TextProposal proposal = new TextProposal();
+ proposal.setContextInfo(component.getDescription());
+ proposal.setSource(component);
+ StringBuffer label = new StringBuffer();
+ label.append(prefix + KbQuery.PREFIX_SEPARATOR);
+ label.append(component.getName());
+ proposal.setLabel(label.toString());
+ proposal.setReplacementString(proposal.getLabel());
+ int position = proposal.getReplacementString().length();
+ proposal.setPosition(position);
+ if (ICON == null) {
+ ICON = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+ }
+ proposal.setImage(ICON);
+
+ return proposal;
+ }
+
+ private List<String> getPrefixes(IPageContext context, IComponent component, KbQuery query) {
+ List<String> prefixes = new ArrayList<String>();
+ Map<String, List<INameSpace>> nameSpaces = context.getNameSpaces(query.getOffset());
+ if(nameSpaces!=null) {
+ List<INameSpace> nameSpace = nameSpaces.get(component.getTagLib().getURI());
+ if(nameSpace!=null) {
+ for (INameSpace n : nameSpace) {
+ prefixes.add(n.getPrefix());
+ }
+ }
+ }
+ return prefixes;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FaceletsJsfCProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FacetNameProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FacetNameProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FacetNameProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.PageProcessor;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.taglib.Facet;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.IFacesConfigTagLibrary;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+import org.jboss.tools.jst.web.kb.taglib.TagLibraryManager;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class FacetNameProposalType extends CustomProposalType {
+
+ private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ private IPageContext context;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ String[] parentTags = query.getParentTags();
+ Set<String> facetNames = new HashSet<String>();
+ if(parentTags.length>1) {
+ String parentTag = parentTags[parentTags.length-2];
+ KbQuery newQuery = new KbQuery();
+ newQuery.setMask(false);
+ newQuery.setType(KbQuery.Type.TAG_NAME);
+ newQuery.setValue(parentTag);
+ newQuery.setOffset(query.getOffset());
+ IComponent[] components = PageProcessor.getInstance().getComponents(newQuery, context);
+ Set<String> types = new HashSet<String>();
+ for (int i = 0; i < components.length; i++) {
+ String type = components[i].getComponentType();
+ if(type!=null) {
+ types.add(type.trim());
+ }
+ }
+ if(!types.isEmpty()) {
+ ITagLibrary[] libs = TagLibraryManager.getLibraries(context.getResource().getProject());
+ for (ITagLibrary lib : libs) {
+ if(lib instanceof IFacesConfigTagLibrary) {
+ for (String type : types) {
+ IComponent comp = lib.getComponentByType(type);
+ Facet[] facets = comp.getFacets();
+ if(facets!=null) {
+ for (int i = 0; i < facets.length; i++) {
+ facetNames.add(facets[i].getName());
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ for (String facetName : facetNames) {
+ if(facetName.startsWith(query.getValue())) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(facetName);
+ proposal.setReplacementString(facetName);
+ proposal.setPosition(facetName.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposals.add(proposal);
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ this.context = context;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/FacetNameProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/IDProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/IDProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/IDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+@SuppressWarnings("restriction")
+public class IDProposalType extends CustomProposalType {
+ private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ static String ID = "id"; //$NON-NLS-1$
+ static String QUOTE_1 = "'"; //$NON-NLS-1$
+ static String QUOTE_2 = "\""; //$NON-NLS-1$
+ Set<String> idList = new TreeSet<String>();
+
+ @Override
+ protected void init(IPageContext context) {
+ idList.clear();
+
+ IDocument document = context.getDocument();
+ IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
+ try {
+ if (sModel != null) {
+ Document sd = (sModel instanceof IDOMModel) ? ((IDOMModel) sModel).getDocument() : null;
+ if(sd != null) {
+ Element root = sd.getDocumentElement();
+ collectIDs(root);
+ }
+ }
+ } finally {
+ if (sModel != null) {
+ sModel.releaseFromRead();
+ }
+ }
+ }
+
+ private void collectIDs(Element element) {
+ String id = element.getAttribute(ID);
+ if(id != null && id.length() > 0) idList.add(id);
+ NodeList cs = element.getChildNodes();
+ for (int i = 0; i < cs.getLength(); i++) {
+ Node n = cs.item(i);
+ if(n.getNodeType() == Node.ELEMENT_NODE) {
+ collectIDs((Element)n);
+ }
+ }
+ }
+
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ String v = query.getValue();
+ int offset = v.length();
+ int b = v.lastIndexOf(',');
+ if(b < 0) b = 0; else b += 1;
+ String tail = v.substring(offset);
+ int e = tail.indexOf(',');
+ if(e < 0) e = v.length(); else e += offset;
+ String prefix = v.substring(b).trim();
+
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ for (String text: idList) {
+ if(text.startsWith(prefix)) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(b + text.length());
+ proposal.setStart(b);
+ proposal.setEnd(e);
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+
+ proposals.add(proposal);
+ }
+ }
+
+ return proposals.toArray(new TextProposal[0]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/IDProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ModelProposalType.java (from rev 19273, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ModelProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ModelProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+
+/**
+ * @author Alexey Kazakov
+ */
+public abstract class ModelProposalType extends CustomProposalType {
+
+ protected WebPromptingProvider provider;
+ protected XModel xModel;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ provider = WebPromptingProvider.getInstance();
+ xModel = null;
+ IModelNature nature = EclipseResourceUtil.getModelNature(context.getResource().getProject());
+ if(nature!=null) {
+ xModel = nature.getModel();
+ }
+ }
+
+ protected boolean isReadyToUse() {
+ return (provider != null && xModel != null);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ModelProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/NameSpaceProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpaceProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/NameSpaceProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/NameSpaceProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class NameSpaceProposalType extends ModelProposalType {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ if (!isReadyToUse()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ String rQuery = getPassiveQueryPart(query.getValue());
+ Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+ List<Object> beanList = provider.getList(xModel, WebPromptingProvider.JSF_GET_TAGLIBS, "", null); //$NON-NLS-1$
+ Iterator<Object> itr = beanList.iterator();
+ while (itr.hasNext()) {
+ sorted.add(itr.next().toString());
+ }
+ for (String text : sorted) {
+ if(rQuery.length() == 0 || text.startsWith(rQuery)) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposals.add(proposal);
+ proposal.setPosition(proposal.getReplacementString().length());
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ private String getPassiveQueryPart(String query) {
+ if (query == null || query.trim().length() == 0) {
+ return ""; //$NON-NLS-1$
+ }
+ return query;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/NameSpaceProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourceBundleNameProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourceBundleNameProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourceBundleNameProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourceBundleNameProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ResourceBundleNameProposalType extends ModelProposalType {
+
+ private static final String IMAGE_NAME = "MessageBundleProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ if (!isReadyToUse()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ List<Object> sourceList = provider.getList(xModel, WebPromptingProvider.JSF_BUNDLES, "", null); //$NON-NLS-1$
+ if (sourceList != null && !sourceList.isEmpty()) {
+ Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+ Iterator<Object> it = sourceList.iterator();
+ while(it.hasNext()) {
+ sorted.add(it.next().toString());
+ }
+ for (String text : sorted) {
+ if (text.toLowerCase().startsWith(query.getValue().toLowerCase())) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(text);
+ proposal.setReplacementString(text);
+ proposal.setPosition(text.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+ proposals.add(proposal);
+ }
+ }
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourceBundleNameProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourcePathProposalType.java (from rev 19273, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourcePathProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourcePathProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,301 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ResourcePathProposalType extends ModelProposalType {
+
+ private static final String IMAGE_NAME = "ResourcePathProposal.gif"; //$NON-NLS-1$
+ private static Image ICON;
+ private static Set<String> GRAPHIC_FILE_EXTENSIONS = new HashSet<String>();
+ private static Set<String> PAGE_FILE_EXTENSIONS = new HashSet<String>();
+ static {
+ String[] images = {"gif", "jpeg", "jpg", "png", "wbmp", "bmp"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+ for (int i = 0; i < images.length; i++) {
+ GRAPHIC_FILE_EXTENSIONS.add(images[i]);
+ }
+ String[] pages = {"jsp", "htm", "html", "xhtml", "xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ for (int i = 0; i < pages.length; i++) {
+ PAGE_FILE_EXTENSIONS.add(pages[i]);
+ }
+ }
+ private static String PATH_ADDITION = "pathAddition"; //$NON-NLS-1$
+
+ private IContainer webRootResource;
+ private Set<String> extensions;
+ private List<String> enumeration;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.ModelProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ super.init(context);
+ webRootResource = null;
+ if(xModel != null) {
+ XModelObject webInf = FileSystemsHelper.getWebInf(xModel);
+ XModelObject webRoot = FileSystemsHelper.getWebRoot(xModel);
+ if(webInf != null && webRoot != null) {
+ webRootResource = (IContainer)EclipseResourceUtil.getResource(webRoot);
+ }
+ }
+ if(extensions==null) {
+ initExtensions();
+ }
+ if(enumeration==null) {
+ enumeration = new ArrayList<String>();
+ if(params!=null) {
+ for (int i = 0; i < params.length; i++) {
+ if(PATH_ADDITION.equals(params[i].getName())) {
+ enumeration.add(params[i].getValue());
+ }
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ if(!isReadyToUse()) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ ImagePathDescriptor[] images = getImagesFilesPathes(query.getValue());
+ for(int i=0; i<images.length; i++) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(images[i].getQueryPath());
+ String replacementString = images[i].getQueryPath();
+ if(images[i].getResource() instanceof IFolder) {
+ replacementString = replacementString + "/"; //$NON-NLS-1$
+ proposal.setAutoActivationContentAssistantAfterApplication(true);
+ }
+ proposal.setReplacementString(replacementString);
+ proposal.setPosition(replacementString.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+ proposals.add(proposal);
+ }
+ for (String path : enumeration) {
+ TextProposal proposal = new TextProposal();
+ proposal.setLabel(path);
+ String replacementString = path;
+ proposal.setAutoActivationContentAssistantAfterApplication(false);
+ proposal.setReplacementString(replacementString);
+ proposal.setPosition(replacementString.length());
+ if(ICON==null) {
+ ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
+ }
+ proposal.setImage(ICON);
+ proposals.add(proposal);
+ }
+ return proposals.toArray(new TextProposal[0]);
+ }
+
+ private static final String EXTENSIONS_PARAM_NAME = "extensions"; //$NON-NLS-1$
+ private static final String IMAGE_PARAM_TYPE = "%image%"; //$NON-NLS-1$
+ private static final String PAGE_PARAM_TYPE = "%page%"; //$NON-NLS-1$
+
+ private void initExtensions() {
+ String value = getParamValue(EXTENSIONS_PARAM_NAME);
+ if(value != null && !value.equals("*")) { //$NON-NLS-1$
+ if(IMAGE_PARAM_TYPE.equals(value)) {
+ this.extensions = GRAPHIC_FILE_EXTENSIONS;
+ } else if("%page%".equals(value)) { //$NON-NLS-1$
+ this.extensions = PAGE_FILE_EXTENSIONS;
+ } else {
+ StringTokenizer st = new StringTokenizer(value, ",;"); //$NON-NLS-1$
+ if(st.countTokens() > 0) {
+ extensions = new HashSet<String>();
+ while(st.hasMoreTokens()) {
+ String t = st.nextToken().trim();
+ if(t.length() == 0) {
+ continue;
+ }
+ if(IMAGE_PARAM_TYPE.equals(t)) {
+ extensions.addAll(GRAPHIC_FILE_EXTENSIONS);
+ } else if(PAGE_PARAM_TYPE.equals(t)) {
+ extensions.addAll(PAGE_FILE_EXTENSIONS);
+ } else {
+ extensions.add(t);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.ModelProposalType#isReadyToUse()
+ */
+ protected boolean isReadyToUse() {
+ return webRootResource!=null;
+ }
+
+ private ImagePathDescriptor[] getImagesFilesPathes(String query) {
+ query = query.trim();
+ if(query.indexOf('\\')>-1) {
+ return new ImagePathDescriptor[0];
+ }
+ if(query.length()==0) {
+ query = "/"; //$NON-NLS-1$
+ }
+ int lastSeparator = query.lastIndexOf('/');
+ String name = null;
+ String pathWithoutLastSegment = null;
+ if(lastSeparator>-1) {
+ pathWithoutLastSegment = query.substring(0, lastSeparator);
+ if(lastSeparator+1<query.length()) {
+ name = query.substring(lastSeparator+1, query.length());
+ } else {
+ name = ""; //$NON-NLS-1$
+ }
+ } else {
+ pathWithoutLastSegment = ""; //$NON-NLS-1$
+ name = query;
+ }
+ if(name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if(pathWithoutLastSegment.length()>0) {
+ pathWithoutLastSegment = pathWithoutLastSegment + "/" + name; //$NON-NLS-1$
+ } else {
+ if(query.startsWith("/")) { //$NON-NLS-1$
+ pathWithoutLastSegment = "/" + name; //$NON-NLS-1$
+ } else {
+ pathWithoutLastSegment = name;
+ }
+ }
+ name = ""; //$NON-NLS-1$
+ }
+ if(name==null) {
+ name = ""; //$NON-NLS-1$
+ }
+ IResource resource;
+ String startPath = pathWithoutLastSegment;
+ if(pathWithoutLastSegment.startsWith("/")) { //$NON-NLS-1$
+ if(pathWithoutLastSegment.length()>1) {
+ startPath = pathWithoutLastSegment.substring(1);
+ } else {
+ startPath = ""; //$NON-NLS-1$
+ }
+ }
+ if(query.startsWith("/")) { //$NON-NLS-1$
+ resource = webRootResource.findMember(startPath);
+ } else {
+ resource = context.getResource().getParent().findMember(startPath);
+ }
+
+ List<IResource> resources = new ArrayList<IResource>();
+ try {
+ if(resource != null) resource.accept(new ImagesFinder(resources, name, extensions));
+ } catch (CoreException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ ImagePathDescriptor[] filesPathes = new ImagePathDescriptor[resources.size()];
+ for(int i=0; i<filesPathes.length; i++) {
+ String prefix = pathWithoutLastSegment.toString();
+ if(!prefix.endsWith("/")) { //$NON-NLS-1$
+ prefix = prefix + '/';
+ }
+ IResource r = (IResource)resources.get(i);
+ filesPathes[i] = new ImagePathDescriptor(prefix + r.getName(), r);
+ }
+ return filesPathes;
+ }
+
+ private static class ImagePathDescriptor {
+ private String queryPath;
+ private IResource resource;
+
+ public ImagePathDescriptor(String queryPath, IResource resource) {
+ this.queryPath = queryPath;
+ this.resource = resource;
+ }
+
+ public String getQueryPath() {
+ return queryPath;
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+ }
+
+ private static class ImagesFinder implements IResourceVisitor {
+ private List<IResource> resources;
+ private int count = 0;
+ private String name;
+ Set<String> extensions = null;
+
+ /**
+ * @param resources
+ * @param name
+ * @param extensions
+ */
+ public ImagesFinder(List<IResource> resources, String name, Set<String> extensions) {
+ this.resources = resources;
+ this.name = name;
+ this.extensions = extensions;
+ }
+
+ boolean acceptExtension(String ext) {
+ if(ext != null) {
+ ext = ext.toLowerCase();
+ }
+ return (extensions == null || extensions.contains(ext));
+ }
+
+ public boolean visit(IResource resource) throws CoreException {
+ if(resource instanceof IFile) {
+ IFile file = (IFile)resource;
+ if(resource.getName().startsWith(name) && acceptExtension(file.getFileExtension())) {
+ resources.add(resource);
+ }
+ } else if(resource instanceof IFolder) {
+ if(count==0) {
+ count++;
+ return true;
+ } else if(resource.getName().startsWith(name) && (!resource.getName().equals("WEB-INF")) && (!resource.getName().equals("META-INF"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ resources.add(resource);
+ }
+ }
+ return false;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ResourcePathProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ValidatorIDProposalType.java (from rev 19076, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ValidatorIDProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ValidatorIDProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ValidatorIDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.proposal;
+
+import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class ValidatorIDProposalType extends ConverterIDProposalType {
+
+ public ValidatorIDProposalType() {}
+
+ @Override
+ protected String getListID() {
+ return IWebPromptingProvider.JSF_VALIDATOR_IDS;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/proposal/ValidatorIDProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -77,6 +77,20 @@
return components.get(name);
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.ITagLibrary#getComponentByType(java.lang.String)
+ */
+ public IComponent getComponentByType(String type) {
+ IComponent[] comps = getComponents();
+ for (int i = 0; i < comps.length; i++) {
+ if(type.equals(comps[i].getComponentType())) {
+ return comps[i];
+ }
+ }
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getComponents(java.lang.String)
*/
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
-import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-
-/**
- * @author Alexey Kazakov
- */
-public class ActionProposalType extends ModelProposalType {
-
- private static final String IMAGE_NAME = "JSFActionProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- if (!isReadyToUse()) {
- return EMPTY_PROPOSAL_LIST;
- }
- XModelObject xModelObject = EclipseResourceUtil.getObjectByResource(context.getResource());
- if(xModelObject==null) {
- return EMPTY_PROPOSAL_LIST;
- }
- String path = XModelObjectLoaderUtil.getResourcePath(xModelObject);
- if(path==null) {
- return EMPTY_PROPOSAL_LIST;
- }
- Properties view = new Properties();
- view.put(IWebPromptingProvider.VIEW_PATH, path);
- List<Object> sourceList = provider.getList(xModel, WebPromptingProvider.JSF_VIEW_ACTIONS, "", view); //$NON-NLS-1$
- if (sourceList != null && !sourceList.isEmpty()) {
- Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- Iterator<Object> it = sourceList.iterator();
- while(it.hasNext()) {
- sorted.add(it.next().toString());
- }
- for (String text : sorted) {
- if (text.trim().length() > 0 && text.toLowerCase().startsWith(query.getValue().toLowerCase())) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(text.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
- proposals.add(proposal);
- }
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.ICSSContainerSupport;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.jboss.tools.jst.web.kb.PageContextFactory.CSSStyleSheetDescriptor;
-import org.w3c.dom.css.CSSRule;
-import org.w3c.dom.css.CSSRuleList;
-
-/**
- * The CSS Class proposal type. Is used to collect and return the proposals on
- * the CSS classes
- *
- * @author Victor Rubezhny
- *
- */
-@SuppressWarnings("restriction")
-public class CSSClassProposalType extends CustomProposalType {
- private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- static String ID = "cssclass"; //$NON-NLS-1$
- static String QUOTE_1 = "'"; //$NON-NLS-1$
- static String QUOTE_2 = "\""; //$NON-NLS-1$
- Set<String> idList = new TreeSet<String>();
-
- @Override
- protected void init(IPageContext context) {
- idList.clear();
- if (context instanceof ICSSContainerSupport) {
- ICSSContainerSupport cssSource = (ICSSContainerSupport)context;
-
- List<CSSStyleSheetDescriptor> descrs = cssSource.getCSSStyleSheetDescriptors();
- if (descrs != null) {
- for (CSSStyleSheetDescriptor descr : descrs) {
- CSSRuleList rules = descr.sheet.getCssRules();
- for (int i = 0; rules != null && i < rules.getLength(); i++) {
- CSSRule rule = rules.item(i);
- idList.addAll(getNamesFromCSSRule(rule));
- }
- }
- }
- }
- }
-
- /**
- * Returns the style name found in the specified CSS Rule
- *
- * @param cssRule
- * @param styleName
- * @return
- */
- public static Set<String> getNamesFromCSSRule(CSSRule cssRule) {
- Set<String> styleNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
-
- // get selector text
- String selectorText = ((ICSSStyleRule) cssRule).getSelectorText();
-
- if (selectorText != null) {
- String styles[] = selectorText.trim().split(","); //$NON-NLS-1$
- for (String styleText : styles) {
- String[] styleWords = styleText.trim().split(" "); //$NON-NLS-1$
- if (styleWords != null) {
- for (String name : styleWords) {
- if (name.startsWith(".")) //$NON-NLS-1$
- continue;
-
- if (name.indexOf("[") >= 0) { //$NON-NLS-1$
- name = name.substring(0, name.indexOf("[")); //$NON-NLS-1$
- }
- if (name.indexOf(".") >= 0) { //$NON-NLS-1$
- name = name.substring(0, name.indexOf(".")); //$NON-NLS-1$
- }
- if (name.indexOf(":") >= 0) { //$NON-NLS-1$
- name = name.substring(0, name.indexOf(":")); //$NON-NLS-1$
- }
-
- // Use the first word as a style name
- styleNames.add(name);
- }
- }
- }
- }
- return styleNames;
- }
-
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- String v = query.getValue();
- int offset = v.length();
- int b = v.lastIndexOf(',');
- if(b < 0) b = 0; else b += 1;
- String tail = v.substring(offset);
- int e = tail.indexOf(',');
- if(e < 0) e = v.length(); else e += offset;
- String prefix = v.substring(b).trim();
-
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- for (String text: idList) {
- if(text.startsWith(prefix)) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(b + text.length());
- proposal.setStart(b);
- proposal.setEnd(e);
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
-
- proposals.add(proposal);
- }
- }
-
- return proposals.toArray(new TextProposal[0]);
- }
-
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ConverterIDProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ConverterIDProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ConverterIDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
-
-/**
- *
- * @author Viacheslav Kabanovich
- *
- */
-public class ConverterIDProposalType extends ModelProposalType {
-
- private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- public ConverterIDProposalType() {}
-
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- String v = query.getValue();
-
- List<Object> list = provider.getList(xModel, getListID(), v, new Properties());
- Set<String> idList = new TreeSet<String>();
- if(list != null) {
- for (Object o: list) idList.add(o.toString());
- }
-
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- for (String text: idList) {
- if(text.startsWith(v)) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(text.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
-
- proposals.add(proposal);
- }
- }
-
- return proposals.toArray(new TextProposal[0]);
- }
-
- protected String getListID() {
- return IWebPromptingProvider.JSF_CONVERTER_IDS;
- }
-
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.IProposalProcessor;
-import org.jboss.tools.jst.web.kb.KbQuery;
-
-/**
- * @author Alexey Kazakov
- */
-public abstract class CustomProposalType implements IProposalProcessor {
-
- protected Param[] params;
- protected String type;
- protected IPageContext context;
-
- protected abstract void init(IPageContext context);
-
- /**
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * @param type the type to set
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * @return the params
- */
- public Param[] getParams() {
- if(params==null) {
- params = new Param[0];
- }
- return params;
- }
-
- /**
- * @param params the params to set
- */
- public void setParams(Param[] params) {
- this.params = params;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
- */
- public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- this.context = context;
- init(context);
- return getProposals(query);
- }
-
- /**
- * @param name
- * @return
- */
- public String getParamValue(String name) {
- if(params==null) {
- return null;
- }
- for (int i = 0; i < params.length; i++) {
- if(name.equals(params[i].getName())) {
- return params[i].getValue();
- }
- }
- return null;
- }
-
- abstract public TextProposal[] getProposals(KbQuery query);
-
- public static class Param {
-
- private String name;
- private String value;
-
- /**
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * @param value the value to set
- */
- public void setValue(String value) {
- this.value = value;
- }
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-
-/**
- * @author Alexey Kazakov
- */
-public class CustomProposalTypeFactory {
-
- private static final CustomProposalTypeFactory INSTANCE = new CustomProposalTypeFactory();
-
- public static final String RESOURCE_BUNDLE_NAME_TYPE = "bundleName"; //$NON-NLS-1$
- public static final String ACTION_TYPE = "viewActions"; //$NON-NLS-1$
- public static final String RESOURCE_PATH_TYPE = "file"; //$NON-NLS-1$
- public static final String ENUMERATION_TYPE = "enumeration"; //$NON-NLS-1$
- public static final String FACELETS_JSFC_TYPE = "faceletsJsfCTags"; //$NON-NLS-1$
- public static final String NAME_SPACE_TYPE = "taglib"; //$NON-NLS-1$
- public static final String ID_TYPE = "id"; //$NON-NLS-1$
- public static final String CONVERTER_ID_TYPE = "converterID"; //$NON-NLS-1$
- public static final String VALIDATOR_ID_TYPE = "validatorID"; //$NON-NLS-1$
- public static final String CSSCLASS_TYPE = "cssclass"; //$NON-NLS-1$
-
- private CustomProposalTypeFactory() {
- }
-
- /**
- * @return an instance of this factory.
- */
- public static CustomProposalTypeFactory getInstance() {
- return INSTANCE;
- }
-
- /**
- * Creates Custom Proposal Type by name
- * @param type
- * @return
- */
- public CustomProposalType createProposalType(String type) {
- if(RESOURCE_BUNDLE_NAME_TYPE.equals(type)) {
- return new ResourceBundleNameProposalType();
- }
- if(ACTION_TYPE.equals(type)) {
- return new ActionProposalType();
- }
- if(RESOURCE_PATH_TYPE.equals(type)) {
- return new ResourcePathProposalType();
- }
- if(ENUMERATION_TYPE.equals(type)) {
- return new EnumerationProposalType();
- }
- if(FACELETS_JSFC_TYPE.equals(type)) {
- return new FaceletsJsfCProposalType();
- }
- if(NAME_SPACE_TYPE.equals(type)) {
- return new NameSpaceProposalType();
- }
- if(ID_TYPE.equals(type)) {
- return new IDProposalType();
- }
- if(CONVERTER_ID_TYPE.equals(type)) {
- return new ConverterIDProposalType();
- }
- if(VALIDATOR_ID_TYPE.equals(type)) {
- return new ValidatorIDProposalType();
- }
- if(CSSCLASS_TYPE.equals(type)) {
- return new CSSClassProposalType();
- }
-
- //WebKbPlugin.getDefault().logError("Unknown proposal type: " + type); //$NON-NLS-1$
- //ExtendedProposalType will report if necessary
-
- EmptyProposalType proposalType = new EmptyProposalType();
-
- return proposalType;
- }
-}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -16,6 +16,7 @@
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -23,6 +23,8 @@
import javax.xml.parsers.ParserConfigurationException;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalTypeFactory;
import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibrary;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-
-public class EmptyProposalType extends CustomProposalType {
-
- public EmptyProposalType() {}
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- return EMPTY_PROPOSAL_LIST;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-
-/**
- * @author Alexey Kazakov
- */
-public class EnumerationProposalType extends CustomProposalType {
-
- private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- if(params==null) {
- return EMPTY_PROPOSAL_LIST;
- }
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- for (int i = 0; i < params.length; i++) {
- String text = params[i].getValue();
- if(text.startsWith(query.getValue())) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(text.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
- proposals.add(proposal);
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
-import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.PageProcessor;
-import org.jboss.tools.jst.web.kb.taglib.CustomTagLibManager;
-import org.jboss.tools.jst.web.kb.taglib.IComponent;
-import org.jboss.tools.jst.web.kb.taglib.INameSpace;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * @author Alexey Kazakov
- */
-@SuppressWarnings("restriction")
-public class FaceletsJsfCProposalType extends CustomProposalType {
-
- private static Image ICON;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- // trim first spaces
- String value = query.getValue();
- while(true) {
- if(value.startsWith(" ")) { //$NON-NLS-1$
- value = value.substring(1);
- } else {
- break;
- }
- }
- KbQuery kbQuery = new KbQuery();
- kbQuery.setMask(query.isMask());
- kbQuery.setType(KbQuery.Type.TAG_NAME);
- kbQuery.setValue(query.getValue());
- kbQuery.setOffset(query.getOffset());
-
- IComponent[] components = null;
- List<TextProposal> proposals = null;
- components = PageProcessor.getInstance().getComponents(kbQuery, context);
- if(components.length==0) {
- return EMPTY_PROPOSAL_LIST;
- }
- proposals = new ArrayList<TextProposal>();
- Map<String, List<String>> prefixes = new HashMap<String, List<String>>();
- for (int i = 0; i < components.length; i++) {
- ITagLibrary lib = components[i].getTagLib();
- if(ignoreTagLib(lib)) {
- continue;
- }
- List<String> pfx = prefixes.get(lib.getURI());
- if(pfx==null) {
- pfx = getPrefixes((IPageContext)context, components[i], kbQuery);
- prefixes.put(lib.getURI(), pfx);
- }
- for (String prefix : pfx) {
- TextProposal proposal = getProposal(prefix, components[i]);
- proposals.add(proposal);
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-
- private boolean ignoreTagLib(ITagLibrary lib) {
- return CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(lib.getURI()) || CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI.equals(lib.getURI());
- }
-
- private TextProposal getProposal(String prefix, IComponent component) {
- TextProposal proposal = new TextProposal();
- proposal.setContextInfo(component.getDescription());
- proposal.setSource(component);
- StringBuffer label = new StringBuffer();
- label.append(prefix + KbQuery.PREFIX_SEPARATOR);
- label.append(component.getName());
- proposal.setLabel(label.toString());
- proposal.setReplacementString(proposal.getLabel());
- int position = proposal.getReplacementString().length();
- proposal.setPosition(position);
- if (ICON == null) {
- ICON = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- }
- proposal.setImage(ICON);
-
- return proposal;
- }
-
- private List<String> getPrefixes(IPageContext context, IComponent component, KbQuery query) {
- List<String> prefixes = new ArrayList<String>();
- Map<String, List<INameSpace>> nameSpaces = context.getNameSpaces(query.getOffset());
- if(nameSpaces!=null) {
- List<INameSpace> nameSpace = nameSpaces.get(component.getTagLib().getURI());
- if(nameSpace!=null) {
- for (INameSpace n : nameSpace) {
- prefixes.add(n.getPrefix());
- }
- }
- }
- return prefixes;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.PageProcessor;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.jboss.tools.jst.web.kb.taglib.IFaceletTagLibrary;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * @author Alexey Kazakov
- */
-public class FacetNameProposalType extends CustomProposalType {
-
- private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- private IPageContext context;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- String[] parentTags = query.getParentTags();
- if(parentTags.length>1) {
- String parentTag = parentTags[parentTags.length-2];
- if(parentTag.contains(":")) { //$NON-NLS-1$
- KbQuery newQuery = new KbQuery();
- newQuery.setMask(false);
- newQuery.setType(KbQuery.Type.TAG_NAME);
- newQuery.setValue(parentTag);
- PageProcessor.getInstance().getComponents(query, context);
- ITagLibrary[] libs = context.getLibraries();
- for (ITagLibrary l : libs) {
- if(l instanceof IFaceletTagLibrary) {
- //TODO
- }
- }
- }
- }
- List<String> facetNames = new ArrayList<String>();
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- for (String facetName : facetNames) {
- if(facetName.startsWith(query.getValue())) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(facetName);
- proposal.setReplacementString(facetName);
- proposal.setPosition(facetName.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposals.add(proposal);
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- this.context = context;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-@SuppressWarnings("restriction")
-public class IDProposalType extends CustomProposalType {
- private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- static String ID = "id"; //$NON-NLS-1$
- static String QUOTE_1 = "'"; //$NON-NLS-1$
- static String QUOTE_2 = "\""; //$NON-NLS-1$
- Set<String> idList = new TreeSet<String>();
-
- @Override
- protected void init(IPageContext context) {
- idList.clear();
-
- IDocument document = context.getDocument();
- IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
- try {
- if (sModel != null) {
- Document sd = (sModel instanceof IDOMModel) ? ((IDOMModel) sModel).getDocument() : null;
- if(sd != null) {
- Element root = sd.getDocumentElement();
- collectIDs(root);
- }
- }
- } finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- }
-
- private void collectIDs(Element element) {
- String id = element.getAttribute(ID);
- if(id != null && id.length() > 0) idList.add(id);
- NodeList cs = element.getChildNodes();
- for (int i = 0; i < cs.getLength(); i++) {
- Node n = cs.item(i);
- if(n.getNodeType() == Node.ELEMENT_NODE) {
- collectIDs((Element)n);
- }
- }
- }
-
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- String v = query.getValue();
- int offset = v.length();
- int b = v.lastIndexOf(',');
- if(b < 0) b = 0; else b += 1;
- String tail = v.substring(offset);
- int e = tail.indexOf(',');
- if(e < 0) e = v.length(); else e += offset;
- String prefix = v.substring(b).trim();
-
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- for (String text: idList) {
- if(text.startsWith(prefix)) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(b + text.length());
- proposal.setStart(b);
- proposal.setEnd(e);
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
-
- proposals.add(proposal);
- }
- }
-
- return proposals.toArray(new TextProposal[0]);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-
-/**
- * @author Alexey Kazakov
- */
-public abstract class ModelProposalType extends CustomProposalType {
-
- protected WebPromptingProvider provider;
- protected XModel xModel;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- provider = WebPromptingProvider.getInstance();
- xModel = null;
- IModelNature nature = EclipseResourceUtil.getModelNature(context.getResource().getProject());
- if(nature!=null) {
- xModel = nature.getModel();
- }
- }
-
- protected boolean isReadyToUse() {
- return (provider != null && xModel != null);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpaceProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpaceProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpaceProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-
-/**
- * @author Alexey Kazakov
- */
-public class NameSpaceProposalType extends ModelProposalType {
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- if (!isReadyToUse()) {
- return EMPTY_PROPOSAL_LIST;
- }
- String rQuery = getPassiveQueryPart(query.getValue());
- Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- List<Object> beanList = provider.getList(xModel, WebPromptingProvider.JSF_GET_TAGLIBS, "", null); //$NON-NLS-1$
- Iterator<Object> itr = beanList.iterator();
- while (itr.hasNext()) {
- sorted.add(itr.next().toString());
- }
- for (String text : sorted) {
- if(rQuery.length() == 0 || text.startsWith(rQuery)) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposals.add(proposal);
- proposal.setPosition(proposal.getReplacementString().length());
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-
- private String getPassiveQueryPart(String query) {
- if (query == null || query.trim().length() == 0) {
- return ""; //$NON-NLS-1$
- }
- return query;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourceBundleNameProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourceBundleNameProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourceBundleNameProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-
-/**
- * @author Alexey Kazakov
- */
-public class ResourceBundleNameProposalType extends ModelProposalType {
-
- private static final String IMAGE_NAME = "MessageBundleProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- if (!isReadyToUse()) {
- return EMPTY_PROPOSAL_LIST;
- }
- List<Object> sourceList = provider.getList(xModel, WebPromptingProvider.JSF_BUNDLES, "", null); //$NON-NLS-1$
- if (sourceList != null && !sourceList.isEmpty()) {
- Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
- Iterator<Object> it = sourceList.iterator();
- while(it.hasNext()) {
- sorted.add(it.next().toString());
- }
- for (String text : sorted) {
- if (text.toLowerCase().startsWith(query.getValue().toLowerCase())) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(text);
- proposal.setReplacementString(text);
- proposal.setPosition(text.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
- proposals.add(proposal);
- }
- }
- }
- return proposals.toArray(new TextProposal[0]);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.KbQuery;
-import org.jboss.tools.jst.web.kb.WebKbPlugin;
-
-/**
- * @author Alexey Kazakov
- */
-public class ResourcePathProposalType extends ModelProposalType {
-
- private static final String IMAGE_NAME = "ResourcePathProposal.gif"; //$NON-NLS-1$
- private static Image ICON;
- private static Set<String> GRAPHIC_FILE_EXTENSIONS = new HashSet<String>();
- private static Set<String> PAGE_FILE_EXTENSIONS = new HashSet<String>();
- static {
- String[] images = {"gif", "jpeg", "jpg", "png", "wbmp", "bmp"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
- for (int i = 0; i < images.length; i++) {
- GRAPHIC_FILE_EXTENSIONS.add(images[i]);
- }
- String[] pages = {"jsp", "htm", "html", "xhtml", "xml"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
- for (int i = 0; i < pages.length; i++) {
- PAGE_FILE_EXTENSIONS.add(pages[i]);
- }
- }
- private static String PATH_ADDITION = "pathAddition"; //$NON-NLS-1$
-
- private IContainer webRootResource;
- private Set<String> extensions;
- private List<String> enumeration;
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.ModelProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
- */
- @Override
- protected void init(IPageContext context) {
- super.init(context);
- webRootResource = null;
- if(xModel != null) {
- XModelObject webInf = FileSystemsHelper.getWebInf(xModel);
- XModelObject webRoot = FileSystemsHelper.getWebRoot(xModel);
- if(webInf != null && webRoot != null) {
- webRootResource = (IContainer)EclipseResourceUtil.getResource(webRoot);
- }
- }
- if(extensions==null) {
- initExtensions();
- }
- if(enumeration==null) {
- enumeration = new ArrayList<String>();
- if(params!=null) {
- for (int i = 0; i < params.length; i++) {
- if(PATH_ADDITION.equals(params[i].getName())) {
- enumeration.add(params[i].getValue());
- }
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
- */
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- if(!isReadyToUse()) {
- return EMPTY_PROPOSAL_LIST;
- }
- List<TextProposal> proposals = new ArrayList<TextProposal>();
- ImagePathDescriptor[] images = getImagesFilesPathes(query.getValue());
- for(int i=0; i<images.length; i++) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(images[i].getQueryPath());
- String replacementString = images[i].getQueryPath();
- if(images[i].getResource() instanceof IFolder) {
- replacementString = replacementString + "/"; //$NON-NLS-1$
- proposal.setAutoActivationContentAssistantAfterApplication(true);
- }
- proposal.setReplacementString(replacementString);
- proposal.setPosition(replacementString.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
- proposals.add(proposal);
- }
- for (String path : enumeration) {
- TextProposal proposal = new TextProposal();
- proposal.setLabel(path);
- String replacementString = path;
- proposal.setAutoActivationContentAssistantAfterApplication(false);
- proposal.setReplacementString(replacementString);
- proposal.setPosition(replacementString.length());
- if(ICON==null) {
- ICON = ImageDescriptor.createFromFile(WebKbPlugin.class, IMAGE_NAME).createImage();
- }
- proposal.setImage(ICON);
- proposals.add(proposal);
- }
- return proposals.toArray(new TextProposal[0]);
- }
-
- private static final String EXTENSIONS_PARAM_NAME = "extensions"; //$NON-NLS-1$
- private static final String IMAGE_PARAM_TYPE = "%image%"; //$NON-NLS-1$
- private static final String PAGE_PARAM_TYPE = "%page%"; //$NON-NLS-1$
-
- private void initExtensions() {
- String value = getParamValue(EXTENSIONS_PARAM_NAME);
- if(value != null && !value.equals("*")) { //$NON-NLS-1$
- if(IMAGE_PARAM_TYPE.equals(value)) {
- this.extensions = GRAPHIC_FILE_EXTENSIONS;
- } else if("%page%".equals(value)) { //$NON-NLS-1$
- this.extensions = PAGE_FILE_EXTENSIONS;
- } else {
- StringTokenizer st = new StringTokenizer(value, ",;"); //$NON-NLS-1$
- if(st.countTokens() > 0) {
- extensions = new HashSet<String>();
- while(st.hasMoreTokens()) {
- String t = st.nextToken().trim();
- if(t.length() == 0) {
- continue;
- }
- if(IMAGE_PARAM_TYPE.equals(t)) {
- extensions.addAll(GRAPHIC_FILE_EXTENSIONS);
- } else if(PAGE_PARAM_TYPE.equals(t)) {
- extensions.addAll(PAGE_FILE_EXTENSIONS);
- } else {
- extensions.add(t);
- }
- }
- }
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.taglib.ModelProposalType#isReadyToUse()
- */
- protected boolean isReadyToUse() {
- return webRootResource!=null;
- }
-
- private ImagePathDescriptor[] getImagesFilesPathes(String query) {
- query = query.trim();
- if(query.indexOf('\\')>-1) {
- return new ImagePathDescriptor[0];
- }
- if(query.length()==0) {
- query = "/"; //$NON-NLS-1$
- }
- int lastSeparator = query.lastIndexOf('/');
- String name = null;
- String pathWithoutLastSegment = null;
- if(lastSeparator>-1) {
- pathWithoutLastSegment = query.substring(0, lastSeparator);
- if(lastSeparator+1<query.length()) {
- name = query.substring(lastSeparator+1, query.length());
- } else {
- name = ""; //$NON-NLS-1$
- }
- } else {
- pathWithoutLastSegment = ""; //$NON-NLS-1$
- name = query;
- }
- if(name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
- if(pathWithoutLastSegment.length()>0) {
- pathWithoutLastSegment = pathWithoutLastSegment + "/" + name; //$NON-NLS-1$
- } else {
- if(query.startsWith("/")) { //$NON-NLS-1$
- pathWithoutLastSegment = "/" + name; //$NON-NLS-1$
- } else {
- pathWithoutLastSegment = name;
- }
- }
- name = ""; //$NON-NLS-1$
- }
- if(name==null) {
- name = ""; //$NON-NLS-1$
- }
- IResource resource;
- String startPath = pathWithoutLastSegment;
- if(pathWithoutLastSegment.startsWith("/")) { //$NON-NLS-1$
- if(pathWithoutLastSegment.length()>1) {
- startPath = pathWithoutLastSegment.substring(1);
- } else {
- startPath = ""; //$NON-NLS-1$
- }
- }
- if(query.startsWith("/")) { //$NON-NLS-1$
- resource = webRootResource.findMember(startPath);
- } else {
- resource = context.getResource().getParent().findMember(startPath);
- }
-
- List<IResource> resources = new ArrayList<IResource>();
- try {
- if(resource != null) resource.accept(new ImagesFinder(resources, name, extensions));
- } catch (CoreException e) {
- WebKbPlugin.getDefault().logError(e);
- }
- ImagePathDescriptor[] filesPathes = new ImagePathDescriptor[resources.size()];
- for(int i=0; i<filesPathes.length; i++) {
- String prefix = pathWithoutLastSegment.toString();
- if(!prefix.endsWith("/")) { //$NON-NLS-1$
- prefix = prefix + '/';
- }
- IResource r = (IResource)resources.get(i);
- filesPathes[i] = new ImagePathDescriptor(prefix + r.getName(), r);
- }
- return filesPathes;
- }
-
- private static class ImagePathDescriptor {
- private String queryPath;
- private IResource resource;
-
- public ImagePathDescriptor(String queryPath, IResource resource) {
- this.queryPath = queryPath;
- this.resource = resource;
- }
-
- public String getQueryPath() {
- return queryPath;
- }
-
- public IResource getResource() {
- return resource;
- }
- }
-
- private static class ImagesFinder implements IResourceVisitor {
- private List<IResource> resources;
- private int count = 0;
- private String name;
- Set<String> extensions = null;
-
- /**
- * @param resources
- * @param name
- * @param extensions
- */
- public ImagesFinder(List<IResource> resources, String name, Set<String> extensions) {
- this.resources = resources;
- this.name = name;
- this.extensions = extensions;
- }
-
- boolean acceptExtension(String ext) {
- if(ext != null) {
- ext = ext.toLowerCase();
- }
- return (extensions == null || extensions.contains(ext));
- }
-
- public boolean visit(IResource resource) throws CoreException {
- if(resource instanceof IFile) {
- IFile file = (IFile)resource;
- if(resource.getName().startsWith(name) && acceptExtension(file.getFileExtension())) {
- resources.add(resource);
- }
- } else if(resource instanceof IFolder) {
- if(count==0) {
- count++;
- return true;
- } else if(resource.getName().startsWith(name) && (!resource.getName().equals("WEB-INF")) && (!resource.getName().equals("META-INF"))) { //$NON-NLS-1$ //$NON-NLS-2$
- resources.add(resource);
- }
- }
- return false;
- }
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ValidatorIDProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ValidatorIDProposalType.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ValidatorIDProposalType.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import org.jboss.tools.jst.web.project.list.IWebPromptingProvider;
-
-/**
- *
- * @author Viacheslav Kabanovich
- *
- */
-public class ValidatorIDProposalType extends ConverterIDProposalType {
-
- public ValidatorIDProposalType() {}
-
- @Override
- protected String getListID() {
- return IWebPromptingProvider.JSF_VALIDATOR_IDS;
- }
-}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/composite/CompositeComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/composite/CompositeComponent.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/composite/CompositeComponent.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -10,26 +10,17 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib.composite;
-import java.util.Properties;
-
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
import org.jboss.tools.jst.web.kb.internal.taglib.AbstractComponent;
-import org.w3c.dom.Element;
public class CompositeComponent extends AbstractComponent {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.KbObject#getXMLClass()
+ */
+ @Override
public String getXMLClass() {
return KbXMLStoreConstants.CLS_COMPOSITE_LIBRARY;
}
-
- @Override
- protected void saveAttributesInfo(Element element, Properties context) {
- super.saveAttributesInfo(element, context);
- }
-
- @Override
- protected void loadAttributesInfo(Element element, Properties context) {
- super.loadAttributesInfo(element, context);
- }
-
-}
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -12,9 +12,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.IProposalProcessor;
+import org.jboss.tools.jst.web.kb.KbQuery;
/**
* Represents a tag library.
@@ -65,6 +65,12 @@
IComponent getComponent(String name);
/**
+ * @param type
+ * @return component by type
+ */
+ IComponent getComponentByType(String type);
+
+ /**
* @param query
* @param context
* @return components
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibraryManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibraryManager.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibraryManager.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -30,6 +30,15 @@
if(kbProject == null) {
return new ITagLibrary[0];
}
- return kbProject.getTagLibraries(uri);
+ return uri==null?kbProject.getTagLibraries():kbProject.getTagLibraries(uri);
}
+
+ /**
+ * Returns all tag libraries which are available in the project.
+ * @param project
+ * @return
+ */
+ public static ITagLibrary[] getLibraries(IProject project) {
+ return getLibraries(project, null);
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/JsfCore.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/JsfCore.xml 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/JsfCore.xml 2009-12-16 17:56:27 UTC (rev 19366)
@@ -2,6 +2,12 @@
<!DOCTYPE tag-lib PUBLIC "-//Red Hat, Inc//DTD Knowledge Base 2.0//EN" "http://anonsvn.jboss.org/repos/jbosstools/trunk/jst/plugins/org.jboss.too...">
<tag-lib defaultPrefix="f">
+ <component closeTag="true" name="facet">
+ <attribute name="name">
+ <proposal type="facetName"/>
+ </attribute>
+ </component>
+
<component closeTag="true" name="loadBundle">
<attribute name="basename">
<proposal type="bundleName"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-12-16 17:09:02 UTC (rev 19365)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-12-16 17:56:27 UTC (rev 19366)
@@ -13,8 +13,6 @@
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
@@ -31,16 +29,15 @@
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.PageProcessor;
import org.jboss.tools.jst.web.kb.KbQuery.Type;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType;
+import org.jboss.tools.jst.web.kb.internal.proposal.CustomProposalType.Param;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibAttribute;
-import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType.Param;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.tld.IFilePathEncoder;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.util.ElService;
-import org.jboss.tools.vpe.editor.util.FileUtil;
import org.jboss.tools.vpe.editor.util.Jsf2ResourceUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.w3c.dom.Node;
15 years
JBoss Tools SVN: r19365 - trunk/jbpm/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-12-16 12:09:02 -0500 (Wed, 16 Dec 2009)
New Revision: 19365
Modified:
trunk/jbpm/docs/reference/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-989 - updating the plugin version;
Modified: trunk/jbpm/docs/reference/en/master.xml
===================================================================
--- trunk/jbpm/docs/reference/en/master.xml 2009-12-16 17:08:25 UTC (rev 19364)
+++ trunk/jbpm/docs/reference/en/master.xml 2009-12-16 17:09:02 UTC (rev 19365)
@@ -69,7 +69,7 @@
<year>2009</year>
<holder>JBoss by Red Hat</holder>
</copyright>
- <releaseinfo> Version: 4.0.0.M2</releaseinfo>
+ <releaseinfo> Version: 4.0.0.CR1</releaseinfo>
<abstract>
<title/>
15 years