Author: akazakov
Date: 2009-06-10 16:14:09 -0400 (Wed, 10 Jun 2009)
New Revision: 15871
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomComponentExtension.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomComponentExtension.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomComponentExtension.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomComponentExtension.java 2009-06-10
20:14:09 UTC (rev 15871)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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 CustomComponentExtension extends CustomTagLibComponent {
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#isExtended()
+ */
+ @Override
+ public boolean isExtended() {
+ return true;
+ }
+
+ /**
+ * @param attributes
+ */
+ public void addAttributes(CustomTagLibAttribute[] attributes) {
+ for (int i = 0; i < attributes.length; i++) {
+ addAttribute(attributes[i]);
+ }
+ }
+}
\ 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/taglib/CustomComponentExtension.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/CustomTagLibrary.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2009-06-10
18:48:29 UTC (rev 15870)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibrary.java 2009-06-10
20:14:09 UTC (rev 15871)
@@ -58,7 +58,7 @@
protected String name;
protected String defaultPrefix;
- protected CustomTagLibAttribute[] extendedAttributes;
+ protected CustomComponentExtension componentExtension;
public CustomTagLibrary(File file, String uri, String version, String name) {
setURI(uri);
@@ -85,7 +85,13 @@
CustomTagLibComponent component = parseComponent((Element)child);
addComponent(component);
} else if (child.getNodeName().equals(COMPONET_EXTENSION)) {
- extendedAttributes = getAttributes((Element)child);
+ if(componentExtension==null) {
+ componentExtension = new CustomComponentExtension();
+ // TODO what we should do with this fake components?
+// addComponent(componentExtension);
+ componentExtension.setParentTagLib(this);
+ }
+ componentExtension.addAttributes(getAttributes((Element)child));
}
}
}
@@ -231,7 +237,7 @@
/**
* @return the extendedAttributes
*/
- public CustomTagLibAttribute[] getExtendedAttributes() {
- return extendedAttributes;
+ public CustomComponentExtension getComponentExtension() {
+ return componentExtension;
}
}
\ No newline at end of file