[jbosstools-commits] JBoss Tools SVN: r17652 - in trunk/common/plugins/org.jboss.tools.common.model: schema and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Sep 18 06:08:25 EDT 2009


Author: scabanovich
Date: 2009-09-18 06:08:24 -0400 (Fri, 18 Sep 2009)
New Revision: 17652

Removed:
   trunk/common/plugins/org.jboss.tools.common.model/schema/jspAdopt.exsd
   trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java
Modified:
   trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
   trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4913
Extension point jspAdopt moved to jst.web.

Modified: trunk/common/plugins/org.jboss.tools.common.model/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/plugin.xml	2009-09-18 10:06:58 UTC (rev 17651)
+++ trunk/common/plugins/org.jboss.tools.common.model/plugin.xml	2009-09-18 10:08:24 UTC (rev 17652)
@@ -6,7 +6,6 @@
    <extension-point id="modelObjectAdapter" name="modelObjectAdapter" schema="schema/modelObjectAdapter.exsd"/>
    <extension-point id="meta" name="meta" schema="schema/meta.exsd"/>
    <extension-point id="keys" name="keys" schema="schema/keys.exsd"/>
-   <extension-point id="jspAdopt" name="jspAdopt" schema="schema/jspAdopt.exsd"/>
    <extension-point id="paletteAdopt" name="paletteAdopt" schema="schema/paletteAdopt.exsd"/>
    <extension-point id="resourceMapping" name="resourceMapping" schema="schema/resourceMapping.exsd"/>
    <extension-point id="classes" name="Model Classes" schema="schema/classes.exsd"/>
@@ -130,8 +129,6 @@
 			class="org.jboss.tools.common.model.engines.impl.EnginesLoader"/>
 		<xclass id="org.jboss.tools.common.model.engines.impl.StopProcessHandler"
 			class="org.jboss.tools.common.model.engines.impl.StopProcessHandler"/>
-		<xclass id="org.jboss.tools.common.model.files.handlers.JSPAdopt"
-			class="org.jboss.tools.common.model.files.handlers.JSPAdopt"/>
 		<xclass id="org.jboss.tools.common.model.files.handlers.InvokingWizardHandler"
 			class="org.jboss.tools.common.model.files.handlers.InvokingWizardHandler"/>
 		<xclass id="org.jboss.tools.common.model.filesystems.impl.CreateFileHandler"

Deleted: trunk/common/plugins/org.jboss.tools.common.model/schema/jspAdopt.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/schema/jspAdopt.exsd	2009-09-18 10:06:58 UTC (rev 17651)
+++ trunk/common/plugins/org.jboss.tools.common.model/schema/jspAdopt.exsd	2009-09-18 10:08:24 UTC (rev 17652)
@@ -1,108 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.jboss.tools.common.model">
-<annotation>
-      <appInfo>
-         <meta.schema plugin="org.jboss.tools.common.model" id="jspAdopt" name="jspAdopt"/>
-      </appInfo>
-      <documentation>
-         Registers class implementating interface 
-         org.jboss.tools.common.meta.XAdoptManager 
-         in class org.jboss.tools.common.model.files.handlers.JSPAdopt, 
-         which checks if a dragged model object can be dropped 
-         to *.jsp file and then executes the drop, delegating 
-         the check and execution to registered  implementations.
-      </documentation>
-   </annotation>
-
-   <element name="extension">
-      <complexType>
-         <sequence>
-            <element ref="jspAdopt" minOccurs="0" maxOccurs="unbounded"/>
-         </sequence>
-         <attribute name="point" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="id" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-         <attribute name="name" type="string">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="jspAdopt">
-      <complexType>
-         <attribute name="class" type="string" use="required">
-            <annotation>
-               <documentation>
-                  Qualified name of class implementing interface
-                  org.jboss.tools.common.meta.XAdoptManager
-               </documentation>
-               <appInfo>
-                  <meta.attribute kind="java"/>
-               </appInfo>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="since"/>
-      </appInfo>
-      <documentation>
-         2.0.0
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="examples"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="apiInfo"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="implementation"/>
-      </appInfo>
-      <documentation>
-         
-      </documentation>
-   </annotation>
-
-   <annotation>
-      <appInfo>
-         <meta.section type="copyright"/>
-      </appInfo>
-      <documentation>
-         Red Hat, Inc
-      </documentation>
-   </annotation>
-
-</schema>

Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java	2009-09-18 10:06:58 UTC (rev 17651)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/CreateFileSupport.java	2009-09-18 10:08:24 UTC (rev 17652)
@@ -25,6 +25,7 @@
 import org.jboss.tools.common.meta.impl.XMetaDataConstants;
 import org.jboss.tools.common.model.*;
 import org.jboss.tools.common.model.filesystems.impl.*;
+import org.jboss.tools.common.model.loaders.impl.MappedEntityRecognizer;
 import org.jboss.tools.common.model.plugin.ModelMessages;
 import org.jboss.tools.common.model.util.*;
 import org.jboss.tools.common.util.FileUtil;
@@ -267,12 +268,19 @@
 			String entity = version == null ? null : (String)versionEntities.get(version);
 			if(entity != null) return entity;
 		}
-		return ("jsp".equals(extension)) ? "FileJSP" : //$NON-NLS-1$ //$NON-NLS-2$
-			("htm".equals(extension)) ? "FileHTML" : //$NON-NLS-1$ //$NON-NLS-2$
-			("html".equals(extension)) ? "FileHTML" : //$NON-NLS-1$ //$NON-NLS-2$
-			("properties".equals(extension)) ? "FilePROPERTIES" : //$NON-NLS-1$ //$NON-NLS-2$
-			(extension.equals(action.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION))) ? action.getProperty(XMetaDataConstants.ENTITY) :
-			"FileAny"; //$NON-NLS-1$
+		
+		String entity = null;
+		if(extension.equals(action.getProperty(XModelObjectConstants.ATTR_NAME_EXTENSION))) {
+			entity = action.getProperty(XMetaDataConstants.ENTITY);
+		}
+		if(entity == null) {
+			entity = new MappedEntityRecognizer().getEntityName(extension, null);
+		}
+		if(entity != null && getTarget().getModel().getMetaData().getEntity(entity) != null) {
+			return entity;
+		}
+		
+		return "FileAny"; //$NON-NLS-1$
 	}
 
 	protected XModelObject modifyCreatedObject(XModelObject o) {

Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java	2009-09-18 10:06:58 UTC (rev 17651)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/files/handlers/JSPAdopt.java	2009-09-18 10:08:24 UTC (rev 17652)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.model.files.handlers;
-
-import org.jboss.tools.common.meta.*;
-import org.jboss.tools.common.meta.action.impl.*;
-
-public class JSPAdopt extends CompoundAdoptManager {
-	/*
-	 * see extension point org.jboss.tools.common.model.jspAdopt
-    private static String[] MANAGERS = {"org.jboss.tools.jst.web.tld.model.handlers.JSPAdopt",
-                                        "org.jboss.tools.struts.tiles.model.handlers.JSPAdopt",
-                                        "org.jboss.tools.struts.model.handlers.JSPAdopt",
-                                        "org.jboss.tools.jsf.model.handlers.JSPAdopt",
-                                        "org.jboss.tools.jsf.ui.adopt.JSPAdopt",
-                                        "org.jboss.tools.jst.web.model.handlers.JSPAdopt",
-                                        };
-    */
-    private static XAdoptManager[] managers = null;
-
-    public XAdoptManager[] getManagers() {
-        if(managers == null) managers = loadManagers("org.jboss.tools.common.model.jspAdopt"); //$NON-NLS-1$
-        return managers;
-    }
-
-}
-



More information about the jbosstools-commits mailing list