JBoss Tools SVN: r2849 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 11:22:22 -0400 (Thu, 02 Aug 2007)
New Revision: 2849
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/FileSystemsRenameListenerContribution.java
Log:
JBIDE-649
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/FileSystemsRenameListenerContribution.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/FileSystemsRenameListenerContribution.java 2007-08-02 13:40:10 UTC (rev 2848)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/FileSystemsRenameListenerContribution.java 2007-08-02 15:22:22 UTC (rev 2849)
@@ -19,23 +19,24 @@
public class FileSystemsRenameListenerContribution implements FileSystemsRenameListener.Contribution {
+ //probably this contribution is no more needed at all
public void pathRenamed(final FileSystemsRenameListener listener, String oldPath, String newPath) {
- final IProject project = (IProject)listener.getFileSystems().getModel().getProperties().get("project");
- if(project == null) return;
- String webroot = getWebRootWTP(listener.getFileSystems().getModel());
+// final IProject project = (IProject)listener.getFileSystems().getModel().getProperties().get("project");
+// if(project == null) return;
+// String webroot = getWebRootWTP(listener.getFileSystems().getModel());
- if(webroot != null && webroot.toLowerCase().equals(oldPath.toLowerCase())) {
- final String webrootname = newPath.substring(newPath.lastIndexOf('/') + 1);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- updateWebContentNamePropertiesOnly(project, webrootname, null);
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
- }
- });
- }
+// if(webroot != null && webroot.toLowerCase().equals(oldPath.toLowerCase())) {
+// final String webrootname = newPath.substring(newPath.lastIndexOf('/') + 1);
+// Display.getDefault().asyncExec(new Runnable() {
+// public void run() {
+// try {
+// updateWebContentNamePropertiesOnly(project, webrootname, null);
+// } catch (Exception e) {
+// WebModelPlugin.getPluginLog().logError(e);
+// }
+// }
+// });
+// }
}
private String getWebRootWTP(XModel model) {
16 years, 9 months
JBoss Tools SVN: r2848 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-08-02 09:40:10 -0400 (Thu, 02 Aug 2007)
New Revision: 2848
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialRootClass.java
Log:
EXIN-413: Incorrect relations between elements of diagram
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-02 11:23:23 UTC (rev 2847)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-02 13:40:10 UTC (rev 2848)
@@ -228,6 +228,8 @@
Property property = (Property)iterator.next();
OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
createConnections(subclassShape, tableShape);
+ subclassShape.firePropertyChange(REFRESH, null, null);
+ tableShape.firePropertyChange(REFRESH, null, null);
}
}
}
@@ -239,9 +241,20 @@
OrmShape componentClassShape = elements.get(identifier.getComponentClassName());
if (componentClassShape == null && persistentClass instanceof RootClass) {
componentClassShape = getOrCreateComponentClass(((RootClass)persistentClass).getIdentifierProperty());
+
+ Shape idPropertyShape = classShape.getChild(persistentClass.getIdentifierProperty());
+ if (idPropertyShape != null) {
+ new Connection(idPropertyShape, componentClassShape);
+ idPropertyShape.firePropertyChange(REFRESH, null, null);
+ componentClassShape.firePropertyChange(REFRESH, null, null);
+ }
+
OrmShape tableShape = getOrCreateDatabaseTable(identifier.getTable());
- if (componentClassShape != null)
+ if (componentClassShape != null) {
createConnections(componentClassShape, tableShape);
+ componentClassShape.firePropertyChange(REFRESH, null, null);
+ tableShape.firePropertyChange(REFRESH, null, null);
+ }
}
}
}
@@ -254,6 +267,8 @@
Property property = (Property)iterator.next();
OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
createConnections(classShape, tableShape);
+ classShape.firePropertyChange(REFRESH, null, null);
+ tableShape.firePropertyChange(REFRESH, null, null);
}
}
}
@@ -501,7 +516,8 @@
}
}
} else if (property.getValue() instanceof Component) {
- classShape = createShape(property);
+ classShape = (OrmShape)elements.get(((Component)property.getValue()).getComponentClassName());
+ if (classShape == null) classShape = createShape(property);
}
}
return classShape;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-08-02 11:23:23 UTC (rev 2847)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-08-02 13:40:10 UTC (rev 2848)
@@ -17,6 +17,7 @@
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.KeyValue;
+import org.hibernate.mapping.List;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SimpleValue;
@@ -70,9 +71,7 @@
typeIsAccessible = false;
}
}
-/* if (field.isComposite()) {
- bodyOrmShape = new ExpandeableShape(field);
- } else */if (field.getValue().isSimpleValue() && !((SimpleValue)field.getValue()).isTypeSpecified()) {
+ if (field.getValue().isSimpleValue() && !((SimpleValue)field.getValue()).isTypeSpecified()) {
bodyOrmShape = new Shape(field);
} else if (typeIsAccessible && field.getValue().getType().isEntityType()) {
bodyOrmShape = new ExpandeableShape(field);
@@ -83,24 +82,8 @@
}
getChildren().add(bodyOrmShape);
} else {
-// Component component = (Component)field.getValue();
-// Iterator iter = component.getPropertyIterator();
-// while (iter.hasNext()) {
-// Property property = (Property)iter.next();
-// boolean typeIsAccesible = true;
-// try {property.getValue().getType();} catch (Exception e) {typeIsAccesible = false;}
-///* if (property.isComposite()) {
-// bodyOrmShape = new ExpandeableShape(property);
-// } else */if (typeIsAccesible && property.getValue().getType().isEntityType()) {
-// bodyOrmShape = new ExpandeableShape(property);
-// } else if (typeIsAccesible && property.getValue().getType().isCollectionType()) {
-// bodyOrmShape = new ComponentShape(property);
-// } else {
-// bodyOrmShape = new Shape(property);
-// }
- bodyOrmShape = new ExpandeableShape(field);
- getChildren().add(bodyOrmShape);
-// }
+ bodyOrmShape = new ExpandeableShape(field);
+ getChildren().add(bodyOrmShape);
}
}
} else if (ormElement instanceof Subclass) {
@@ -135,20 +118,8 @@
}
getChildren().add(bodyOrmShape);
} else {
-// Component component = (Component)field.getValue();
-// Iterator iter = component.getPropertyIterator();
-// while (iter.hasNext()) {
-// Property property = (Property)iter.next();
-// if (property.getValue().getType().isEntityType()) {
-// bodyOrmShape = new ExpandeableShape(property);
-// } else if (property.getValue().getType().isCollectionType()) {
-// bodyOrmShape = new ComponentShape(property);
-// } else {
-// bodyOrmShape = new Shape(property);
-// }
- bodyOrmShape = new ExpandeableShape(field);
- getChildren().add(bodyOrmShape);
-// }
+ bodyOrmShape = new ExpandeableShape(field);
+ getChildren().add(bodyOrmShape);
}
}
Iterator iter = ((Subclass)ormElement).getPropertyIterator();
@@ -190,6 +161,19 @@
return shape;
}
+ public Shape getChild(Property ormElement) {
+ Shape shape = null;
+ Iterator iter = getChildren().iterator();
+ while (iter.hasNext()) {
+ Shape child = (Shape)iter.next();
+ Object childElement = child.getOrmElement();
+ if (childElement instanceof Property && ormElement.getName().equals(((Property)childElement).getName())) {
+ return child;
+ }
+ }
+ return shape;
+ }
+
protected void setHidden(boolean hiden) {
super.setHidden(hiden);
for (int i = 0; i < getChildren().size(); i++)
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialRootClass.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialRootClass.java 2007-08-02 11:23:23 UTC (rev 2847)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/SpecialRootClass.java 2007-08-02 13:40:10 UTC (rev 2848)
@@ -41,18 +41,12 @@
}
if (component != null) {
setClassName(component.getComponentClassName());
+ setEntityName(component.getComponentClassName());
PersistentClass ownerClass = component.getOwner();
if (component.getParentProperty() != null) {
parentProperty = new Property();
parentProperty.setName(component.getParentProperty());
parentProperty.setPersistentClass(ownerClass);
-// Property property = null;
-// try {
-// property = ownerClass.getProperty(component.getParentProperty());
-// } catch (Exception e) {
-// property = ownerClass.getIdentifierProperty();
-// }
-// if (property != null) parentProperty = ownerClass.getIdentifierProperty();
}
Iterator iterator = component.getPropertyIterator();
while (iterator.hasNext()) {
16 years, 9 months
JBoss Tools SVN: r2847 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: filesystems/impl and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:23:23 -0400 (Thu, 02 Aug 2007)
New Revision: 2847
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelClassLoader.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/GifIcon.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
Log:
Obsolete class XModelClassLoader removed
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XModel.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -230,14 +230,6 @@
*/
public void setOut(PrintWriter out);
- /**
- * Returns class loader that includes resurces loaded
- * by the model.
- *
- * @return
- */
- public ClassLoader getModelClassLoader();
-
/**
* Registers in model an object by unique id.
* Manager is any object used to extend model
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarSystemImpl.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -12,7 +12,6 @@
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.*;
-import org.jboss.tools.common.model.impl.*;
public class JarSystemImpl extends JarFolderImpl implements org.jboss.tools.common.model.filesystems.FileSystem {
private static final long serialVersionUID = 7958999759019059243L;
@@ -71,8 +70,6 @@
if(jar.isLoaded()) {
XModelObject[] cs = getChildren();
for (int i = 0; i < cs.length; i++) removeChild_0(cs[i]);
- XModelClassLoader l = (XModelClassLoader)getModel().getModelClassLoader();
- l.invalidate();
jar.invalidate();
}
loaded = false;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/MountFileSystemHandler.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -16,7 +16,6 @@
import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.model.util.*;
-import org.jboss.tools.common.model.impl.XModelClassLoader;
public class MountFileSystemHandler extends DefaultCreateHandler {
@@ -118,8 +117,6 @@
static SpecialWizard w = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.model.project.ClassPathUpdateWizard");
public static void updateClassPath(XModelObject fs) {
- XModelClassLoader cl = (XModelClassLoader)fs.getModel().getModelClassLoader();
- cl.invalidate();
if(fs.getModelEntity().getName().indexOf("ar") >= 0 && w != null) {
Properties p = new Properties();
p.put("model", fs.getModel());
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/GifIcon.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/GifIcon.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/icons/impl/GifIcon.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -31,7 +31,8 @@
String p = XModelObjectLoaderUtil.getResourcePath(obj);
if(p == null) return null;
p = p.substring(1);
- java.net.URL url = obj.getModel().getModelClassLoader().getResource(p);
+ if(true) return null;
+ java.net.URL url = null; //obj.getModel().getModelClassLoader().getResource(p);
ImageIcon icon = new ImageIcon(url);
return (icon.getIconWidth() > 20) ? null : icon;
} catch (Exception e) {
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelClassLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelClassLoader.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelClassLoader.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -1,114 +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.impl;
-
-import org.jboss.tools.common.model.filesystems.FileSystem;
-import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
-
-import java.io.*;
-import java.util.*;
-import java.net.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.*;
-
-public class XModelClassLoader extends URLClassLoader {
- private XModel model = null;
- private HashSet<String> urls = new HashSet<String>(), tempurls = new HashSet<String>();
- private HashSet<String> classes = new HashSet<String>();
- private boolean valid = true;
-
- public XModelClassLoader(XModel model) {
- super(new URL[0], ClassLoaderUtil.getClassLoader());
- this.model = model;
- }
-
- protected Class findClass(final String name) throws ClassNotFoundException {
- Class c = super.findClass(name);
- if(c != null) classes.add(name);
- return c;
- }
-
- public void validate() {
- XModelObject fs = FileSystemsHelper.getFileSystems(model);
- if(fs == null) return;
- XModelObject[] os = fs.getChildren();
- for (int i = 0; i < os.length; i++) {
- String loc = os[i].get("LOCATION");
- if(loc == null || loc.length() == 0) continue;
- loc = XModelObjectUtil.expand(loc, model, null);
- File f = new File(loc);
- try {
- loc = f.getCanonicalPath();
- } catch (Exception e) {
- //ignore
- }
- if(loc == null) continue;
- String l = loc.toLowerCase();
- if(urls.contains(l)) continue;
- urls.add(l);
- try {
- FileSystem fsi = (FileSystem)os[i];
- String tl = XModelObjectUtil.expand(fsi.getTempLocation(), model, null);
- f = new File(tl).getCanonicalFile();
- addURL(f.toURL());
- tempurls.add(f.getAbsolutePath());
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
- tempurls.add(l);
- }
- }
- }
-
- public boolean isUsed() {
- return urls.size() > 0;
- }
-
- public String getClassPath() {
- StringBuffer sb = new StringBuffer();
- String[] s = new String[0];
- ///ClassLoaderUtil.getClassLoader().getClasspath();
- for(int i = 0; i < s.length; i++) sb.append(s[i]).append(File.pathSeparator);
- URL[] us = getURLs();
- for (int i = 0; i < us.length; i++) {
- String p = us[i].getPath();
- if((p.charAt(0)=='/' && p.charAt(2)==':') ||
- (p.charAt(0)=='\\' && p.charAt(2)==':')) {
- p = p.substring(1);
- }
- sb.append(p).append(File.pathSeparator);
- }
- return sb.toString();
- }
-
- public String getSourcePath() {
- Iterator i = tempurls.iterator();
- StringBuffer sb = new StringBuffer();
- while(i.hasNext()) {
- sb.append(i.next()).append(File.pathSeparator);
- }
- return sb.toString();
- }
-
- public boolean isLoaded(String name) {
- return classes.contains(name);
- }
-
- public void invalidate() {
- valid = false;
- }
-
- public boolean isValid() {
- return valid;
- }
-
-}
-
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-08-02 11:22:39 UTC (rev 2846)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/impl/XModelImpl.java 2007-08-02 11:23:23 UTC (rev 2847)
@@ -66,7 +66,6 @@
private FileSystemPeer fileregistry = new FileSystemPeer();
private PrintWriter out = new PrintWriter(System.out, true);
private HashMap<String,XModelObject> extraroots = new HashMap<String,XModelObject>(2);
- private XModelClassLoader classloader = new XModelClassLoader(this);
private String rootEntity = "Root";
public XModelImpl(Properties properties, XModelMetaData metadata) {
@@ -127,14 +126,6 @@
return fileregistry;
}
- public ClassLoader getModelClassLoader() {
- if(!classloader.isValid()) {
- classloader = new XModelClassLoader(this);
- classloader.validate();
- }
- return classloader;
- }
-
public XModelObject getRoot() {
if(root == null) createRoot();
return root;
@@ -376,8 +367,6 @@
treeListenersArray = treeListeners.toArray(new XModelTreeListener[0]);
undoer.setModel(this);
undoer.reset();
- if(classloader.isUsed()) classloader = new XModelClassLoader(this);
- classloader.validate();
fireStructureChanged(getRoot(), 3, null);
///Project Watcher
16 years, 9 months
JBoss Tools SVN: r2846 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:22:39 -0400 (Thu, 02 Aug 2007)
New Revision: 2846
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java
Log:
Reference to obsolete class XModelClassLoader removed
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java 2007-08-02 11:19:47 UTC (rev 2845)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java 2007-08-02 11:22:39 UTC (rev 2846)
@@ -9,7 +9,6 @@
import org.jboss.tools.common.verification.vrules.*;
import org.jboss.tools.common.verification.vrules.layer.VModelFactory;
import org.jboss.tools.common.model.*;
-///import org.jboss.tools.common.model.impl.XModelClassLoader;
import org.jboss.tools.common.meta.action.*;
import java.util.*;
16 years, 9 months
JBoss Tools SVN: r2845 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:19:47 -0400 (Thu, 02 Aug 2007)
New Revision: 2845
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
Log:
Adding null to selection prevented if *.java file cannot be adapted to java element
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2007-08-02 11:18:26 UTC (rev 2844)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2007-08-02 11:19:47 UTC (rev 2845)
@@ -123,10 +123,12 @@
Object object = iterator.next();
if (object instanceof XModelObject) {
XModelObject xmo = (XModelObject)object;
- if ("FileJAVA".equals(xmo.getModelEntity().getName()))
- adaptedObjects.add(xmo.getAdapter(ICompilationUnit.class));
- else
+ if ("FileJAVA".equals(xmo.getModelEntity().getName())) {
+ Object adapter = xmo.getAdapter(ICompilationUnit.class);
+ if(adapter != null) adaptedObjects.add(adapter);
+ } else {
adaptedObjects.add(xmo);
+ }
} else if(object instanceof IAdaptable) {
adaptedObjects.add(object);
}
16 years, 9 months
JBoss Tools SVN: r2844 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/layer.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:18:26 -0400 (Thu, 02 Aug 2007)
New Revision: 2844
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/layer/VModelImpl.java
Log:
Reference to obsolete class XModelClassLoader removed
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/layer/VModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/layer/VModelImpl.java 2007-08-02 11:17:42 UTC (rev 2843)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/layer/VModelImpl.java 2007-08-02 11:18:26 UTC (rev 2844)
@@ -165,10 +165,6 @@
// if(!isMain()) return;
}
- public ClassLoader getClassLoader() {
- return model.getModelClassLoader();
- }
-
public IType getValidType(String className) {
if(project == null) return null;
IType type = EclipseResourceUtil.getValidType(project, className);
16 years, 9 months
JBoss Tools SVN: r2843 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:17:42 -0400 (Thu, 02 Aug 2007)
New Revision: 2843
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java
Log:
Reference to obsolete class XModelClassLoader removed
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java 2007-08-02 11:17:22 UTC (rev 2842)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectHelper.java 2007-08-02 11:17:42 UTC (rev 2843)
@@ -30,7 +30,6 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
-import org.jboss.tools.common.model.impl.XModelClassLoader;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.model.util.XMLUtil;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
@@ -62,10 +61,10 @@
fss.setAttributeValue("application name", p.getProperty("name"));
File webInfDir = ((IResource)webinf.getAdapter(IResource.class)).getLocation().toFile();
- Map modules = getModules(location);
- Iterator it = modules.entrySet().iterator();
+ Map<String,String> modules = getModules(location);
+ Iterator<Map.Entry<String,String>> it = modules.entrySet().iterator();
while (it.hasNext()) {
- Map.Entry entry = (Map.Entry)it.next();
+ Map.Entry<String,String> entry = it.next();
String module = (String)entry.getKey();
String config = (String)entry.getValue();
String fileName = config.substring(config.indexOf('/', 1) + 1);
@@ -106,8 +105,6 @@
model.save();
model.update();
- XModelClassLoader cl = (XModelClassLoader)model.getModelClassLoader();
- cl.validate();
updateOverlapped(model);
registerTLDs(model, p);
Watcher.getInstance(model).forceUpdate();
@@ -153,7 +150,7 @@
if(fs != null) fs.updateOverlapped();
}
- public static Map getModules(String location) {
+ public static Map<String,String> getModules(String location) {
Map<String,String> modules = new HashMap<String,String>();
File webXML = new File(location, "web.xml");
if(!webXML.isFile()) return modules;
@@ -206,7 +203,7 @@
static {
try {
- Class c = WebAppConfig.class;
+ Class<?> c = WebAppConfig.class;
XMLEntityResolver.registerPublicEntity("-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN", FileLocator.resolve(c.getResource("/meta/web-app_2_2.dtd")).toString());
XMLEntityResolver.registerPublicEntity("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", FileLocator.resolve(c.getResource("/meta/web-app_2_3.dtd")).toString());
} catch (Exception e) {
16 years, 9 months
JBoss Tools SVN: r2842 - in trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts: webprj/model/helpers/adopt and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:17:22 -0400 (Thu, 02 Aug 2007)
New Revision: 2842
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/icons/StrutsCustomizedIcon.java
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java
Log:
Reference to obsolete class XModelClassLoader removed
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/icons/StrutsCustomizedIcon.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/icons/StrutsCustomizedIcon.java 2007-08-02 11:01:30 UTC (rev 2841)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/icons/StrutsCustomizedIcon.java 2007-08-02 11:17:22 UTC (rev 2842)
@@ -33,7 +33,7 @@
if(p == null) throw new Exception("");
java.net.URL url = null;
try {
- url = obj.getModel().getModelClassLoader().getResource(p.substring(1));
+// url = obj.getModel().getModelClassLoader().getResource(p.substring(1));
} catch (Exception e) {
StrutsModelPlugin.getPluginLog().logError(e);
}
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java 2007-08-02 11:01:30 UTC (rev 2841)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/webprj/model/helpers/adopt/AdoptProjectFinisher.java 2007-08-02 11:17:22 UTC (rev 2842)
@@ -17,7 +17,6 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.impl.XModelClassLoader;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.web.context.IImportWebProjectContext;
import org.jboss.tools.jst.web.project.WebModuleConstants;
@@ -63,8 +62,6 @@
appendModules();
SortFileSystems.sort(model);
model.save();
- XModelClassLoader cl = (XModelClassLoader)model.getModelClassLoader();
- cl.validate();
NewWebProjectHelper.updateOverlapped(model);
}
16 years, 9 months
JBoss Tools SVN: r2841 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 07:01:30 -0400 (Thu, 02 Aug 2007)
New Revision: 2841
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java
Log:
Reference to obsolete class XModelClassLoader removed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java 2007-08-02 10:56:54 UTC (rev 2840)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/helpers/context/AdoptJSFProjectFinisher.java 2007-08-02 11:01:30 UTC (rev 2841)
@@ -19,7 +19,6 @@
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.impl.XModelClassLoader;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.jst.web.context.IImportWebProjectContext;
import org.jboss.tools.jst.web.project.WebModuleConstants;
@@ -59,8 +58,6 @@
fss.setModified(true);
appendModules();
model.save();
- XModelClassLoader cl = (XModelClassLoader)model.getModelClassLoader();
- cl.validate();
}
private XModelObject getOrCreateFileSystem(String name, String location, boolean req) {
16 years, 9 months
JBoss Tools SVN: r2840 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-08-02 06:56:54 -0400 (Thu, 02 Aug 2007)
New Revision: 2840
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java
Log:
Obsolete comment removed
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java 2007-08-02 10:54:34 UTC (rev 2839)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/handler/VerifyRulesAllHandler.java 2007-08-02 10:56:54 UTC (rev 2840)
@@ -64,7 +64,6 @@
private void executeHandlerGUI(XModelObject object, Properties p) throws Exception {
SpecialWizard wizard = SpecialWizardFactory.createSpecialWizard("org.jboss.tools.common.verification.ui.vrules.wizard.runtime2.VerifyWizard");
-/// ((XModelClassLoader)object.getModel().getModelClassLoader()).invalidate();
if(p == null) p = new Properties();
String title = "Apply Verification Rules";
if(!object.getModelEntity().getName().equals("FileSystems"))
16 years, 9 months