Author: scabanovich
Date: 2011-07-20 19:42:03 -0400 (Wed, 20 Jul 2011)
New Revision: 33089
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/icons/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/icons/ca/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/icons/ca/el.png
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/DefaultKbELProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/KbELProposalComputer.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties 2011-07-20 23:35:43 UTC
(rev 33088)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties 2011-07-20 23:42:03 UTC
(rev 33089)
@@ -4,7 +4,8 @@
.,\
about.html,\
schema/,\
- taglibs/
+ taglibs/,\
+ icons/
source.. = src/,\
resources/
output.. = bin/
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/icons/ca/el.png
===================================================================
(Binary files differ)
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/icons/ca/el.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-07-20 23:35:43 UTC (rev
33088)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2011-07-20 23:42:03 UTC (rev
33089)
@@ -274,4 +274,21 @@
</catalogContribution>
</extension>
+ <extension point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
+ id="kb_el_proposals"
+ name="KB EL Proposals">
+ <proposalCategory icon="$nl$/icons/ca/el.png"/>
+ </extension>
+
+ <extension point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
+ id="CDIJavaELCompletionProposalComputer"
+ name="CDI EL Java Completion Proposal Computer">
+ <javaCompletionProposalComputer
+ class="org.jboss.tools.jst.web.kb.el.KbELProposalComputer"
+ categoryId="org.jboss.tools.jst.web.kb.kb_el_proposals"
+ activate="true">
+ <partition type="__java_string"/>
+ </javaCompletionProposalComputer>
+ </extension>
+
</plugin>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2011-07-20
23:35:43 UTC (rev 33088)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2011-07-20
23:42:03 UTC (rev 33089)
@@ -23,6 +23,8 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
//$NON-NLS-1$
+ public static final String CA_KB_IMAGE_PATH = "icons/ca/el.gif";
//$NON-NLS-1$
+
// The shared instance
private static WebKbPlugin plugin;
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/DefaultKbELProposalProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/DefaultKbELProposalProcessor.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/DefaultKbELProposalProcessor.java 2011-07-20
23:42:03 UTC (rev 33089)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.el;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+
+public class DefaultKbELProposalProcessor extends KbELProposalProcessor {
+ public static final Image KB_PROPOSAL_IMAGE =
+ WebKbPlugin.getDefault().getImage(WebKbPlugin.CA_KB_IMAGE_PATH);
+
+ public DefaultKbELProposalProcessor() {
+ }
+
+ @Override
+ protected boolean isEnabled(IFile file) {
+ IProject project = (file == null ? null : file.getProject());
+ IKbProject kb = KbProjectFactory.getKbProject(project, false, true);
+ return kb != null;
+ }
+
+ @Override
+ protected Image getImage() {
+ return KB_PROPOSAL_IMAGE;
+ }
+
+}
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/DefaultKbELProposalProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/KbELProposalComputer.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/KbELProposalComputer.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/KbELProposalComputer.java 2011-07-20
23:42:03 UTC (rev 33089)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.el;
+
+import org.jboss.tools.common.el.ui.ca.ELProposalProcessor;
+import org.jboss.tools.common.el.ui.ca.JavaELProposalComputer;
+
+public class KbELProposalComputer extends JavaELProposalComputer {
+ DefaultKbELProposalProcessor processor = new DefaultKbELProposalProcessor();
+
+ @Override
+ protected ELProposalProcessor getELProcessor() {
+ return processor;
+ }
+
+}
Property changes on:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/el/KbELProposalComputer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain