Author: scabanovich
Date: 2009-11-11 09:06:35 -0500 (Wed, 11 Nov 2009)
New Revision: 18616
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/ActionClassValueFilter.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2023
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF 2009-11-11 14:02:28 UTC
(rev 18615)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/META-INF/MANIFEST.MF 2009-11-11 14:06:35 UTC
(rev 18616)
@@ -7,6 +7,7 @@
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.esb.ui,
org.jboss.tools.esb.ui.editor.form,
+ org.jboss.tools.esb.ui.editor.attribute,
org.jboss.tools.esb.ui.wizard.newfile
Bundle-SymbolicName: org.jboss.tools.esb.ui; singleton:=true
Bundle-Localization: plugin
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2009-11-11 14:02:28 UTC (rev
18615)
+++ trunk/esb/plugins/org.jboss.tools.esb.ui/plugin.xml 2009-11-11 14:06:35 UTC (rev
18616)
@@ -35,6 +35,8 @@
<extension point="org.jboss.tools.common.model.classes">
<xclass id="org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
class="org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"/>
+ <xclass
id="org.jboss.tools.esb.ui.editor.attribute.ActionClassValueFilter"
+ class="org.jboss.tools.esb.ui.editor.attribute.ActionClassValueFilter"/>
</extension>
<extension point="org.jboss.tools.common.model.ui.attributeAdapter">
Added:
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/ActionClassValueFilter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/ActionClassValueFilter.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/ActionClassValueFilter.java 2009-11-11
14:06:35 UTC (rev 18616)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.ui.editor.attribute;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.attribute.IValueFilter;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class ActionClassValueFilter implements IValueFilter {
+ IProject project;
+
+ static String AbstractActionLifecycle =
"org.jboss.soa.esb.actions.AbstractActionLifecycle";
+ static String AbstractActionPipelineProcessor =
"org.jboss.soa.esb.actions.AbstractActionPipelineProcessor";
+
+ public boolean accept(String value) {
+ if(value.startsWith("java.")
+ || value.startsWith("javax.")
+ || value.startsWith("com.sun.")
+ || value.startsWith("sun.")
+ || value.startsWith("org.apache.")
+ ) {
+ return false;
+ }
+ boolean b = value.startsWith("org.jboss.soa.esb.actions.")
+ || EclipseJavaUtil.isDerivedClass(value, AbstractActionLifecycle, project)
+ || EclipseJavaUtil.isDerivedClass(value, AbstractActionPipelineProcessor, project);
+
+
+ return b;
+ }
+
+ public boolean init(XModelObject context, XAttribute attribute) {
+ project = EclipseResourceUtil.getProject(context);
+ try {
+ return (EclipseJavaUtil.findType(EclipseResourceUtil.getJavaProject(project),
AbstractActionLifecycle) != null);
+ } catch (JavaModelException e) {
+ return false;
+ }
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/ActionClassValueFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain