JBoss Tools SVN: r2212 - trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 23:47:35 -0400 (Thu, 28 Jun 2007)
New Revision: 2212
Modified:
trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
Log:
Moved a class to a more likely location
Modified: trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java
===================================================================
--- trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-06-29 03:47:31 UTC (rev 2211)
+++ trunk/ejb3/plugins/org.jboss.ide.eclipse.ejb3.wizards.ui/src/main/org/jboss/ide/eclipse/ejb3/ui/wizards/Ejb30ProjectFirstPage.java 2007-06-29 03:47:35 UTC (rev 2212)
@@ -26,8 +26,8 @@
import org.eclipse.wst.project.facet.ProductManager;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.web.internal.ResourceHandler;
+import org.jboss.ide.eclipse.as.core.runtime.EJB30SupportVerifier;
import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.util.EJB30SupportVerifier;
public class Ejb30ProjectFirstPage extends J2EEComponentFacetCreationWizardPage {
public static final String EJB30_FACET_ID = "jbide.ejb30";
17 years, 6 months
JBoss Tools SVN: r2211 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 23:47:31 -0400 (Thu, 28 Jun 2007)
New Revision: 2211
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/EJB30SupportVerifier.java
Log:
Moved a class to a more likely location
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java (from rev 2202, trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/EJB30SupportVerifier.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/EJB30SupportVerifier.java 2007-06-29 03:47:31 UTC (rev 2211)
@@ -0,0 +1,30 @@
+package org.jboss.ide.eclipse.as.core.runtime;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.wst.server.core.IRuntime;
+import org.jboss.ide.eclipse.as.core.runtime.internal.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
+import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
+
+public class EJB30SupportVerifier {
+ public static boolean verify(IRuntime rt) {
+ AbstractJBossServerRuntime ajbsr = (AbstractJBossServerRuntime)rt.loadAdapter(AbstractJBossServerRuntime.class, null);
+ // i refuse to verify. if they say they support, believe them
+ if( ajbsr == null ) return true;
+
+ // one of ours. verify
+ IPath path = new Path("junk").append(rt.getId()).append("jbide.ejb30").append("1.0");
+ WebtoolsProjectJBossClasspathContainer container =
+ new WebtoolsProjectJBossClasspathContainer(path);
+ IClasspathEntry[] entries = container.getClasspathEntries();
+ if( entries.length == 0 ) return false;
+ IPath p;
+ for( int i = 0; i < entries.length; i++ ) {
+ p = entries[i].getPath();
+ if( !p.toFile().exists())
+ return false;
+ }
+ return true;
+ }
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/EJB30SupportVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/EJB30SupportVerifier.java 2007-06-29 03:39:56 UTC (rev 2210)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/EJB30SupportVerifier.java 2007-06-29 03:47:31 UTC (rev 2211)
@@ -1,30 +0,0 @@
-package org.jboss.ide.eclipse.as.core.util;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.wst.server.core.IRuntime;
-import org.jboss.ide.eclipse.as.core.runtime.internal.WebtoolsProjectJBossClasspathContainerInitializer.WebtoolsProjectJBossClasspathContainer;
-import org.jboss.ide.eclipse.as.core.runtime.server.AbstractJBossServerRuntime;
-
-public class EJB30SupportVerifier {
- public static boolean verify(IRuntime rt) {
- AbstractJBossServerRuntime ajbsr = (AbstractJBossServerRuntime)rt.loadAdapter(AbstractJBossServerRuntime.class, null);
- // i refuse to verify. if they say they support, believe them
- if( ajbsr == null ) return true;
-
- // one of ours. verify
- IPath path = new Path("junk").append(rt.getId()).append("jbide.ejb30").append("1.0");
- WebtoolsProjectJBossClasspathContainer container =
- new WebtoolsProjectJBossClasspathContainer(path);
- IClasspathEntry[] entries = container.getClasspathEntries();
- if( entries.length == 0 ) return false;
- IPath p;
- for( int i = 0; i < entries.length; i++ ) {
- p = entries[i].getPath();
- if( !p.toFile().exists())
- return false;
- }
- return true;
- }
-}
17 years, 6 months
JBoss Tools SVN: r2210 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: launch and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 23:39:56 -0400 (Thu, 28 Jun 2007)
New Revision: 2210
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java
Log:
Removed server process model and all references to it.
Now only a reference to the running server process is kept.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java 2007-06-29 03:39:52 UTC (rev 2209)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java 2007-06-29 03:39:56 UTC (rev 2210)
@@ -7,7 +7,6 @@
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -29,9 +28,6 @@
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel.ServerProcessModelEntity;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher;
import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher.ProcessData;
@@ -42,7 +38,6 @@
private static final int EXECUTE_ID = 2042;
private Text query, results;
private Label queryLabel;
- private ServerProcessModelEntity entity = null;
private IServer server = null;
private Composite parentComposite;
private Hyperlink twiddleTutorialLink;
@@ -53,7 +48,6 @@
setShellStyle(getShellStyle() | SWT.RESIZE);
if( selection instanceof IServer ) {
server = (IServer)selection;
- entity = ServerProcessModel.getDefault().getModel(server.getId());
}
}
@@ -86,7 +80,6 @@
final String args = query.getText();
final Display dis = getShell().getDisplay();
final IServer jbs = server;
- final ServerProcessModelEntity spme = entity;
getButton(EXECUTE_ID).setEnabled(false);
Thread t = new Thread() {
public void run() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java 2007-06-29 03:39:52 UTC (rev 2209)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBossLaunchConfigurationTabGroup.java 2007-06-29 03:39:56 UTC (rev 2210)
@@ -8,7 +8,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
@@ -49,9 +48,6 @@
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
-import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.JBossServerBehavior;
import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
public class JBossLaunchConfigurationTabGroup extends
17 years, 6 months
JBoss Tools SVN: r2209 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: runtime/server/polling and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 23:39:52 -0400 (Thu, 28 Jun 2007)
New Revision: 2209
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/ServerProcessModel.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TimeoutPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/TwiddleLauncher.java
Log:
Removed server process model and all references to it.
Now only a reference to the running server process is kept.
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/ServerProcessModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/ServerProcessModel.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/model/ServerProcessModel.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -1,201 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.debug.core.DebugException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public class ServerProcessModel implements IServerLifecycleListener {
-
- private static ServerProcessModel instance;
-
- /**
- * There is a singleton instance of the ServerProcessModel.
- * @return
- */
- public static ServerProcessModel getDefault() {
- if( instance == null ) {
- instance = new ServerProcessModel();
- }
- return instance;
- }
-
- /**
- * Static method to check if all of some process array are terminated.
- * @param processes
- * @return
- */
- public static boolean allProcessesTerminated(IProcess[] processes) {
- for( int i = 0; i < processes.length; i++ ) {
- if( !(processes[i].isTerminated())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Will map server ID's to a server process entity.
- * Each server has it's own entity instance.
- */
- private HashMap map;
-
- public ServerProcessModel() {
- map = new HashMap();
- initialize();
- }
-
- private void initialize() {
- ServerCore.addServerLifecycleListener(this);
- JBossServer[] servers = ServerConverter.getAllJBossServers();
- for( int i = 0; i < servers.length; i++ ) {
- getModel(servers[i].getServer().getId(), true);
- }
- }
-
-
- /**
- * Each JBoss Server instance has it's own sub-model
- * @param key
- * @return
- */
- public ServerProcessModelEntity getModel(String key) {
- return getModel(key, false);
- }
-
-
- private ServerProcessModelEntity getModel(String key, boolean create) {
- Object o = map.get(key);
- if( o == null ) {
- if( !create ) return null;
- o = new ServerProcessModelEntity(key);
- map.put(key, (ServerProcessModelEntity)o);
- }
- return ((ServerProcessModelEntity)o);
- }
-
- public ServerProcessModelEntity[] getModels() {
- ArrayList list = new ArrayList();
- Iterator i = map.keySet().iterator();
- while(i.hasNext()) {
- list.add(map.get(i.next()));
- }
- ServerProcessModelEntity[] models = new ServerProcessModelEntity[list.size()];
- list.toArray(models);
- return models;
- }
-
- /**
- * Completely shut down all JBoss Servers, as well as all
- * start, stop, and twiddle launches associated with them.
- */
- public void terminateAllProcesses() {
- Iterator i = map.values().iterator();
- ServerProcessModelEntity entity;
- while(i.hasNext()) {
- entity = (ServerProcessModelEntity)i.next();
- entity.clearAll();
- }
- }
-
- public class ServerProcessModelEntity {
-
- private String serverId;
- private HashMap processMap; // <String type, ArrayList processes>
- public ServerProcessModelEntity(String key) {
- this.serverId = key;
- processMap = new HashMap(3);
- processMap.put(JBossServerLaunchConfiguration.START, new ArrayList());
- processMap.put(JBossServerLaunchConfiguration.STOP, new ArrayList());
- processMap.put(JBossServerLaunchConfiguration.TWIDDLE, new ArrayList());
- }
- public String getServerId() {
- return serverId;
- }
-
- public void add( IProcess[] processes, String processType, ILaunchConfiguration config ) {
- ArrayList pds = (ArrayList)processMap.get(processType);
- for( int i = 0; i < processes.length; i++ ) {
- pds.add(processes[i]);
- }
- }
-
- public void terminateProcesses(String type) {
- IProcess[] proc = getProcesses(type);
- for( int i = 0; i < proc.length; i++ ) {
- try {
- proc[i].terminate();
- } catch( Exception e ) {
- }
- }
- }
- public IProcess[] getProcesses(String type) {
- ArrayList list = (ArrayList)processMap.get(type);
- if( list != null )
- return (IProcess[]) list.toArray(new IProcess[list.size()]);
- return new IProcess[0];
- }
-
- public void clearAll() {
- ArrayList list;
- IProcess proc;
- for( Iterator i = processMap.values().iterator(); i.hasNext();) {
- list = (ArrayList)i.next();
- for( Iterator j = list.iterator(); j.hasNext();) {
- try {
- proc = (IProcess)j.next();
- proc.terminate();
- } catch( DebugException de ) {}
- j.remove();
- }
- }
- }
- }
-
-
-
- public void serverAdded(IServer server) {
- if( ServerConverter.getJBossServer(server) != null ) {
- getModel(server.getId(), true);
- }
- }
-
- public void serverChanged(IServer server) {
- }
-
- public void serverRemoved(IServer server) {
- if( ServerConverter.getJBossServer(server) != null ) {
- map.remove(server.getId());
- }
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TimeoutPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TimeoutPoller.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TimeoutPoller.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -24,21 +24,17 @@
import java.util.Date;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
import org.jboss.ide.eclipse.as.core.runtime.server.IServerStatePoller;
-// Wait 10 seconds, then say it's at it's expected state
+// Wait 15 seconds, then say it's at it's expected state
public class TimeoutPoller implements IServerStatePoller {
- private PollThread pollThread;
private boolean expectedState;
private long endTime;
- private IServer server;
int timeout = -1;
public void beginPolling(IServer server, boolean expectedState, PollThread pt) {
- this.server = server;
this.expectedState = expectedState;
this.endTime = new Date().getTime() + getTimeout();
}
@@ -60,10 +56,5 @@
}
public void cleanup() {
- if( !expectedState ) {
- ServerProcessModel.getDefault().getModel(server.getId()).clearAll();
- }
}
-
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -36,11 +36,8 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel.ServerProcessModelEntity;
import org.jboss.ide.eclipse.as.core.runtime.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
@@ -159,13 +156,6 @@
}
public void cleanup() {
- ServerProcessModelEntity ent = ServerProcessModel.getDefault().getModel(server.getId());
- if( expectedState == SERVER_UP) {
- ent.terminateProcesses(JBossServerLaunchConfiguration.TWIDDLE);
- } else {
- ent.terminateProcesses(JBossServerLaunchConfiguration.TWIDDLE);
- ent.terminateProcesses(JBossServerLaunchConfiguration.STOP);
- }
}
public class PollingSecurityException extends PollingException {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -33,7 +33,6 @@
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.model.EventLogModel;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
import org.jboss.ide.eclipse.as.core.model.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.runtime.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.runtime.server.polling.PollThread;
@@ -41,33 +40,22 @@
import org.jboss.ide.eclipse.as.core.server.stripped.DeployableServerBehavior;
public class JBossServerBehavior extends DeployableServerBehavior {
- public static final String LAUNCH_CONFIG_DEFAULT_CLASSPATH = "__JBOSS_SERVER_BEHAVIOR_LAUNCH_CONFIG_DEFAULT_CLASSPATH__";
-
-
private PollThread pollThread = null;
-
+ protected transient IProcess process;
public JBossServerBehavior() {
super();
}
public void stop(boolean force) {
- if( force ) {
+ int state = getServer().getServerState();
+ if( force || process.isTerminated() || state == IServer.STATE_STOPPED) {
forceStop();
return;
}
- // If the server's already terminated via processes, just abort
- IProcess[] startProcesses =
- ServerProcessModel.getDefault().getModel(getServer().getId()).getProcesses(JBossServerLaunchConfiguration.START);
- if( ServerProcessModel.allProcessesTerminated(startProcesses)) {
- forceStop();
- return;
- }
-
// if we're starting up or shutting down and they've tried again,
// then force it to stop.
- int state = getServer().getServerState();
- if( state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING || state == IServer.STATE_STOPPED) {
+ if( state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING ) {
pollThread.cancel();
forceStop();
return;
@@ -91,9 +79,10 @@
forceStop(true);
}
protected void forceStop(boolean addEvent) {
- // just terminate the processes. All of them
+ // just terminate the process.
try {
- ServerProcessModel.getDefault().getModel(getServer().getId()).clearAll();
+ if( process != null )
+ process.terminate();
process = null;
setServerStopped();
if( addEvent ) {
@@ -117,7 +106,6 @@
}
- protected transient IProcess process;
protected transient IDebugEventSetListener processListener;
public void setProcess(final IProcess newProcess) {
if (process != null)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerLaunchConfiguration.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerLaunchConfiguration.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -48,8 +48,6 @@
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.internal.ServerType;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel.ServerProcessModelEntity;
public class JBossServerLaunchConfiguration extends AbstractJavaLaunchConfigurationDelegate {
@@ -221,19 +219,15 @@
IProcess[] processes = new IProcess[0];
JBossServerBehavior jbossServerBehavior = getServerBehavior(configuration);
String serverID = jbossServerBehavior.getServer().getId();
- ServerProcessModelEntity processModel = ServerProcessModel.getDefault().getModel(serverID);
if( action.equals(START)) {
processes = launchConfiguration(configuration, launch, monitor, mode);
- processModel.add(processes, action, configuration);
jbossServerBehavior.setProcess(processes[0]);
jbossServerBehavior.serverStarting();
} else if( action.equals(STOP)) {
processes = launchConfiguration(configuration, launch, monitor, mode);
- processModel.add(processes, action, configuration);
jbossServerBehavior.serverStopping();
} else if( action.equals(TWIDDLE)) {
processes = launchConfiguration(configuration, launch, monitor, mode);
- processModel.add(processes, action, configuration);
}
} catch( Exception e ) {
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, IStatus.ERROR, "Error launching twiddle", e));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/TwiddleLauncher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/TwiddleLauncher.java 2007-06-29 03:16:02 UTC (rev 2208)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/TwiddleLauncher.java 2007-06-29 03:39:52 UTC (rev 2209)
@@ -34,7 +34,6 @@
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.model.ServerProcessModel.ServerProcessModelEntity;
public class TwiddleLauncher {
17 years, 6 months
JBoss Tools SVN: r2208 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 23:16:02 -0400 (Thu, 28 Jun 2007)
New Revision: 2208
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
Log:
jar locations were hard-coded.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-29 00:19:55 UTC (rev 2207)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-29 03:16:02 UTC (rev 2208)
@@ -21,25 +21,19 @@
*/
package org.jboss.ide.eclipse.as.core.runtime.server.polling;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Date;
import java.util.Properties;
-import javax.management.AttributeNotFoundException;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import javax.management.ReflectionException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.model.EventLogModel;
import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
@@ -48,7 +42,6 @@
import org.jboss.ide.eclipse.as.core.runtime.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher;
-import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
public class TwiddlePoller implements IServerStatePoller {
@@ -128,8 +121,10 @@
}
protected ClassLoader getClassLoader() {
try {
- URL url = new URL("file:///C:/apps/jboss/4.2.ga.src/build/output/jboss-4.2.0.GA/client/jbossall-client.jar");
- URL url2 = new URL("file:///C:/apps/jboss/4.2.ga.src/build/output/jboss-4.2.0.GA/bin/twiddle.jar");
+ IRuntime rt = server.getRuntime();
+ IPath loc = rt.getLocation();
+ URL url = loc.append("client").append("jbossall-client.jar").toFile().toURI().toURL();
+ URL url2 = loc.append("bin").append("twiddle.jar").toFile().toURI().toURL();
URLClassLoader loader = new URLClassLoader(new URL[] {url, url2}, Thread.currentThread().getContextClassLoader());
return loader;
} catch( MalformedURLException murle) {
17 years, 6 months
JBoss Tools SVN: r2207 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-06-28 20:19:55 -0400 (Thu, 28 Jun 2007)
New Revision: 2207
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/getopt.jar
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
Log:
More efficient polling mechanism added.
No longer launches twiddle as its own process.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2007-06-28 17:15:47 UTC (rev 2206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/.classpath 2007-06-29 00:19:55 UTC (rev 2207)
@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="jbosscore"/>
+ <classpathentry exported="true" kind="lib" path="getopt.jar"/>
<classpathentry exported="true" kind="lib" path="dom4j-1.6.1.jar"/>
<classpathentry exported="true" kind="lib" path="jaxen-1.1-beta-6.jar"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="C:/Training/jboss-4.x/lib/getopt.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-06-28 17:15:47 UTC (rev 2206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2007-06-29 00:19:55 UTC (rev 2207)
@@ -36,4 +36,5 @@
org.jboss.ide.eclipse.as.core.util
Bundle-ClassPath: dom4j-1.6.1.jar,
jaxen-1.1-beta-6.jar,
- jbossascore.jar
+ jbossascore.jar,
+ getopt.jar
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties 2007-06-28 17:15:47 UTC (rev 2206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/build.properties 2007-06-29 00:19:55 UTC (rev 2207)
@@ -6,5 +6,6 @@
jaxen-1.1-beta-6.jar,\
dom4j-1.6.1.jar,\
plugin.properties,\
- schema/
+ schema/,\
+ getopt.jar
source.jbossascore.jar = jbosscore/
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/getopt.jar
===================================================================
(Binary files differ)
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.core/getopt.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-28 17:15:47 UTC (rev 2206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/runtime/server/polling/TwiddlePoller.java 2007-06-29 00:19:55 UTC (rev 2207)
@@ -21,9 +21,25 @@
*/
package org.jboss.ide.eclipse.as.core.runtime.server.polling;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
import java.util.Date;
+import java.util.Properties;
-import org.eclipse.debug.core.model.IProcess;
+import javax.management.AttributeNotFoundException;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.model.EventLogModel;
import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
@@ -32,7 +48,7 @@
import org.jboss.ide.eclipse.as.core.runtime.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher;
-import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher.ProcessData;
+import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
public class TwiddlePoller implements IServerStatePoller {
@@ -66,44 +82,61 @@
private class PollerRunnable implements Runnable {
private TwiddleLauncher launcher;
public void run() {
- String args = "get \"jboss.system:type=Server\" Started";
- while( !canceled && !done ) {
- // are start processes still going?
- ServerProcessModelEntity ent = ServerProcessModel.getDefault().getModel(server.getId());
- IProcess[] processes = ent.getProcesses(JBossServerLaunchConfiguration.START);
- if( ServerProcessModel.allProcessesTerminated(processes)) {
- done = true;
- started = 0;
- eventAllProcessesTerminated();
- } else {
- launcher = new TwiddleLauncher();
- ProcessData[] datas = launcher.getTwiddleResults(server, args, true);
- if( datas.length == 1 ) {
- ProcessData d = datas[0];
- String out = d.getOut();
- if( out.startsWith("Started=true")) {
- started = STATE_STARTED;
- } else if(out.startsWith("Started=false")) {
- started = STATE_TRANSITION; // it's alive and responding
- } else if( out.indexOf("java.lang.SecurityException") != -1 ) {
- // throw exception
- securityException = true;
- } else {
- started = STATE_STOPPED; // It's fully down
- }
-
- if( started == 1 && expectedState == SERVER_UP ) {
+ ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader twiddleLoader = getClassLoader();
+ if( twiddleLoader != null ) {
+ Thread.currentThread().setContextClassLoader(twiddleLoader);
+ System.out.println("here we go");
+
+ Properties props = new Properties();
+ props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
+ props.put("java.naming.provider.url","jnp://localhost:1099");
+ props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
+
+ while( !done && !canceled ) {
+ InitialContext ic;
+ try {
+ ic = new InitialContext(props);
+ Object obj = ic.lookup("jmx/invoker/RMIAdaptor");
+ ic.close();
+ System.out.println(obj);
+ if( obj instanceof MBeanServerConnection ) {
+ MBeanServerConnection connection = (MBeanServerConnection)obj;
+ Object attInfo = connection.getAttribute(new ObjectName("jboss.system:type=Server"), "Started");
+ boolean b = ((Boolean)attInfo).booleanValue();
+ started = b ? STATE_STARTED : STATE_TRANSITION;
+ if( b && expectedState )
+ done = true;
+ }
+ } catch (NamingException e) {
+ // should give up now
+ } catch( SecurityException se ) {
+ securityException = true;
+ } catch( Exception e ) {
+ System.out.println("exception: " + e.getMessage());
+ e.printStackTrace();
+ started = STATE_STOPPED;
+ if( !expectedState )
done = true;
- } else if( started == 0 && expectedState == SERVER_DOWN) {
- done = true;
- }
}
- }
- if( !canceled )
- eventTwiddleExecuted();
+
+ } // end while
}
+
+ Thread.currentThread().setContextClassLoader(currentLoader);
+
}
-
+ protected ClassLoader getClassLoader() {
+ try {
+ URL url = new URL("file:///C:/apps/jboss/4.2.ga.src/build/output/jboss-4.2.0.GA/client/jbossall-client.jar");
+ URL url2 = new URL("file:///C:/apps/jboss/4.2.ga.src/build/output/jboss-4.2.0.GA/bin/twiddle.jar");
+ URLClassLoader loader = new URLClassLoader(new URL[] {url, url2}, Thread.currentThread().getContextClassLoader());
+ return loader;
+ } catch( MalformedURLException murle) {
+ murle.printStackTrace();
+ }
+ return null;
+ }
public void setCanceled() {
if( launcher != null ) {
launcher.setCanceled();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-06-28 17:15:47 UTC (rev 2206)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServerBehavior.java 2007-06-29 00:19:55 UTC (rev 2207)
@@ -45,6 +45,7 @@
private PollThread pollThread = null;
+
public JBossServerBehavior() {
super();
}
@@ -87,14 +88,18 @@
}
protected void forceStop() {
+ forceStop(true);
+ }
+ protected void forceStop(boolean addEvent) {
// just terminate the processes. All of them
try {
ServerProcessModel.getDefault().getModel(getServer().getId()).clearAll();
process = null;
setServerStopped();
- EventLogTreeItem tpe = new ForceShutdownEvent();
- EventLogModel.markChanged(tpe.getEventRoot());
-
+ if( addEvent ) {
+ EventLogTreeItem tpe = new ForceShutdownEvent();
+ EventLogModel.markChanged(tpe.getEventRoot());
+ }
} catch( Throwable t ) {
t.printStackTrace();
}
@@ -131,7 +136,7 @@
for (int i = 0; i < size; i++) {
if (process != null && process.equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) {
DebugPlugin.getDefault().removeDebugEventListener(this);
- forceStop();
+ forceStop(false);
}
}
}
17 years, 6 months
JBoss Tools SVN: r2206 - in trunk/tests/tests/org.jboss.tools.test: src/org/jboss/tools/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-06-28 13:15:47 -0400 (Thu, 28 Jun 2007)
New Revision: 2206
Modified:
trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
Log:
http://jira.jboss.org/jira/browse/EXIN-13
rsolvePlugin method is chaanged to fix test errors
Modified: trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF 2007-06-28 14:01:54 UTC (rev 2205)
+++ trunk/tests/tests/org.jboss.tools.test/META-INF/MANIFEST.MF 2007-06-28 17:15:47 UTC (rev 2206)
@@ -8,8 +8,7 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
- org.junit,
- org.jboss.tools.common
+ org.junit
Provide-Package: org.jboss.ide.tests.util
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.tests
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2007-06-28 14:01:54 UTC (rev 2205)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2007-06-28 17:15:47 UTC (rev 2206)
@@ -26,9 +26,14 @@
private boolean isPluginResolved (String pluginId)
{
Bundle bundle = Platform.getBundle(pluginId);
-
- assertNotNull(pluginId + " failed to load.", bundle);
-
+ assertNotNull(pluginId + " failed to load.");
+ try {
+ // In 3.3 when test case is running plug-in.getState always returns STARTING state
+ // to move plug-in in ACTIVE state even one class should be loaded from plug-in
+ bundle.loadClass("fake class");
+ } catch (Exception e) {
+ // It happen always because loaded class is not exists
+ }
return ((bundle.getState() & Bundle.RESOLVED) > 0) ||
((bundle.getState() & Bundle.ACTIVE) > 0);
}
@@ -36,23 +41,23 @@
private void assertPluginsResolved (String[] pluginIds)
{
for (int i = 0; i < pluginIds.length; i++) {
- assertTrue (isPluginResolved(pluginIds[i]));
+ assertTrue ("plugin '" + pluginIds[i] + "' is not resolved",isPluginResolved(pluginIds[i]));
}
}
public void testCommonPluginsResolved ()
{
assertPluginsResolved(new String[] {
- rhdsNS+"common",
- rhdsNS+"common.gef",
- rhdsNS+"common.kb",
- rhdsNS+"common.model",
- rhdsNS+"common.model.ui",
- rhdsNS+"common.projecttemplates",
- rhdsNS+"common.text.ext",
- rhdsNS+"common.text.xml",
- rhdsNS+"common.verification",
- rhdsNS+"common.verification.ui",
+ rhdsNS+"common",
+ rhdsNS+"common.gef",
+ rhdsNS+"common.kb",
+ rhdsNS+"common.model",
+ rhdsNS+"common.model.ui",
+ rhdsNS+"common.projecttemplates",
+ rhdsNS+"common.text.ext",
+ rhdsNS+"common.text.xml",
+ rhdsNS+"common.verification",
+ rhdsNS+"common.verification.ui",
});
}
17 years, 6 months
JBoss Tools SVN: r2205 - in trunk: common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml and 29 other directories.
by jbosstools-commits@lists.jboss.org
Author: ayukhovich
Date: 2007-06-28 10:01:54 -0400 (Thu, 28 Jun 2007)
New Revision: 2205
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/RunTargetHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/RedHatStructuredTextViewerConfigurationXML.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/CodeRendererService.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/OrmCore.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/exception/ExceptionHandler.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/BaseMappingVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ContextFileWriter.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ExtensionBinder.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmBuilder.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModel.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModelTest.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmProject.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/PersistentClass.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/UpdateMappingVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/codegenerator/DAOGenerator.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/data/Table.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/DefaultPersistentClassFiller.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfiguration.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationReader.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationWriter.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileStorage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileWriter.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ConfigurationReader.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMapping.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/MappingsFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ArrayMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/BagMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/CollectionMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/IdBagMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ListMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/PrimitiveArrayMappingDescriptorsHolderWithTable.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/OrmFileDeleteChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageDeleteChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageRenameChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassDeleteChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassMoveChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassRenameChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldDeleteChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldMoveChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldRenameChange.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/.classpath
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ActionOrmTree.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ContentProviderVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OpenDiagramActionDelegate.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmContentProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ViewsAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/.classpath
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/AutoMappingSetting.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/ColumnPropertyDialog.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RenameTableObjectDialog.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RunTimeSetting.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/refactoring/RefactoringSupport.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/AddOrmNatureAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/ViewPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/actions/ViewAction.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/decorator/LightWeightDecoratorVisitor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/wizard/generateDDL/HibernateDDLGenerator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
Log:
delete using many loggers and delete using printStacktrace
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -16,6 +16,8 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import org.jboss.tools.common.CommonPlugin;
+
public final class FileUtil {
public FileUtil() {}
@@ -107,7 +109,7 @@
}
is.close();
} catch (Exception e) {
- e.printStackTrace();
+ CommonPlugin.getPluginLog().logError(e);
}
return sb.toString();
}
@@ -169,7 +171,7 @@
copyStream(is, os);
return true;
} catch (Exception e) {
- e.printStackTrace();
+ CommonPlugin.getPluginLog().logError(e);
return false;
} finally {
try {
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SAXValidator.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -10,19 +10,24 @@
******************************************************************************/
package org.jboss.tools.common.xml;
-import java.util.*;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.xerces.util.XMLCatalogResolver;
-import org.apache.xerces.xni.*;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
+import org.jboss.tools.common.CommonPlugin;
+import org.jboss.tools.common.util.FileUtil;
import org.osgi.framework.Bundle;
-import org.xml.sax.*;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
-import org.jboss.tools.common.CommonPlugin;
-import org.jboss.tools.common.util.FileUtil;
/**
* @author eskimo(dgolovin(a)exadel.com)
@@ -66,9 +71,7 @@
try {
parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
} catch (Exception e1) {
- Status errorStatus = new Status(
- Status.ERROR, CommonPlugin.PLUGIN_ID, 0, e1.getMessage()+"", e1);
- CommonPlugin.getInstance().getLog().log(errorStatus);
+ CommonPlugin.getPluginLog().logError( e1.getMessage()+"", e1);
}
parserInstance.setContentHandler(handler);
@@ -87,10 +90,7 @@
parser.setFeature(name, value);
} catch (SAXException e) {
// TODO - Move to NLS bundle
- Status warningStatus = new Status(
- Status.ERROR, CommonPlugin.PLUGIN_ID, 0,
- "warning: Parser does not support feature ("+name+")", e);
- CommonPlugin.getInstance().getLog().log(warningStatus);
+ CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e);
}
}
@@ -104,10 +104,7 @@
try {
parser.setProperty(name, value);
} catch (SAXException e) {
- Status warningStatus = new Status(
- Status.ERROR, CommonPlugin.PLUGIN_ID, 0,
- "warning: Parser does not support feature ("+name+")", e);
- CommonPlugin.getInstance().getLog().log(warningStatus);
+ CommonPlugin.getPluginLog().logError("warning: Parser does not support feature ("+name+")", e);
}
}
@@ -168,7 +165,7 @@
if(!urlString.endsWith("/")) urlString += "/";
urlString += "schemas";
} catch (Exception e) {
- e.printStackTrace();
+ CommonPlugin.getPluginLog().logError(e);
}
File f1 = new File(url.getFile() + "/schemas/catalog.xml");
File f2 = new File(location + "schemas/catalog.xml");
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/SafeDocumentBuilderFactory.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -15,7 +15,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.CommonPlugin;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -50,7 +50,7 @@
}
d.setErrorHandler(new ErrorHandlerImpl());
} catch (Exception e) {
- e.printStackTrace();
+ CommonPlugin.getPluginLog().logError(e);
} finally {
Thread.currentThread().setContextClassLoader(loader);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/RunTargetHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/RunTargetHandler.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/ant/model/handlers/RunTargetHandler.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -100,6 +100,5 @@
js.getModel().getOut().println(n);
}
}
-
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcess.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -13,6 +13,8 @@
import java.io.*;
import java.util.*;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+
public abstract class XProcess {
protected Process process = null;
ProcessOut err = null;
@@ -41,9 +43,7 @@
err = new ProcessOut(process, true, w);
out = new ProcessOut(process, false, w);
} catch (Exception e) {
- StringWriter sw = new StringWriter();
- e.printStackTrace(new PrintWriter(sw));
- write(sw.toString());
+ ModelPlugin.getPluginLog().logError(e);
}
new HookMonitor();
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/RedHatStructuredTextViewerConfigurationXML.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/RedHatStructuredTextViewerConfigurationXML.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/RedHatStructuredTextViewerConfigurationXML.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -99,7 +99,7 @@
m.setAccessible(true);
return (IContentAssistProcessor[])m.invoke(initial, new Object[]{sourceViewer, partitionType});
} catch (Exception e) {
- e.printStackTrace();
+ XmlEditorPlugin.getPluginLog().logError(e);
}
return null;
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -20,16 +20,13 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jdt.internal.ui.JavaPlugin;
-//import org.eclipse.jdt.ui.PreferenceConstants; tau
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
-
-import org.jboss.tools.common.text.xml.ui.xpl.XmlPreferenceConstants;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.jst.jsp.preferences.xpl.PreferenceConstants;
import org.jboss.tools.jst.jsp.preferences.xpl.XMLOccurrencePreferenceConstants;
import org.jboss.tools.jst.jsp.preferences.xpl.XMLOccurrencesPreferencePage;
@@ -38,7 +35,7 @@
/**
* The main plugin class to be used in the desktop.
*/
-public class XmlEditorPlugin extends AbstractUIPlugin {
+public class XmlEditorPlugin extends BaseUIPlugin {
//The shared instance.
private static XmlEditorPlugin plugin;
//Resource bundle.
@@ -93,38 +90,6 @@
return resourceBundle;
}
- static public void log(String msg) {
- //XStudioPlugin.getDefault().getLog().log(new Status(Status.INFO, XStudioPlugin.PLUGIN_ID, Status.OK, msg, null));
- //System.out.println(msg);
-/*
- ILog log = TomcatLauncherPlugin.getDefault().getLog();
- Status status = new Status(IStatus.ERROR, TomcatLauncherPlugin.getDefault().getDescriptor().getUniqueIdentifier(), IStatus.ERROR, msg + "\n", null);
- log.log(status);
-*/
- }
-
- public static void log(IStatus status) {
- XmlEditorPlugin.getDefault().getLog().log(status);
- }
- public static void log(String message, Throwable exception) {
- XmlEditorPlugin.getDefault().getLog().log(new Status(Status.ERROR, XmlEditorPlugin.PLUGIN_ID, Status.OK, message, exception));
- }
- static public void log(Exception ex)
- {
- XmlEditorPlugin.getDefault().getLog().log(new Status(Status.ERROR, XmlEditorPlugin.PLUGIN_ID, Status.OK, "No message", ex));
- //ex.printStackTrace();
-/*
- ILog log = TomcatLauncherPlugin.getDefault().getLog();
- StringWriter stringWriter = new StringWriter();
- ex.printStackTrace(new PrintWriter(stringWriter));
- String msg = stringWriter.getBuffer().toString();
-
- Status status = new Status(IStatus.ERROR, TomcatLauncherPlugin.getDefault().getDescriptor().getUniqueIdentifier(), IStatus.ERROR, msg, null);
- log.log(status);
-*/
- }
-
-
protected void initializeDefaultPluginPreferences() {
super.initializeDefaultPluginPreferences();
@@ -193,5 +158,10 @@
}
-
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -67,7 +67,7 @@
fEditorId);
}
} catch (Exception x) {
- XmlEditorPlugin.log(x);
+ XmlEditorPlugin.getPluginLog().logError(x);
}
update();
}
@@ -180,7 +180,7 @@
try {
base = FileLocator.resolve(XmlEditorPlugin.getDefault().getBundle().getEntry("/"));
} catch (Exception e) {
- XmlEditorPlugin.log(e);
+ XmlEditorPlugin.getPluginLog().logError(e);
return null;
}
StringBuffer buffer = new StringBuffer(prefix);
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -230,7 +230,7 @@
try {
message= document.get(position.offset, position.length);
} catch (BadLocationException ex) {
- XmlEditorPlugin.log(ex);
+ XmlEditorPlugin.getPluginLog().logError(ex);
// Skip this match
continue;
}
@@ -833,7 +833,7 @@
}
} catch (Exception x) {
- XmlEditorPlugin.log("", x);
+ XmlEditorPlugin.getPluginLog().logError("", x);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/CodeRendererService.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/CodeRendererService.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/CodeRendererService.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -38,7 +38,6 @@
import org.eclipse.jface.text.Document;
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.TextEdit;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.util.ClassUtils;
import org.jboss.tools.hibernate.internal.core.util.ScanProject;
import org.jboss.tools.hibernate.internal.core.util.StringUtils;
@@ -113,7 +112,7 @@
className);
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
}
}
}
@@ -560,10 +559,11 @@
if (te != null)
te.apply(doc,TextEdit.UPDATE_REGIONS);
} catch (MalformedTreeException e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
} catch (BadLocationException e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
}
+
String newSource = doc.get();
// update of the compilation unit
unit.getBuffer().setContents(newSource);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/OrmCore.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/OrmCore.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/OrmCore.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -20,13 +20,10 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ILock;
-import org.jboss.tools.common.reporting.ProblemReportingHelper;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.common.log.BasePlugin;
+import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.hibernate.internal.core.OrmModel;
import org.jboss.tools.hibernate.internal.core.OrmProject;
import org.osgi.framework.BundleContext;
@@ -36,7 +33,7 @@
* The main plugin class. The class provides connection with Eclipse resources
* such as workspace and projects.
*/
-public class OrmCore extends Plugin {
+public class OrmCore extends BasePlugin {
/**
* The plug-in identifier of the Orm core support
* (value <code>"org.jboss.tools.hibernate.core"</code>).
@@ -70,23 +67,15 @@
super();
plugin=this;
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("Start OrmCore()");
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("Start OrmCore()");
+ }
try {
resourceBundle = ResourceBundle.getBundle(PLUGIN_ID + ".OrmCoreResources");
} catch (MissingResourceException x) {
resourceBundle = null;
}
- // TODO EXP del
- //ormModel = new OrmModel();
-
- // TODO EXP del
- //initProjects();
-
- // add tau 03.05.2005
-
- // del tau 23.03.2006
- //updateListener();
}
// TODO EXP
@@ -115,9 +104,6 @@
public IOrmModel getOrmModel(){
- // TODO EXP del
- //return ormModel;
-
if (ormModel == null) {
ormModel = new OrmModel();
}
@@ -127,7 +113,9 @@
public synchronized void remove(final IProject project){
getOrmModel().removeOrmProject(project);
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("remove for " + project.getName() + "ormModel.size()= " + getOrmModel().size());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("remove for " + project.getName() + "ormModel.size()= " + getOrmModel().size());
+ }
// TODO (tau->tau) ? removeListener
// del 28.04.2005
@@ -143,13 +131,17 @@
public synchronized IOrmProject create(final IProject project) throws CoreException {
//XXX: Instantiate OrmProject only if there is no model for such project!
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("TRY CREATE OrmProject: " + project.getName());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("TRY CREATE OrmProject: " + project.getName());
+ }
IOrmProject ormProject = getOrmModel().getOrmProject(project);
if(ormProject == null){
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("Create new OrmProject: " + project.getName());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("Create new OrmProject: " + project.getName());
+ }
ormProject = new OrmProject(project);
@@ -175,8 +167,11 @@
if (workspace == null) return;
if(listener!=null) {
workspace.removeResourceChangeListener(listener);
- // add tau 21.11.2005
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.removeListener() " + listener);
+
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.removeListener() " + listener);
+ }
+
listener = null;
}
}
@@ -194,7 +189,9 @@
//ResourcesPlugin.getWorkspace().addResourceChangeListener(listener,IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE);
//ResourcesPlugin.getWorkspace().addResourceChangeListener(listener);
// edit 27.06.2005
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.updateListener() " + listener);
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.updateListener() " + listener);
+ }
ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_BUILD);
}
@@ -209,10 +206,14 @@
// TODO (tau->tau) ????
// add 25.01.2006
if (isLockResourceChangeListener()){
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.resourceChanged - return by "+ isLockResourceChangeListener());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.resourceChanged - return by "+ isLockResourceChangeListener());
+ }
return;
} else {
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.resourceChanged - DONE!!! "+ isLockResourceChangeListener());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.resourceChanged - DONE!!! "+ isLockResourceChangeListener());
+ }
}
@@ -225,7 +226,9 @@
if (event.getType() == IResourceChangeEvent.PRE_CLOSE || event.getType() == IResourceChangeEvent.PRE_DELETE ){
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.resourceChanged(PRE_CLOSE or PRE_DELETE):" + event.getResource());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.resourceChanged(PRE_CLOSE or PRE_DELETE):" + event.getResource());
+ }
getOrmModel().removeOrmProject((IProject)event.getResource());
@@ -236,7 +239,9 @@
} else if (event.getType() == IResourceChangeEvent.PRE_BUILD ){
IResourceDelta delta = event.getDelta();
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("ORMCORE.resourceChanged(PRE_BUILD):" + delta.getResource());
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("ORMCORE.resourceChanged(PRE_BUILD):" + delta.getResource());
+ }
/* del tau 21.11.2005
IResourceDelta[] affectedChildren = delta.getAffectedChildren(IResourceDelta.ADDED |IResourceDelta.CHANGED);
@@ -312,69 +317,6 @@
return resourceBundle;
}
- /**
- * Add a log entry
- * * @deprecated
- *
- * use ExceptionHandler.log(Throwable e, String message);
- */
- public static IStatus log(Throwable e, String message) {
- IStatus status= new Status(
- IStatus.ERROR,
- OrmCore.PLUGIN_ID,
- IStatus.ERROR,
- message,
- e);
- log(status); // edit tau 15.09.2005
- // added by Nick 10.08.2005
- //ProblemReportingHelper.reportProblem(status); del tau 15.09.2005 duplicate
- // by Nick
- return status; // add tau 31.03.2005
- }
-
- // add tau 05.04.2005
- public static void log(Throwable e, int severity) {
- IStatus status = null;
- if (severity == IStatus.ERROR || severity == IStatus.WARNING || severity == IStatus.INFO) {
- status = new Status(severity, OrmCore.PLUGIN_ID, severity, getResourceString("OrmCore.internal_error"), e);
- } else {
- status = new Status(IStatus.ERROR, OrmCore.PLUGIN_ID, IStatus.ERROR, getResourceString("OrmCore.internal_error"), e);
- }
- log(status);
- }
-
- /**
- * Add a log entry
- * * @deprecated
- *
- * use ExceptionHandler.log(String message); *
- */
- public static IStatus log(String message) {
- IStatus status= new Status(
- IStatus.INFO,
- OrmCore.PLUGIN_ID,
- IStatus.INFO,
- message,
- null);
- log(status); // edit tau 15.09.2005
- return status; // add tau 31.03.2005
- }
-
- // add tau 05.04.2005
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
-
- // added by Nick 10.08.2005
- if (status != null)
- {
- if (status.getSeverity() == IStatus.ERROR && status.getException() != null)
- {
- ProblemReportingHelper.reportProblem(status);
- }
- }
- // by Nick
- }
-
// add Tau 27.04.2005 for trace
static {
@@ -395,8 +337,17 @@
}
public synchronized void setLockResourceChangeListener(boolean flagLockResourceChangeListener) {
- if (TRACE || TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmCore.setLockResourceChangeListener("+isLockResourceChangeListener()+")");
+ if (TRACE || TRACE_INT_CORE ) {
+ getPluginLog().logInfo("OrmCore.setLockResourceChangeListener("+isLockResourceChangeListener()+")");
+ }
this.flagLockResourceChangeListener = flagLockResourceChangeListener;
}
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/exception/ExceptionHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/exception/ExceptionHandler.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/core/exception/ExceptionHandler.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -45,7 +45,7 @@
IStatus.ERROR,
message,
e);
- OrmCore.log(status);
+ OrmCore.getPluginLog().logError(message,e);
return status;
}
@@ -62,7 +62,6 @@
IStatus.WARNING,
message,
e);
- OrmCore.log(status);
return status;
}
@@ -74,7 +73,6 @@
IStatus.INFO,
newMessage,
null);
- OrmCore.log(status);
return status; // add tau 31.03.2005
}
@@ -86,7 +84,6 @@
IStatus.INFO,
newMessage + " || " + object,
null);
- OrmCore.log(status);
return status;
}
@@ -139,7 +136,6 @@
protected void performCoreException(CoreException e, Shell shell, String title, String message) {
setLastException(e);
- OrmCore.log(e, e.getStatus().getSeverity());
IStatus status = e.getStatus();
if (status != null) {
ErrorDialog.openError(shell, title, message, status);
@@ -159,7 +155,6 @@
performException((Exception) target, shell, title, message, severity);
} else {
setLastException(e);
- OrmCore.log(e, severity);
if (e.getMessage() != null && e.getMessage().length() > 0) {
displayMessageDialog(e, shell, title, message);
} else {
@@ -171,7 +166,6 @@
protected void performException(Exception e, Shell shell, String title, String message, int severity) {
setLastException(e);
- OrmCore.log(e, severity);
displayMessageDialog(e, shell, title, message);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractConfigurationResource.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -23,7 +23,6 @@
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.hibernate.core.IConfigurationResource;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.properties.PropertySourceBase;
public abstract class AbstractConfigurationResource extends PropertySourceBase implements
@@ -49,9 +48,7 @@
resource.refreshLocal(IResource.DEPTH_ZERO, null);
result = resource.getLocalTimeStamp();
} catch (CoreException e) {
- ExceptionHandler.logObjectPlugin(
- "Exception refreshing resource timestamp...", OrmCore
- .getDefault().getBundle().getSymbolicName(), e);
+ OrmCore.getPluginLog().logError("Exception refreshing resource timestamp...", e);
}
}
return result;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractMapping.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/AbstractMapping.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -47,7 +47,6 @@
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.core.hibernate.ICollectionMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateKeyMapping;
@@ -163,10 +162,16 @@
if (mapping != null)
{
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("SAVE() start -> mapping = " + mapping.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("SAVE() start -> mapping = " + mapping.getName());
+ }
+
mapping.getConfiguration().save();
mapping.getProperties().save();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("SAVE() end -> mapping = " + mapping.getName());
+
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("SAVE() end -> mapping = " + mapping.getName());
+ }
} catch (IOException e) {
throw new NestableRuntimeException(e);
}
@@ -248,9 +253,9 @@
try {
reload(true);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
}
}
return (IDatabaseSchema[])schemas.values().toArray(SCHEMAS);
@@ -265,9 +270,9 @@
try {
reload(true);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
}
}
return (IPackage[])packages.values().toArray(PACKAGES);
@@ -312,7 +317,7 @@
+ fullyQualifiedName;
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
// by Nick
@@ -438,9 +443,7 @@
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,
- "Exception adding persistent classes");
- // OrmCore.log(e,"Exception adding persistent classes");
+ OrmCore.getPluginLog().logError("Exception adding persistent classes",e);
}
monitor.worked();
}
@@ -530,8 +533,7 @@
}
monitor.worked();
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e, e.getMessage()
- .toString());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
@@ -543,26 +545,20 @@
res.fillTableFromDBase(this, md, saveNativeSQLTypes);
// added by Nick 06.06.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler
- .logObjectPlugin(
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo(
String.valueOf(i + 1)
+ " tables processed. Last processed table was: "
- + res.getName(), OrmCore
- .getDefault().getBundle()
- .getSymbolicName(), this);
+ + res.getName());
+ }
monitor.worked();
// by Nick
} catch (Exception e) {
- // changed by Nick 01.06.2005
- ExceptionHandler.logThrowableError(e, e.getMessage());
- // ExceptionHandler.log(e, e.getMessage().toString());
- // by Nick
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
} catch (SQLException e1) {
- ExceptionHandler.logThrowableError(e1,
- "Exception retreiving metadata");
+ OrmCore.getPluginLog().logError("Exception retreiving metadata",e1);
}
OrmProgressMonitor.getMonitor().setTaskName("Creating mappings");
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/BaseMappingVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/BaseMappingVisitor.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/BaseMappingVisitor.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -28,7 +28,7 @@
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.hibernate.IAnyMapping;
import org.jboss.tools.hibernate.core.hibernate.IArrayMapping;
import org.jboss.tools.hibernate.core.hibernate.IBagMapping;
@@ -192,14 +192,11 @@
if(class1 == null) continue;
if (class1.getPersistentClassMapping() != null)
{
- try
- {
+ try {
class1.getPersistentClassMapping().accept(this,pakage);
+ } catch (Exception ex) {
+ OrmCore.getPluginLog().logError(ex.getMessage(),ex);
}
- catch (Exception ex)
- {
- ExceptionHandler.logThrowableError(ex,ex.getMessage());
- }
}
}
// by Nick
@@ -214,7 +211,7 @@
if(maps[i] != null)
maps[i].accept(this, mapping);
} catch(Exception ex){
- ExceptionHandler.logThrowableError(ex,null);
+ OrmCore.getPluginLog().logError(ex);
}
}
return null;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ContextFileWriter.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ContextFileWriter.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ContextFileWriter.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -28,7 +28,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.hibernate.core.IPersistentClass;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.hibernate.HibernateConfiguration;
import org.jboss.tools.hibernate.internal.core.util.ScanProject;
@@ -59,9 +59,9 @@
try {
doc = readDocument(res.getContents(true));
} catch (DocumentException e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
}
if(doc == null)
doc = createDocument();
@@ -72,11 +72,11 @@
else
res.create(writeDocument(doc), IResource.NONE, null);
} catch (UnsupportedEncodingException e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
}
}
@@ -146,7 +146,7 @@
try {
attributes.add(ScanProject.getRelativePath(classes[i].getPersistentClassMappingStorage().getResource()));
} catch (CoreException e) {
- ExceptionHandler.logThrowableWarning(e, null);
+ OrmCore.getPluginLog().logError(e);
}
}
addPropertyWithList(element, "mappingResources", attributes);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ExtensionBinder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ExtensionBinder.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/ExtensionBinder.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -20,9 +20,7 @@
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.hibernate.core.ICodeRendererService;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Nick - mailto:n.belaevski@exadel.com
* created: 26.09.2005
@@ -54,7 +52,7 @@
list.add(element);
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
}
@@ -144,7 +142,7 @@
return (ICodeRendererService) obj;
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmBuilder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmBuilder.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmBuilder.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -27,7 +27,6 @@
import org.jboss.tools.hibernate.core.IValidationService;
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.hibernate.validation.HibernateValidationProblem;
@@ -48,7 +47,9 @@
*/
protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("??? Build(...) -> Project = " + this.getProject().getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("??? Build(...) -> Project = " + this.getProject().getName());
+ }
if (!getProject().hasNature(OrmCore.ORM2NATURE_ID)) return null;
@@ -61,8 +62,10 @@
IMarker marker = javaModelMarkers[i];
int severity = marker.getAttribute(IMarker.SEVERITY,IMarker.SEVERITY_INFO);
if (severity == IMarker.SEVERITY_ERROR) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("initBuild(...) -> Project = " + this.getProject().getName() +
- " have JAVA_MODEL_PROBLEM_MARKER, severity=ERROR" );
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("initBuild(...) -> Project = " + this.getProject().getName() +
+ " have JAVA_MODEL_PROBLEM_MARKER, severity=ERROR" );
+ }
return null;
}
}
@@ -70,7 +73,9 @@
// add tau 22.09.2005
IOrmProject ormProject = OrmCore.getDefault().create(getProject());
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("!!! Build(...) -> Project = " + this.getProject().getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("!!! Build(...) -> Project = " + this.getProject().getName());
+ }
// edit tau 21.03.2006
IResourceDelta delta = getDelta(getProject());
@@ -85,7 +90,7 @@
ormProject.fireProjectChanged(this, false);
}
} catch (Exception e){
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
} finally {
OrmCore.getDefault().updateListener();
OrmCore.getDefault().setLockResourceChangeListener(false);
@@ -144,7 +149,9 @@
return;
// 27.05.2005 tau move this metod from HibernateValidationService.run()
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("deleteValidationMarkers on "+ormProject.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("deleteValidationMarkers on "+ormProject.getName());
+ }
HibernateValidationProblem.deleteMarkers(ormProject.getProject());
//ormProject.refresh();
@@ -153,7 +160,9 @@
IProject[] refProjects = ormProject.getReferencedProjects();
for (int i = 0; i < refProjects.length; i++) {
IProject project = refProjects[i];
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("deleteValidationMarkers of refProjects on "+project.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("deleteValidationMarkers of refProjects on "+project.getName());
+ }
HibernateValidationProblem.deleteMarkers(project);
}
// by Nick
@@ -195,7 +204,9 @@
monitor.subTask("->Invoking Hibernate Validation Builder on " + ormProject.getName());
monitor.worked(1);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("!!! incrementalBuild on "+delta+","+delta.getResource().getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("!!! incrementalBuild on "+delta+","+delta.getResource().getName());
+ }
delta.accept(new DeltaVisitor(ormProject, monitor));
@@ -216,8 +227,9 @@
IMapping maps[]= ormProject.getMappings();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmBuilder->visit->validation(...),maps[]= " + maps.length + ", " + resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo("OrmBuilder->visit->validation(...),maps[]= " + maps.length + ", " + resource.getFullPath());
+ }
for(int i=0;i<maps.length;++i){
@@ -225,12 +237,14 @@
if(validationService != null){
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmBuilder->validation->validationService.incrementalRun, Service(" + maps[i].getName()+") for " + resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmBuilder->validation->validationService.incrementalRun, Service(" + maps[i].getName()+") for " + resource.getFullPath());
+ }
validationService.incrementalRun(resource);
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
}
}
@@ -244,7 +258,9 @@
if (ormProject == null) return;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("!!! fullBuild -> Project = " + ormProject.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("!!! fullBuild -> Project = " + ormProject.getName());
+ }
// delete tau 14.09.2005
//* open tau 19.09.2005 for Nikola
@@ -258,7 +274,9 @@
IMapping maps[]= ormProject.getMappings();
if (monitor != null) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("fullBuild for Refresh F5");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("fullBuild for Refresh F5");
+ }
monitor.setTaskParameters(1, maps.length);
}
@@ -267,7 +285,9 @@
if(validationService != null){
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("fullBuild, validationService.run for " + maps[i].getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("fullBuild, validationService.run for " + maps[i].getName());
+ }
validationService.run();
@@ -277,7 +297,7 @@
}
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,null);
+ OrmCore.getPluginLog().logError(e);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModel.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModel.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModel.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -36,10 +36,7 @@
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmModelEvent;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
-
/**
* @author Tau from Minsk
*
@@ -87,7 +84,9 @@
// edit tau 30.01.2006 ESORM-500
//if(root.remove(project)!=null) fireOrmModelEvent(new OrmModelEvent(this, this, project, OrmModelEvent.RemoveProject));
root.remove(project);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.removeOrmProject-> " + project.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.removeOrmProject-> " + project.getName());
+ }
fireOrmModelEvent(new OrmModelEvent(this, this, project, OrmModelEvent.RemoveProject));
}
@@ -161,7 +160,9 @@
protected void fireOrmModelEvent(final OrmModelEvent event){
if(listeners.size() == 0 )return;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.fireOrmModelEvent()->Source="+event.getSource().toString());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.fireOrmModelEvent()->Source="+event.getSource().toString());
+ }
// add tau 05.07.2005
final Map synchro_map = Collections.synchronizedMap(listeners);
@@ -332,12 +333,16 @@
// edit tau 17.11.2005 - add synchronized
public synchronized void resourcesChanged(final IResourceDelta delta) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("...DELTA START - OrmModel.resourcesChanged(...)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("...DELTA START - OrmModel.resourcesChanged(...)");
+ }
final Map<IOrmElement,IOrmProject> ResourceChanged = new HashMap<IOrmElement,IOrmProject>();
try {
// add 23.11.2005 tau
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("... DELTA lock(=" + OrmCore.lock.toString() + ").acquire(), Depth=" + OrmCore.lock.getDepth() + "- OrmModel.resourcesChanged(...)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("... DELTA lock(=" + OrmCore.lock.toString() + ").acquire(), Depth=" + OrmCore.lock.getDepth() + "- OrmModel.resourcesChanged(...)");
+ }
OrmCore.lock.acquire();
delta.accept(new IResourceDeltaVisitor() {
public boolean visit(IResourceDelta delta) {
@@ -367,34 +372,39 @@
*/
if (((delta.getFlags() & IResourceDelta.OPEN) != 0) && project.isOpen()) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT - OPEN ");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE){
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT - OPEN ");
+ }
try {
if (project.hasNature(OrmCore.ORM2NATURE_ID)) {
OrmCore.getDefault().create(project);
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
}
return false; // NO visit children
}
if (((delta.getFlags() & IResourceDelta.OPEN) != 0) && !project.isOpen()) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT - CLOSE ");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT - CLOSE ");
+ }
return false; // NO visit children
}
if (delta.getKind() == IResourceDelta.CHANGED) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.CHANGED on "+ resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.CHANGED on "+ resource.getFullPath());
+ }
} else if (delta.getKind() == IResourceDelta.ADDED) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.ADDED on "+ resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.ADDED on "+ resource.getFullPath());
+ }
return false; // NO visit children // tau 01.12.2005
} else if (delta.getKind() == IResourceDelta.OPEN) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE)
- ExceptionHandler.logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.OPEN on "+ resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...),IResource.PROJECT && IResourceDelta.OPEN on "+ resource.getFullPath());
+ }
return false; // NO visit children // tau 01.12.2005
}
return true;
@@ -421,16 +431,24 @@
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...) on "+file.getFullPath() + " " + file.getLocalTimeStamp() + "/"+ file.getModificationStamp());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...) on "+file.getFullPath() + " " + file.getLocalTimeStamp() + "/"+ file.getModificationStamp());
+ }
// only interested in changed resources (not added or removed)
if (delta.getKind() == IResourceDelta.CHANGED) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), IResourceDelta.CHANGED on "+file.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), IResourceDelta.CHANGED on "+file.getFullPath());
+ }
} else if (delta.getKind() == IResourceDelta.ADDED) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), IResourceDelta.ADDED on "+file.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), IResourceDelta.ADDED on "+file.getFullPath());
+ }
return false;
} else if (delta.getKind() == IResourceDelta.OPEN) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), IResourceDelta.OPEN on "+file.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), IResourceDelta.OPEN on "+file.getFullPath());
+ }
return false;
}
@@ -438,7 +456,9 @@
//only interested in content changes
if ((delta.getFlags() & IResourceDelta.CONTENT) == 0) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), CONTENT NO CHANGED(->EXIT) on "+file.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), CONTENT NO CHANGED(->EXIT) on "+file.getFullPath());
+ }
return false;
}
@@ -468,7 +488,9 @@
IResourceDelta refProjectDelta = delta.findMember(project.getProjectRelativePath());
if(refProjectDelta != null){
ormProjectForDelta = ormProject;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...)-> refProject= " + project.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...)-> refProject= " + project.getName());
+ }
break;
}
}
@@ -488,7 +510,9 @@
//mapping.resourcesChanged();
ResourceChanged.put(mapping, ormProjectForDelta);
flagResourceChanged = true;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + mapping.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + mapping.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ }
break;
}
}
@@ -503,7 +527,9 @@
//flagResourceChanged = mappingStorage.isResourceChanged();
ResourceChanged.put(mappingStorage,ormProjectForDelta);
flagResourceChanged = true;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + mappingStorage.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + mappingStorage.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ }
break;
}
}
@@ -520,7 +546,9 @@
//flagResourceChanged = clazz.isResourceChanged();
ResourceChanged.put(clazz, ormProjectForDelta);
flagResourceChanged = true;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + clazz.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...), ResourceChanged.put <- " + clazz.getName() + ",ResourceChanged.size()="+ ResourceChanged.size());
+ }
break;
}
}
@@ -548,7 +576,9 @@
}
});
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("...DELTA - OrmModel.resourcesChanged(...), ResourceChanged.size()="+ ResourceChanged.size());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("...DELTA - OrmModel.resourcesChanged(...), ResourceChanged.size()="+ ResourceChanged.size());
+ }
if (ResourceChanged.size() != 0 ){
Set setOrmProject = new HashSet();
Set ResourceChangedSet = ResourceChanged.entrySet();
@@ -570,7 +600,9 @@
}
if (flagChanged){
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmModel.resourcesChanged(...)=TRUE -> "+((IOrmElement) key).getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...)=TRUE -> "+((IOrmElement) key).getName());
+ }
setOrmProject.add(element.getValue());
}
}
@@ -578,17 +610,20 @@
for (Iterator iter = setOrmProject.iterator(); iter.hasNext();) {
IOrmProject ormProject = (IOrmProject)iter.next();
//ormProject.fireProjectBeforeChange(this);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo(
- "OrmModel.resourcesChanged(...) ->->-> ormProject.fireProjectChanged(this)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmModel.resourcesChanged(...) ->->-> ormProject.fireProjectChanged(this)");
+ }
ormProject.fireProjectChanged(this, false);
}
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
} finally {
// add 23.11.2005 tau
OrmCore.lock.release();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("... DELTA lock(=" + OrmCore.lock.toString() + ").release(), Depth=" + OrmCore.lock.getDepth() + " - OrmModel.resourcesChanged(...)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("... DELTA lock(=" + OrmCore.lock.toString() + ").release(), Depth=" + OrmCore.lock.getDepth() + " - OrmModel.resourcesChanged(...)");
+ }
}
//WorkspaceJob job = new WorkspaceJob("Refreshing files for ORM Explorer") {
@@ -601,7 +636,9 @@
*/
//return Status.OK_STATUS;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("...DELTA END - OrmModel.resourcesChanged(...)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("...DELTA END - OrmModel.resourcesChanged(...)");
+ }
return;
/*
}
@@ -715,16 +752,20 @@
IProject project = projects[i];
// edit Tau 28.04.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("Try initProject " + project.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Try initProject " + project.getName());
+ }
if (project.isAccessible()) {
try {
if (project.hasNature(OrmCore.ORM2NATURE_ID)) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("project " + project.getName() + "is open and hasNature " + OrmCore.ORM2NATURE_ID);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("project " + project.getName() + "is open and hasNature " + OrmCore.ORM2NATURE_ID);
+ }
OrmCore.getDefault().create(project);
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, "init projects");
+ OrmCore.getPluginLog().logError("init projects",e);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModelTest.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModelTest.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmModelTest.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -267,7 +267,7 @@
final IOrmProjectChangedListener listener = (IOrmProjectChangedListener)it.next();
Platform.run(new ISafeRunnable() {
public void handleException(Throwable exception) {
- OrmCore.log(exception, "Exception occurred in listener of OrmProject events");
+ OrmCore.getPluginLog().logError("Exception occurred in listener of OrmProject events", exception);
}
public void run() throws Exception {
listener.projectChanged(event, false);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmProject.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmProject.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmProject.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -44,7 +44,6 @@
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
import org.jboss.tools.hibernate.core.OrmProjectEvent;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.internal.core.hibernate.HibernateMapping;
import org.jboss.tools.hibernate.internal.core.properties.PropertySourceWrapper;
@@ -129,11 +128,13 @@
try {
synchronize();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) ExceptionHandler.logInfo(project.getName()+"->.loadMappins()");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE) {
+ OrmCore.getPluginLog().logInfo(project.getName()+"->.loadMappins()");
+ }
flagLoadMappings = true;
scanHibernateMappings();
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
}
@@ -208,7 +209,7 @@
mappings.put(mapping.getName(), mapping);
} catch(Exception ex){
- ExceptionHandler.logThrowableError(ex,"loading hibernate config");
+ OrmCore.getPluginLog().logError("loading hibernate config",ex);
}
monitor.worked();
}
@@ -380,7 +381,7 @@
((OrmConfiguration)ormConfiguration).setPropertyDescriptorsHolder(OrmPropertyDescriptorsHolder.getInstance(this));
flagLoadOrmConfiguration = true;
} catch(Exception e){
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
}
}
@@ -420,8 +421,9 @@
* @see org.jboss.tools.hibernate.core.IOrmProject#addOrmModelEventListener(org.jboss.tools.hibernate.core.IOrmProjectListener)
*/
public void addChangedListener(IOrmProjectChangedListener listener) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("OrmProject.addChangedListener: " + listener);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.addChangedListener: " + listener);
+ }
// tau 05.07.2005
//listeners.put(listener,listener);
@@ -435,7 +437,9 @@
// tau 09.11.2005
public void addBeforeChangeListener(IOrmProjectBeforeChangeListener listener) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.addBeforeListener: " + listener);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.addBeforeListener: " + listener);
+ }
Map<IOrmProjectBeforeChangeListener,IOrmProjectBeforeChangeListener> synchro_map = Collections.synchronizedMap(projectBeforeChangeListeners);
synchronized(synchro_map)
{
@@ -449,7 +453,9 @@
* @see org.jboss.tools.hibernate.core.IOrmProject#removeOrmModelEventListener(org.jboss.tools.hibernate.core.IOrmProjectListener)
*/
public void removeChangedListener(IOrmProjectChangedListener listener) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.removeChangedListener: " + listener);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.removeChangedListener: " + listener);
+ }
// tau 05.07.2005
//listeners.remove(listener);
Map synchro_map = Collections.synchronizedMap(projectChangedListeners);
@@ -461,7 +467,9 @@
}
public void removeBeforeChangeListener1(IOrmProjectBeforeChangeListener listener) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.removeBeforeListener: " + listener);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.removeBeforeListener: " + listener);
+ }
Map synchro_map = Collections.synchronizedMap(projectBeforeChangeListeners);
synchronized(synchro_map)
{
@@ -476,7 +484,9 @@
}
protected void fireOrmProjecChangedEvent(final OrmProjectEvent event, boolean flagUpdate){
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("fireOrmProjecChangedtEvent() START, Source="+event.getSource().toString());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("fireOrmProjecChangedtEvent() START, Source="+event.getSource().toString());
+ }
Map synchro_map = Collections.synchronizedMap(projectChangedListeners);
Set cl = synchro_map.keySet();
int i = 0;
@@ -486,8 +496,11 @@
while(it.hasNext()){
IOrmProjectChangedListener listener = (IOrmProjectChangedListener)it.next(); // edit 04.08.2005
i++;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.fireOrmProjecChangedtEvent()-> listener-"
- + i + " (" + listener.toString() + ")");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.fireOrmProjecChangedtEvent()-> listener-"
+ + i + " (" + listener.toString() + ")");
+ }
+
listener.projectChanged(event, flagUpdate);
/* del tau 04.05.2008
@@ -506,7 +519,9 @@
protected void NOfireOrmProjecBeforeChangedtEvent(final OrmProjectEvent event){
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.fireOrmProjecBeforeChangedtEvent() START, " + "Source="+event.getSource().toString());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.fireOrmProjecBeforeChangedtEvent() START, " + "Source="+event.getSource().toString());
+ }
Map<IOrmProjectBeforeChangeListener,IOrmProjectBeforeChangeListener> synchro_map = Collections.synchronizedMap(projectBeforeChangeListeners);
Set cl = synchro_map.keySet();
@@ -517,8 +532,9 @@
IOrmProjectBeforeChangeListener listener = (IOrmProjectBeforeChangeListener)it.next(); // edit 04.08.2005
i++;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.fireOrmProjecBeforeChangedtEvent()-> listener-"
- + i + " (" + listener.toString() + ")");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.fireOrmProjecBeforeChangedtEvent()-> listener-" + i + " (" + listener.toString() + ")");
+ }
listener.projectBeforeChange(event);
}
}
@@ -549,8 +565,9 @@
//added By Nick 19.05.2005
public void resourcesChanged()
{
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("OrmProject.resourceChanged");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.resourceChanged");
+ }
if (!initialized) return;
@@ -562,7 +579,7 @@
scanHibernateMappings();
} catch (Exception e1) {
- ExceptionHandler.logThrowableError(e1,e1.getMessage());
+ OrmCore.getPluginLog().logError(e1.getMessage(),e1);
}
IMapping[] mappings = this.getMappings();
for (int i = 0; i < mappings.length; i++) {
@@ -581,11 +598,12 @@
{
if (resource.getResource() != null && resource.getResource().isLocal(IResource.DEPTH_ZERO) && resource.resourceChanged())
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("Reloading resource: " + resource);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Reloading resource: " + resource);
+ }
resource.reload();
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...",e);
}
}
}
@@ -597,7 +615,9 @@
// add by yk 08.06.2005 stop.
// TODO (tau->tau) del? 27.01.2006
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("STOP? project.resourcesChanged()");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("STOP? project.resourcesChanged()");
+ }
fireProjectChanged(this, false);
}
@@ -644,7 +664,7 @@
}
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
}
@@ -673,7 +693,9 @@
boolean isSynchronized = project.isSynchronized(IResource.DEPTH_INFINITE);
//if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo(project.getName()+".synchronize() = " + isSynchronized);
if (!isSynchronized) {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("OrmProject.synchronize() -> project.refreshLocal(...)");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("OrmProject.synchronize() -> project.refreshLocal(...)");
+ }
project.refreshLocal(IResource.DEPTH_INFINITE, null);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/OrmPropertyDescriptorsHolder.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -28,8 +28,8 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IMapping;
import org.jboss.tools.hibernate.core.IPersistentClass;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.properties.EditableListPropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.ListPropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -505,7 +505,7 @@
try {
obj = javaProject.getAllPackageFragmentRoots();
} catch (JavaModelException e) {
- ExceptionHandler.logThrowableWarning(e, null); // tau // 15.09.2005
+ OrmCore.getPluginLog().logError(e); // tau // 15.09.2005
}
// add tau 19.03.2006
@@ -576,7 +576,7 @@
}
} catch (JavaModelException e1) {
- ExceptionHandler.logThrowableWarning(e1, null); // tau
+ OrmCore.getPluginLog().logError(e1); // tau
// 15.09.2005
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/PersistentClass.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/PersistentClass.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/PersistentClass.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -35,7 +35,6 @@
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.hibernate.PersistableProperty;
import org.jboss.tools.hibernate.internal.core.util.ScanProject;
import org.jboss.tools.hibernate.internal.core.util.TypeAnalyzer;
@@ -118,7 +117,7 @@
try {
cu = ScanProject.findCompilationUnit(cuName, projectMapping.getProject().getProject());
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, "Update failed for "+getName());
+ OrmCore.getPluginLog().logError("Update failed for "+getName(),e);
}
if (cu == null) return null; // no cu
setSourceCode(cu);
@@ -398,10 +397,8 @@
try
{
persistentClassType = ScanProject.findClassInCU(unit,this.getShortName());
- }
- catch (JavaModelException e)
- {
- ExceptionHandler.logThrowableError(e,"Error finding persistent class type");
+ } catch (JavaModelException e) {
+ OrmCore.getPluginLog().logError("Error finding persistent class type",e);
}
}
returnType = persistentClassType;
@@ -561,7 +558,7 @@
}
catch (Exception ex)
{
- ExceptionHandler.logThrowableError(ex, "Update failed for "+getName());
+ OrmCore.getPluginLog().logError("Update failed for "+getName(),ex);
}
finally{
timeStamp=refreshTimeStamp();
@@ -651,7 +648,7 @@
if (classType != null) {
fullyQualifiedName = classType.getFullyQualifiedName();
}
- ExceptionHandler.logInfo(this.getClass().getName() + body + fullyQualifiedName);
+ OrmCore.getPluginLog().logInfo(this.getClass().getName() + body + fullyQualifiedName);
}
}
@@ -720,7 +717,7 @@
result = resource.getLocalTimeStamp();
}
}catch (CoreException e) {
- ExceptionHandler.logInfo("Exception refreshing resource timestamp..., " + e.toString());
+ OrmCore.getPluginLog().logError("Exception refreshing resource timestamp..., " + e.toString());
}
return result;
}
@@ -729,18 +726,20 @@
long ts = refreshTimeStamp();
boolean isChanged = (timeStamp != ts || ts == SOURCE_NOT_EXISTS);
if (isChanged){
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("PersistentClass.isResourceChanged()->class.refresh():"+
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("PersistentClass.isResourceChanged()->class.refresh():"+
this.getName()+
", oldTS= "+timeStamp+
", newTs= "+ts);
+ }
this.refresh();
} else {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("PersistentClass.isResourceChanged()->class.NOrefresh():"+
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("PersistentClass.isResourceChanged()->class.NOrefresh():"+
this.getName()+
", oldTS= "+timeStamp+
", newTs= "+ts);
+ }
}
return isChanged;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/UpdateMappingVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/UpdateMappingVisitor.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/UpdateMappingVisitor.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -29,7 +29,6 @@
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.IAnyMapping;
import org.jboss.tools.hibernate.core.hibernate.IArrayMapping;
import org.jboss.tools.hibernate.core.hibernate.IBagMapping;
@@ -93,7 +92,9 @@
public void doMappingsUpdate(IPersistentClassMapping[] mappings) {
int mappingsLength = mappings.length;
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("=>> UpdateMappingVisitor.doMappingsUpdate(...), IPersistentClassMapping[]= " + mappingsLength);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("=>> UpdateMappingVisitor.doMappingsUpdate(...), IPersistentClassMapping[]= " + mappingsLength);
+ }
// added by yk 08.09.2005
@@ -115,7 +116,7 @@
try{
mappings[i].accept(this, null);
}catch(Exception ex){
- ExceptionHandler.logInfo("update failed for "+mappings[i].getName());
+ OrmCore.getPluginLog().logInfo("update failed for "+mappings[i].getName());
}
}
}
@@ -155,10 +156,8 @@
}
// added by yk 14.07.2005 stop
- }
- catch (Exception ex)
- {
- ExceptionHandler.logInfo("update failed for "+mappings[i].getName());;
+ } catch (Exception ex) {
+ OrmCore.getPluginLog().logError("update failed for "+mappings[i].getName());;
}
}
}
@@ -211,7 +210,7 @@
{ removeUnmappedFields(pc); }
} catch(Exception cex){
- ExceptionHandler.logInfo("update failed for "+mapping.getComponentClassName());
+ OrmCore.getPluginLog().logError("update failed for "+mapping.getComponentClassName());
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/codegenerator/DAOGenerator.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/codegenerator/DAOGenerator.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/codegenerator/DAOGenerator.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -29,10 +29,10 @@
import org.jboss.tools.hibernate.core.ICodeGenerationService;
import org.jboss.tools.hibernate.core.IDAOGenerator;
import org.jboss.tools.hibernate.core.IPersistentClass;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
import org.jboss.tools.hibernate.core.PropertyInfoStructure;
import org.jboss.tools.hibernate.core.IAutoMappingService.Settings;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
import org.jboss.tools.hibernate.core.hibernate.IManyToOneMapping;
import org.jboss.tools.hibernate.internal.core.CodeRendererServiceWrapper;
@@ -72,7 +72,7 @@
try {
thePackage = hamConfig.getPojoRenderer().getOrCreatePackage(((HibernateConfiguration) mapping.getConfiguration()).getProject(),packageName);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,"Exception creating package");
+ OrmCore.getPluginLog().logError("Exception creating package", e);
return;
}
@@ -98,7 +98,7 @@
if(classes[i].getType() != null && !Flags.isAbstract(classes[i].getType().getFlags()))
createTestCaseCUOperation.addNameToQueue(defPackage,getDAOTestCaseName(classes[i].getShortName()));
} catch (JavaModelException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(), e);
}
}
@@ -210,7 +210,7 @@
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
@@ -337,7 +337,7 @@
}
else
{
- ExceptionHandler.logInfo("Working copy type does not exist!");
+ OrmCore.getPluginLog().logInfo("Working copy type does not exist!");
}
//screwed
@@ -425,7 +425,7 @@
}
else
{
- ExceptionHandler.logInfo("Working copy type does not exist!");
+ OrmCore.getPluginLog().logInfo("Working copy type does not exist!");
}
//screwed
@@ -503,12 +503,10 @@
//screw away legacy auto-generated ctors
IType workType = CodeRendererServiceWrapper.getWorkingCopy(unit.findPrimaryType());
- if (workType != null)
- {
+ if (workType != null) {
IMethod[] methods = workType.getMethods();
- if (methods != null)
- {
+ if (methods != null) {
for (int i = 0; i < methods.length; i++) {
IMethod method = methods[i];
@@ -520,11 +518,9 @@
}
CodeRendererServiceWrapper.commitChanges(workType.getCompilationUnit());
CodeRendererServiceWrapper.saveChanges(workType.getCompilationUnit());
+ } else {
+ OrmCore.getPluginLog().logInfo("Working copy type does not exist!");
}
- else
- {
- ExceptionHandler.logInfo("Working copy type does not exist!");
- }
//screwed
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/data/Table.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/data/Table.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/data/Table.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -32,7 +32,6 @@
import org.jboss.tools.hibernate.core.IOrmModelVisitor;
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.UpdateMappingVisitor;
import org.jboss.tools.hibernate.internal.core.util.StringUtils;
@@ -393,13 +392,13 @@
c.setOwnerTable(this);
}// while
} catch (Exception ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(),ex);
} finally {
try {
if (columnsRS != null)
columnsRS.close();
} catch (SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(), ex);
}
}
columns.values().retainAll(processedColumns);
@@ -435,24 +434,28 @@
// by Nick
// added by Nick 06.06.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin(">>> Loaded - columns",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo(">>> Loaded - columns");
+ }
// by Nick
createPrimaryKey(md);
// added by Nick 06.06.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin(">>> Loaded - PK",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo(">>> Loaded - PK");
+ }
// by Nick
createForeignKey(imap, md);
// added by Nick 06.06.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin(">>> Loaded - FK's",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo(">>> Loaded - FK's" );
+ }
// by Nick
//comment by akuzmin 29.06.2005
loadIndexes(md);
// added by Nick 06.06.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin(">>> Loaded - indices",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo(">>> Loaded - indices" );
+ }
// by Nick
}
//by Nick
@@ -490,12 +493,12 @@
setPrimaryKey(prKey);
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(), ex);
}finally {
try{
if (rsPK != null) rsPK.close();
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(), ex);
}
}
@@ -573,12 +576,12 @@
foreignKeys.addAll(FKs.values());
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(), ex);
}finally {
try{
if (rsEK != null) rsEK.close();
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(),ex);
}
}
}
@@ -669,16 +672,16 @@
}
// }
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage());
+ OrmCore.getPluginLog().logError(ex.getMessage(),ex);
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e, null);
+ OrmCore.getPluginLog().logError(e);
}finally {
try{
// if (rs != null) rs.close();
if (rsInd != null) rsInd.close();
if (WSps != null) WSps.close();
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage());
+ OrmCore.getPluginLog().logError(ex.getMessage(),ex);
}
}
@@ -757,12 +760,12 @@
if("VIEW".equals(rs.getString("TABLE_TYPE"))) view=true;
}
} catch (SQLException ex){
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError(ex.getMessage(), ex);
}finally {
try{
if(rs!=null) rs.close();
}catch(SQLException ex) {
- ExceptionHandler.logThrowableError(ex, ex.getMessage().toString());
+ OrmCore.getPluginLog().logError( ex.getMessage(), ex);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/DefaultPersistentClassFiller.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/DefaultPersistentClassFiller.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/DefaultPersistentClassFiller.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -14,7 +14,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.hibernate.core.IOrmConfiguration;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.hibernate.IRootClassMapping;
import org.jboss.tools.hibernate.internal.core.OrmConfiguration;
import org.jboss.tools.hibernate.internal.core.OrmProject;
@@ -34,7 +34,7 @@
try {
result = Boolean.valueOf(propertyString).booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+propertyName+" property");
+ OrmCore.getPluginLog().logInfo("Exception parsing "+propertyName+" property",e);
configuration.setProperty(propertyName,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(propertyName));
save = true;
@@ -49,7 +49,7 @@
try {
result = Integer.parseInt(propertyString);
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+propertyName+" property");
+ OrmCore.getPluginLog().logError("Exception parsing "+propertyName+" property",e);
configuration.setProperty(propertyName,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(propertyName));
save = true;
@@ -98,7 +98,7 @@
try {
isLazy = Boolean.valueOf(lazyString);
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing hibernate.lazy");
+ OrmCore.getPluginLog().logError("Exception parsing hibernate.lazy",e);
configuration.setProperty(OrmConfiguration.HIBERNATE_LAZY,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HIBERNATE_LAZY));
save = true;
@@ -119,7 +119,7 @@
configuration.save();
save=false;
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfiguration.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfiguration.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -37,7 +37,6 @@
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateConfiguration;
import org.jboss.tools.hibernate.internal.core.OrmConfiguration;
@@ -597,8 +596,7 @@
result = resource.getLocalTimeStamp();
}
catch (CoreException e) {
- ExceptionHandler.logObjectPlugin("Exception refreshing resource timestamp...",
- OrmCore.getDefault().getBundle().getSymbolicName(), e);
+ OrmCore.getPluginLog().logError("Exception refreshing resource timestamp...",e);
}
}
return result;
@@ -612,7 +610,9 @@
}
//by Nick
public void resourcesChanged(){
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.resourcesChanged()");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.resourcesChanged()");
+ }
// del tau 02.11.2005
// added by yk 01.10.2005
@@ -623,7 +623,9 @@
*/
clearErrorMarkers();
// added by yk 01.10.2005.
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.resourcesChanged(), clearErrorMarkers() END");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.resourcesChanged(), clearErrorMarkers() END");
+ }
IMappingStorage[] storages = getMappingStorages();
boolean changed=false;
@@ -632,12 +634,14 @@
if ( storage.getResource().isLocal(IResource.DEPTH_ZERO)&& storage.resourceChanged())
{
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.resourcesChanged():" + storage.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.resourcesChanged():" + storage.getName());
+ }
try {
changed=true;
storage.reload();
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...",e);
}
}
}
@@ -645,7 +649,9 @@
if(!changed){
IPersistentClassMapping maps[]= getPersistentClassMappings();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.resourcesChanged() for maps[]:" + maps.length);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.resourcesChanged() for maps[]:" + maps.length);
+ }
for(int i=0;i<maps.length;++i){
IPersistentClass pc=maps[i].getPersistentClass();
if(pc!=null && pc.isResourceChanged()) {
@@ -658,17 +664,21 @@
//if(temp != null) errorMarkers.addAll(Arrays.asList(temp));
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.hbMapping.refresh(false) START:" + hbMapping.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.hbMapping.refresh(false) START:" + hbMapping.getName());
+ }
if(changed) {
try {
hbMapping.refresh(false, true);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage().toString(),e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError( e.getMessage().toString(),e);
} // do doMappingsUpdate - add tau 17.11.2005
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateConfiguration.hbMapping.refresh(false) END:" + hbMapping.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateConfiguration.hbMapping.refresh(false) END:" + hbMapping.getName());
+ }
}
// added by yk 30.09.2005
@@ -689,9 +699,9 @@
try {
hbMapping.reload(true);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage().toString());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationReader.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationReader.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationReader.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -21,7 +21,7 @@
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.hibernate.core.IMappingStorage;
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.core.hibernate.ICollectionMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
@@ -227,8 +227,7 @@
throw new Exception();
}
} catch(Exception ex){
- ExceptionHandler.logInfo("Read resource failure: " + mappingResourceName);
- //TODO notify user about exception by using ExceptionHandler.getLastException()
+ OrmCore.getPluginLog().logError("Read resource failure: " + mappingResourceName);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationWriter.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationWriter.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateConfigurationWriter.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -22,7 +22,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.hibernate.core.IMappingStorage;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.internal.core.BaseResourceReaderWriter;
import org.jboss.tools.hibernate.internal.core.util.ScanProject;
@@ -53,7 +53,7 @@
doc = readDocument(input);
}
} catch (Exception ex){
- ExceptionHandler.logThrowableError(ex,null);
+ OrmCore.getPluginLog().logError(ex);
}
if(doc == null) doc = createDocument();
mergeHibernateConfiguration(doc, flagSaveMappingStorages);
@@ -211,7 +211,7 @@
}
// #added# by Konstantin Mishin on 2005/08/26 fixed for ORMIISTUD-681
} catch (Exception e){
- ExceptionHandler.logThrowableWarning(e, null);
+ OrmCore.getPluginLog().logError(e);
}
// #added#
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateMapping.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/HibernateMapping.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -27,7 +27,6 @@
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.IValidationService;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.AbstractMapping;
import org.jboss.tools.hibernate.internal.core.OrmConfiguration;
import org.jboss.tools.hibernate.internal.core.OrmProject;
@@ -97,8 +96,7 @@
try{
input=writer.write(false); // edit tau 14.02.2006 - or writer.write(true)?
}catch (IOException e1) {
- ExceptionHandler.logThrowableError(e1,"Hibernate Connection Wizard:Finish ->"+e1.toString());
-
+ OrmCore.getPluginLog().logError("Hibernate Connection Wizard:Finish ->"+e1.toString(), e1);
}
if(!rsrc.exists()) rsrc.create(null, IResource.NONE, null); //add gavrs 4.03.05
@@ -123,7 +121,7 @@
try {
input.close();
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e,"Hibernate Connection Wizard:Finish ->"+e.toString());
+ OrmCore.getPluginLog().logError("Hibernate Connection Wizard:Finish ->"+e.toString(),e);
}
}
//}
@@ -277,47 +275,67 @@
try{
properties.reload();
} catch (Exception ex){
- ExceptionHandler.logThrowableError(ex, "loading mapping properties");
+ OrmCore.getPluginLog().logError("loading mapping properties",ex);
}
try{
config.reload();
} catch (Exception ex){
// edit tau 30.09.2005
- ExceptionHandler.logThrowableWarning(ex, "Error in other to loading mapping configuration");
+ OrmCore.getPluginLog().logError("Error in other to loading mapping configuration",ex);
}
}
//added By Nick 19.05.2005
public void resourcesChanged()
{
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged() START");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged() START");
+ }
if (properties != null && properties.getResource() != null && properties.getResource().isLocal(IResource.DEPTH_ZERO) && properties.resourceChanged())
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),properties.reload():"+properties);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),properties.reload():"+properties);
+ }
properties.reload();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),properties.reload() END");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),properties.reload() END");
+ }
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...", e);
}
if (config != null)
{
if (config.getResource().isLocal(IResource.DEPTH_ZERO) && config.resourceChanged()){
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),config.reload(): " + config);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),config.reload(): " + config);
+ }
+
config.reload();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),config.reload() END" + config);
+
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),config.reload() END" + config);
+ }
+
refresh(true, true); // do doMappingsUpdate - add tau 17.11.2005
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),refresh(true) END" + config);
+
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),refresh(true) END" + config);
+ }
} catch (Exception e1) {
- ExceptionHandler.logThrowableError(e1,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...",e1);
}
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged(),config.resourcesChanged(): " + config);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged(),config.resourcesChanged(): " + config);
+ }
config.resourcesChanged();
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("HibernateMapping.resourcesChanged() END");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("HibernateMapping.resourcesChanged() END");
+ }
}
//by Nick
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileReader.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -37,7 +37,6 @@
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateValueMapping;
import org.jboss.tools.hibernate.core.hibernate.Type;
@@ -108,7 +107,9 @@
InputStream content = ((IFile)resource).getContents(true);
org.dom4j.Document doc = readDocument(content);
rootBinder(doc, storage, Collections.EMPTY_MAP);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo(">> mapping loaded " + resource.getFullPath());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo(">> mapping loaded " + resource.getFullPath());
+ }
}
}
@@ -1043,7 +1044,7 @@
if (propertyName == null) {
bindSimpleValue(subnode, id, false, OrmConfiguration.DEFAULT_IDENTIFIER_COLUMN_NAME, storage);
if (!id.isTypeSpecified()) {
- ExceptionHandler.logInfo("must specify an identifier type: " + persistentClass.getEntityName());
+ OrmCore.getPluginLog().logInfo("must specify an identifier type: " + persistentClass.getEntityName());
}
} else {
String className = persistentClass.getClassName();
@@ -1222,7 +1223,7 @@
if (batchNode != null)
persistentClass.setBatchSize(Integer.parseInt(batchNode.getValue()));
} catch (NumberFormatException e) {
- ExceptionHandler.logInfo("batch-size is not integer: " + batchNode.getValue());
+ OrmCore.getPluginLog().logError("batch-size is not integer: " + batchNode.getValue());
}
//XXX Slava(5) load all attributes and child elements such as (id,
// composite-id, discriminator etc.)
@@ -1841,10 +1842,10 @@
}
} else {
if (node.elementIterator("column").hasNext()) {
- ExceptionHandler.logInfo("column attribute may not be used together with <column> subelement in "+resource.getProjectRelativePath().toString() + ": " +node.getPath());
+ OrmCore.getPluginLog().logInfo("column attribute may not be used together with <column> subelement in "+resource.getProjectRelativePath().toString() + ": " +node.getPath());
}
if (node.elementIterator("formula").hasNext()) {
- ExceptionHandler.logInfo("column attribute may not be used together with <formula> subelement in "+resource.getProjectRelativePath().toString() + ": " +node.getPath());
+ OrmCore.getPluginLog().logInfo("column attribute may not be used together with <formula> subelement in "+resource.getProjectRelativePath().toString() + ": " +node.getPath());
}
String columnname = columnAttribute.getValue();
@@ -2151,7 +2152,7 @@
Attribute attrib = element.attribute( "callable" );
if ( attrib != null && "true".equals( attrib.getValue() ) ) {
if ( !supportsCallable ) {
- ExceptionHandler.logInfo("callable attribute not supported yet!" );
+ OrmCore.getPluginLog().logInfo("callable attribute not supported yet!" );
}
return true;
}
@@ -2217,7 +2218,7 @@
return OrmConfiguration.CHECK_NONE;
}
else {
- ExceptionHandler.logInfo("Unsupported optimistic-lock style: " + olMode );
+ OrmCore.getPluginLog().logInfo("Unsupported optimistic-lock style: " + olMode );
return OrmConfiguration.CHECK_VERSION;
}
}
@@ -2241,8 +2242,9 @@
Element param = (Element)params.next();
String paramName = param.attributeValue("name");
String paramType = param.attributeValue("type");
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE )
- ExceptionHandler.logInfo("adding filter parameter : " + paramName + " -> " + paramType);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("adding filter parameter : " + paramName + " -> " + paramType);
+ }
// added by yk 19.10.2005
parameters.setProperty(paramName, paramType);
// added by yk 19.10.2005.
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileStorage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileStorage.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileStorage.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -31,7 +31,6 @@
import org.jboss.tools.hibernate.core.IOrmModelVisitor;
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.data.Schema;
import org.jboss.tools.hibernate.internal.core.data.Table;
import org.jboss.tools.hibernate.internal.core.hibernate.automapping.HibernateAutoMapping;
@@ -115,13 +114,13 @@
public void addPersistentClassMapping(IPersistentClassMapping mapping) {
if(hc.getClassMapping(mapping.getName())!=null){
//class already loaded
- ExceptionHandler.logThrowableWarning(null, "Duplicated class mapping ignored : " + mapping.getName());
+ OrmCore.getPluginLog().logInfo("Duplicated class mapping ignored : " + mapping.getName());
XMLFileStorageDublicate.set(mapping.getName());
return;
}
Object old = classes.get(mapping.getName());
if(old!=null){
- ExceptionHandler.logThrowableWarning(null, "Duplicated class mapping ignored: " + mapping.getName());
+ OrmCore.getPluginLog().logInfo("Duplicated class mapping ignored: " + mapping.getName());
return;
}
classes.put(mapping.getName(),mapping);
@@ -316,7 +315,7 @@
reader.reload();
} catch (DocumentException ex){
//throw new NestableRuntimeException(ex);
- ExceptionHandler.logThrowableWarning(ex,null); // add tau 19.06.2005 - for Alex
+ OrmCore.getPluginLog().logError(ex); // add tau 19.06.2005 - for Alex
} finally {
//added 19.05.2005 by Nick
timeStamp = refreshTimeStamp();
@@ -343,7 +342,7 @@
result = resource.getLocalTimeStamp();
}
catch (CoreException e) {
- ExceptionHandler.logInfo("Exception refreshing resource timestamp..., "+ e.toString());
+ OrmCore.getPluginLog().logError("Exception refreshing resource timestamp..., "+ e.toString());
}
}
return result;
@@ -360,7 +359,9 @@
public void addImport(String className, String rename){
//XXX toAlex: May be better use some exception instead logger.info ?
Object old = imports.put(rename, className);
- if (old!=null ) ExceptionHandler.logInfo("duplicate import: " + rename);
+ if (old!=null ) {
+ OrmCore.getPluginLog().logInfo("duplicate import: " + rename);
+ }
}
public IDatabaseTable getTable(String schema, String catalog, String name){
@@ -383,7 +384,9 @@
public void save() throws IOException ,CoreException{
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("XMLFileStorage.save() for" + getName() + ", dirty= " + dirty );
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("XMLFileStorage.save() for" + getName() + ", dirty= " + dirty );
+ }
if (!isDirty()) return;
@@ -530,7 +533,9 @@
boolean isChanged = this.resourceChanged();
if (isChanged) {
try {
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("XMLFileStorage.isResourceChanged()->storage.reload():"+this.getName());
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("XMLFileStorage.isResourceChanged()->storage.reload():"+this.getName());
+ }
/*
if (this.getProjectMapping() instanceof AbstractMapping) {
@@ -596,9 +601,9 @@
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...",e);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e,"Exception refreshing resources...");
+ OrmCore.getPluginLog().logError("Exception refreshing resources...",e);
}
}
return isChanged;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileWriter.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileWriter.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/XMLFileWriter.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -28,7 +28,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.internal.core.BaseResourceReaderWriter;
import org.jboss.tools.hibernate.internal.core.hibernate.query.NamedQueryDefinition;
@@ -67,7 +67,7 @@
doc = readDocument(input);
}
} catch (Exception ex){
- ExceptionHandler.logThrowableError(ex,null);
+ OrmCore.getPluginLog().logError(ex);
}
if(doc==null) doc = createDocument();
mergeMapping(doc);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ConfigurationReader.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ConfigurationReader.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/ConfigurationReader.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -24,8 +24,8 @@
import org.jboss.tools.hibernate.core.IDatabaseColumn;
import org.jboss.tools.hibernate.core.IOrmConfiguration;
import org.jboss.tools.hibernate.core.IOrmElement;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.IAutoMappingService.Settings;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.exception.NestableRuntimeException;
import org.jboss.tools.hibernate.core.hibernate.Type;
import org.jboss.tools.hibernate.internal.core.AbstractMapping;
@@ -174,7 +174,7 @@
}
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
instance.config.getOrmProject().getOrmConfiguration().setProperty(OrmConfiguration.REVTYPE_NUMERIC_X_Y,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.REVTYPE_NUMERIC_X_Y));
save = true;
@@ -279,7 +279,7 @@
try {
instance.lazy = Boolean.valueOf(lazyString);
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing hibernate.associations.lazy parameter");
+ OrmCore.getPluginLog().logError("Exception parsing hibernate.associations.lazy parameter",e);
ormConfig.setProperty(OrmConfiguration.HIBERNATE_ASSOCIATIONS_LAZY,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HIBERNATE_ASSOCIATIONS_LAZY));
save = true;
@@ -293,7 +293,7 @@
if (bool != null)
instance.cascadeDeleteEnabled = bool.booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+OrmConfiguration.HIBERNATE_KEY_ON_DELETE+" parameter");
+ OrmCore.getPluginLog().logError("Exception parsing "+OrmConfiguration.HIBERNATE_KEY_ON_DELETE+" parameter",e);
ormConfig.setProperty(OrmConfiguration.HIBERNATE_KEY_ON_DELETE,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HIBERNATE_KEY_ON_DELETE));
save = true;
@@ -306,7 +306,7 @@
if (bool != null)
instance.idGeneratorQuality = bool.booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+OrmConfiguration.HIBERNATE_ID_GENERATOR_QUALITY+" parameter");
+ OrmCore.getPluginLog().logError("Exception parsing "+OrmConfiguration.HIBERNATE_ID_GENERATOR_QUALITY+" parameter",e);
ormConfig.setProperty(OrmConfiguration.HIBERNATE_ID_GENERATOR_QUALITY,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HIBERNATE_ID_GENERATOR_QUALITY));
save = true;
@@ -325,7 +325,7 @@
}
catch (Exception e)
{
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+OrmConfiguration.HAM_QUERY_FUZZINESS+" parameter");
+ OrmCore.getPluginLog().logError("Exception parsing "+OrmConfiguration.HAM_QUERY_FUZZINESS+" parameter",e);
ormConfig.setProperty(OrmConfiguration.HAM_QUERY_FUZZINESS,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HAM_QUERY_FUZZINESS));
save = true;
@@ -380,7 +380,7 @@
throw new NestableRuntimeException("Error parsing "+ OrmConfiguration.REVTYPE_NUMERIC_1_0 + " parameter");
}
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
ormConfig.setProperty(OrmConfiguration.REVTYPE_NUMERIC_1_0,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.REVTYPE_NUMERIC_1_0));
save = true;
@@ -391,7 +391,7 @@
try {
instance.convertNumericsToPrimitive = Boolean.valueOf(numeric_convert).booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
ormConfig.setProperty(OrmConfiguration.REVTYPE_NUMERIC_CONVERT,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.REVTYPE_NUMERIC_CONVERT));
save = true;
@@ -402,7 +402,7 @@
try {
instance.preserveNativeSQLTypes = Boolean.valueOf(preserve_native_types).booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
ormConfig.setProperty(OrmConfiguration.REVERSING_NATIVE_SQL_TYPES,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.REVERSING_NATIVE_SQL_TYPES));
save = true;
@@ -416,7 +416,7 @@
try {
instance.collectionLazy = Boolean.valueOf(collection_lazy).booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
ormConfig.setProperty(OrmConfiguration.HIBERNATE_COLLECTIONS_LAZY,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HIBERNATE_COLLECTIONS_LAZY));
save = true;
@@ -426,7 +426,7 @@
try {
instance.reversingBaseClass = ScanProject.findClass(baseClassName,mapping.getProject().getProject());
} catch (CoreException e) {
- ExceptionHandler.logThrowableWarning(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
ormConfig.setProperty(OrmConfiguration.REVERSING_BASE_CLASS,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.REVERSING_BASE_CLASS));
save = true;
@@ -446,7 +446,7 @@
try {
instance.useFuzzySearch = Boolean.valueOf(fuzzyOnStr).booleanValue();
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+OrmConfiguration.HAM_QUERY_FUZZY_ON+" parameter");
+ OrmCore.getPluginLog().logError("Exception parsing "+OrmConfiguration.HAM_QUERY_FUZZY_ON+" parameter",e);
ormConfig.setProperty(OrmConfiguration.HAM_QUERY_FUZZY_ON,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.HAM_QUERY_FUZZY_ON));
save = true;
@@ -460,22 +460,19 @@
}
instance.tablePrefixQuery = prefQuery;
} catch (Exception e) {
- ExceptionHandler.logThrowableWarning(e,"Exception parsing "+OrmConfiguration.TABLE_PREFIX_QUERY+" parameter");
+ OrmCore.getPluginLog().logError("Exception parsing "+OrmConfiguration.TABLE_PREFIX_QUERY+" parameter",e);
ormConfig.setProperty(OrmConfiguration.TABLE_PREFIX_QUERY,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.TABLE_PREFIX_QUERY));
save = true;
}
ICodeRendererService service = ExtensionBinder.getCodeRendererService(ormConfig.getProperty(OrmConfiguration.POJO_RENDERER));
- if (service == null)
- {
+ if (service == null) {
instance.pojoRenderer = new CodeRendererServiceWrapper(new CodeRendererService());
ormConfig.setProperty(OrmConfiguration.POJO_RENDERER,
(String)ormPropertyDescriptorsHolder.getDefaultPropertyValue(OrmConfiguration.POJO_RENDERER));
save = true;
- }
- else
- {
+ } else {
instance.pojoRenderer = new CodeRendererServiceWrapper(service);
}
@@ -484,7 +481,7 @@
ormConfig.save();
save=false;
} catch (Exception e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
return instance;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMapping.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMapping.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMapping.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -48,7 +48,6 @@
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.ICollectionMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateKeyMapping;
import org.jboss.tools.hibernate.core.hibernate.IManyToManyMapping;
@@ -852,7 +851,9 @@
OrmProgressMonitor monitor = new OrmProgressMonitor(OrmProgressMonitor.getMonitor());
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("Starting reversing job. Have "+tables.length+" tables to reverse");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Starting reversing job. Have "+tables.length+" tables to reverse");
+ }
hamInit(settings);
@@ -868,7 +869,7 @@
try {
thePackage = hamConfig.getPojoRenderer().getOrCreatePackage(config.getProject(),defaultPackageName);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,"Exception creating package");
+ OrmCore.getPluginLog().logError("Exception creating package",e);
return;
}
@@ -894,7 +895,7 @@
try {
wc = unit.getWorkingCopy(null);
} catch (JavaModelException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
//by Nick
@@ -903,14 +904,11 @@
if (wc != null)
{
- try
- {
+ try {
wc.discardWorkingCopy();
+ } catch (JavaModelException e) {
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
- catch (JavaModelException e)
- {
- ExceptionHandler.logThrowableError(e,e.getMessage());
- }
}
if (type != null && mapping.findClass(type.getFullyQualifiedName()) == null)
@@ -933,8 +931,9 @@
if (monitor != null)
monitor.worked(5);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Package analysis finished. "+accessibleUnits.size()+" acceptable CU's found",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Package analysis finished. "+accessibleUnits.size()+" acceptable CU's found");
+ }
IPackageFragment defaultPackage = thePackage[0];
@@ -957,8 +956,9 @@
IDatabaseTable[] persistentTables = schemaProcessor.getPersistentTables();
final IPersistentClass[] pcArray = new IPersistentClass[persistentTables.length];
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Tables processed. Found "+persistentTables.length+" persistent classes",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo( "Tables processed. Found "+persistentTables.length+" persistent classes");
+ }
//process found persistent tables
@@ -1033,8 +1033,9 @@
createCUOperation.setOrmMonitor(monitor);
sourcePropertyCreation.setJobPart(30);
sourcePropertyCreation.setOrmMonitor(monitor);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("New CU's created",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("New CU's created" );
+ }
IProgressMonitor theMonitor = OrmProgressMonitor.getMonitor();
theMonitor.setTaskName("Creating source files");
@@ -1059,12 +1060,14 @@
//
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Persistent classes refreshed and have their identity filled",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Persistent classes refreshed and have their identity filled");
+ }
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Starting reversing/automapping",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Starting reversing/automapping");
+ }
ColumnMergingVisitor visitor = new ColumnMergingVisitor(mapping);
MappingsFactory valueFactory = MappingsFactory.getFullFactory(hamConfig,visitor);
@@ -1319,9 +1322,10 @@
//valueFactory.process();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Creating source properties in CU's",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
-
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Creating source properties in CU's");
+ }
+
//create composite id compilation units
for (int i = 0; i < pcArray.length; i++) {
@@ -1725,8 +1729,9 @@
if (monitor != null)
monitor.worked();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Class "+pc.getName()+" processed",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Class "+pc.getName()+" processed");
+ }
}
}
@@ -1768,19 +1773,22 @@
MappingsFactory valueFactory = MappingsFactory.getFullFactory(hamConfig, new ColumnBuilderVisitor(mapping));
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Starting automapping... Have "+classes.length+" to process",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Starting automapping... Have "+classes.length+" to process");
+ }
processPCs(classes,settings,valueFactory,monitor,true);
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Persistent fields analyzed. Now go and process them",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
-
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Persistent fields analyzed. Now go and process them");
+ }
+
valueFactory.process();
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Persistent fields fully processed. Running finalizing jobs",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
-
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Persistent fields fully processed. Running finalizing jobs");
+ }
+
if (sourcePropertyCreation != null)
{
sourcePropertyCreation.setJobPart(5);
@@ -1793,9 +1801,10 @@
new SubProgressMonitor(OrmProgressMonitor.getMonitor(),5));
}
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logObjectPlugin("Automapping finished",
- OrmCore.getDefault().getBundle().getSymbolicName(), this);
-
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("Automapping finished");
+ }
+
processedPCs = null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/HibernateAutoMappingHelper.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -36,8 +36,8 @@
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.PropertyInfoStructure;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateKeyMapping;
import org.jboss.tools.hibernate.core.hibernate.IManyToManyMapping;
@@ -223,11 +223,9 @@
}
CodeRendererServiceWrapper.commitChanges(workType.getCompilationUnit());
CodeRendererServiceWrapper.saveChanges(workType.getCompilationUnit());
+ } else {
+ OrmCore.getPluginLog().logInfo("Working copy type does not exist!"); //$NON-NLS-1$
}
- else
- {
- ExceptionHandler.logInfo("Working copy type does not exist!"); //$NON-NLS-1$
- }
//screwed
if (!fullProps.isEmpty())
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/MappingsFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/MappingsFactory.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/automapping/MappingsFactory.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -33,7 +33,7 @@
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.hibernate.ICollectionMapping;
import org.jboss.tools.hibernate.core.hibernate.IComponentMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateKeyMapping;
@@ -229,7 +229,7 @@
pField.setMapping(null);
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,"Exception adding persistent field to mappings factory");
+ OrmCore.getPluginLog().logError("Exception adding persistent field to mappings factory",e);
removeDeferredOnCrash(pField);
} finally {
}
@@ -731,7 +731,7 @@
}
}
} catch (JavaModelException e) {
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ OrmCore.getPluginLog().logError(e.getMessage(),e);
}
}
}
@@ -1316,7 +1316,7 @@
// #added#
}
catch (CoreException e) {
- ExceptionHandler.logThrowableError(e,"Exception processing deferred mappings");
+ OrmCore.getPluginLog().logError("Exception processing deferred mappings",e);
}
}
deferredProperties.clear();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ArrayMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ArrayMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ArrayMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -13,7 +13,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IDatabaseTable;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -45,7 +45,7 @@
}
else
{
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/BagMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/BagMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/BagMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -12,7 +12,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -41,11 +41,9 @@
pd.setDescription(Messages.BagMappingDescriptorsHolderWithTable_CollectionTableD);
pd.setCategory(GENERAL_CATEGORY);
addPropertyDescriptor(pd);
+ } else {
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
- else
- {
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/CollectionMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/CollectionMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/CollectionMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -12,7 +12,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -41,11 +41,9 @@
pd.setDescription(Messages.CollectionMappingDescriptorsHolderWithTable_CollectionTableD);
pd.setCategory(GENERAL_CATEGORY);
addPropertyDescriptor(pd);
+ } else {
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
- else
- {
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/IdBagMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/IdBagMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/IdBagMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -12,7 +12,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -40,11 +40,9 @@
pd.setDescription(Messages.IdBagMappingDescriptorsHolderWithTable_CollectionTableD);
pd.setCategory(GENERAL_CATEGORY);
addPropertyDescriptor(pd);
+ } else {
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
- else
- {
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ListMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ListMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/ListMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -13,7 +13,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IDatabaseTable;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -41,11 +41,9 @@
pd.setDescription(Messages.ListMappingDescriptorsHolderWithTable_CollectionTableD);
pd.setCategory(GENERAL_CATEGORY);
addPropertyDescriptor(pd);
+ } else {
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
- else
- {
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/PrimitiveArrayMappingDescriptorsHolderWithTable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/PrimitiveArrayMappingDescriptorsHolderWithTable.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/hibernate/descriptors/PrimitiveArrayMappingDescriptorsHolderWithTable.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -13,7 +13,7 @@
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.jboss.tools.hibernate.core.IDatabaseTable;
import org.jboss.tools.hibernate.core.IPersistentField;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.internal.core.properties.DBTablePropertyDescriptor;
import org.jboss.tools.hibernate.internal.core.properties.PropertyDescriptorsHolder;
@@ -35,17 +35,14 @@
protected PrimitiveArrayMappingDescriptorsHolderWithTable(IDatabaseTable table, IPersistentField pfm) {
super(table);
PropertyDescriptor pd;
- if (pfm.getOwnerClass()!=null)
- {
- pd=new DBTablePropertyDescriptor("collectionTable",Messages.PrimitiveArrayMappingDescriptorsHolderWithTable_CollectionTableN,null,pfm.getOwnerClass().getPersistentClassMapping(),pfm); //$NON-NLS-1$
- pd.setDescription(Messages.PrimitiveArrayMappingDescriptorsHolderWithTable_CollectionTableD);
- pd.setCategory(GENERAL_CATEGORY);
- addPropertyDescriptor(pd);
+ if (pfm.getOwnerClass()!=null) {
+ pd=new DBTablePropertyDescriptor("collectionTable",Messages.PrimitiveArrayMappingDescriptorsHolderWithTable_CollectionTableN,null,pfm.getOwnerClass().getPersistentClassMapping(),pfm); //$NON-NLS-1$
+ pd.setDescription(Messages.PrimitiveArrayMappingDescriptorsHolderWithTable_CollectionTableD);
+ pd.setCategory(GENERAL_CATEGORY);
+ addPropertyDescriptor(pd);
+ } else {
+ OrmCore.getPluginLog().logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
}
- else
- {
- ExceptionHandler.logInfo("Field "+pfm.getName()+" hasn't owner class"); //$NON-NLS-1$ //$NON-NLS-2$
- }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/OrmFileDeleteChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/OrmFileDeleteChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/OrmFileDeleteChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -22,7 +22,6 @@
import org.jboss.tools.hibernate.core.IMappingStorage;
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
/**
@@ -77,7 +76,9 @@
projects[i].removeMapping(mappings[m]);
// TODO (tau->tau) del? 27.01.2006
- if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) ExceptionHandler.logInfo("STOP? OrmFileDeleteChange.perform()");
+ if (OrmCore.TRACE || OrmCore.TRACE_INT_CORE ) {
+ OrmCore.getPluginLog().logInfo("STOP? OrmFileDeleteChange.perform()");
+ }
projects[i].fireProjectChanged(this, false);
return null;
}
@@ -127,7 +128,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("OrmFileDeleteChange.deleteOrmFile")+" "+ormFile);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("OrmFileDeleteChange.deleteOrmFile")+" "+ormFile, ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageDeleteChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageDeleteChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageDeleteChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -27,9 +27,7 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -103,7 +101,7 @@
public Change perform(IProgressMonitor pm) throws CoreException {
Change ch=super.perform(pm);
- ExceptionHandler.logInfo("========== PERFORM PACKAGE DELETE "+this);
+ OrmCore.getPluginLog().logInfo("========== PERFORM PACKAGE DELETE "+this);
if (mappingSet!=null) {
try {
for(Iterator it=mappingSet.iterator(); it.hasNext();) {
@@ -112,7 +110,7 @@
}
} catch (Exception e) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableWarning(e,BUNDLE.getString("PackageDeleteChange.createChangeError")+" "+packageName);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PackageDeleteChange.createChangeError")+" "+packageName,e);
}
}
return ch;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageRenameChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageRenameChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PackageRenameChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -26,9 +26,7 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -104,7 +102,7 @@
}
} catch (Exception e) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableWarning(e,BUNDLE.getString("PackageDeleteChange.createChangeError")+" "+packageName);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PackageDeleteChange.createChangeError")+" "+packageName,e);
}
}
return ch;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassDeleteChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassDeleteChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassDeleteChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -23,7 +23,6 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.util.ClassUtils;
@@ -110,7 +109,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentClassDeleteChange.deletePersistentClass")+" "+type);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentClassDeleteChange.deletePersistentClass")+" "+type,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassMoveChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassMoveChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassMoveChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -23,9 +23,7 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -103,7 +101,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentClassMoveChange.movePersistentClass")+" "+type);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentClassMoveChange.movePersistentClass")+" "+type,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassRenameChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassRenameChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentClassRenameChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -23,9 +23,7 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -88,7 +86,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentClassRenameChange.renamePersistentClass")+" "+type);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentClassRenameChange.renamePersistentClass")+" "+type,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldDeleteChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldDeleteChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldDeleteChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -26,9 +26,7 @@
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -88,7 +86,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentFieldDeleteChange.deletePersistentField")+" "+field);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentFieldDeleteChange.deletePersistentField")+" "+field,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldMoveChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldMoveChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldMoveChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -24,9 +24,7 @@
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
/**
* @author Yan
*
@@ -84,7 +82,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentFieldMoveChange.movePersistentField")+" "+field);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentFieldMoveChange.movePersistentField")+" "+field,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldRenameChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldRenameChange.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.core/src/org/jboss/tools/hibernate/internal/core/refactoring/PersistentFieldRenameChange.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -24,9 +24,7 @@
import org.jboss.tools.hibernate.core.IPersistentClass;
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
-
public class PersistentFieldRenameChange extends Change {
public static final String BUNDLE_NAME = "messages";
@@ -82,7 +80,7 @@
} catch(Exception ex) {
pm.setCanceled(true);
- ExceptionHandler.logThrowableError(ex,BUNDLE.getString("PersistentFieldRenameChange.renamePersistentField")+" "+field);
+ OrmCore.getPluginLog().logError(BUNDLE.getString("PersistentFieldRenameChange.renamePersistentField")+" "+field,ex);
}
return null;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/.classpath
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/.classpath 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/.classpath 2007-06-28 14:01:54 UTC (rev 2205)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="/org.jboss.tools.common"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -13,11 +13,13 @@
import org.eclipse.ui.plugin.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.BundleContext;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
/**
* The main plugin class to be used in the desktop.
*/
-public class VizualEditorPlugin extends AbstractUIPlugin {
+public class VizualEditorPlugin extends BaseUIPlugin {
public final static String PLUGIN_ID= "org.jboss.tools.hibernate.veditor";
@@ -63,4 +65,12 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ActionOrmTree.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ActionOrmTree.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ActionOrmTree.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -12,7 +12,6 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.TreeViewer;
-import org.jboss.tools.hibernate.view.ViewPlugin;
// tau 22.11.2005
// edit tau 27.01.2006
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ContentProviderVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ContentProviderVisitor.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ContentProviderVisitor.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -10,18 +10,9 @@
******************************************************************************/
package org.jboss.tools.hibernate.view.views;
-import java.util.ArrayList;
-import java.util.Iterator;
import java.util.ResourceBundle;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.hibernate.mapping.Column;
-import org.jboss.tools.hibernate.view.ViewPlugin;
/**
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OpenDiagramActionDelegate.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OpenDiagramActionDelegate.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OpenDiagramActionDelegate.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -14,7 +14,6 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
@@ -22,7 +21,6 @@
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.ObjectPluginAction;
import org.hibernate.cfg.Configuration;
-import org.hibernate.mapping.RootClass;
import org.jboss.tools.hibernate.view.ViewPlugin;
public class OpenDiagramActionDelegate implements IObjectActionDelegate {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmContentProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmContentProvider.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/OrmContentProvider.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -10,14 +10,8 @@
******************************************************************************/
package org.jboss.tools.hibernate.view.views;
-import java.util.Arrays;
-import java.text.Collator;
-import java.util.Comparator;
-
-import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -26,7 +20,6 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TreeItem;
-import org.jboss.tools.hibernate.view.ViewPlugin;
/**
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ViewsAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ViewsAction.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/view/views/ViewsAction.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -10,54 +10,11 @@
******************************************************************************/
package org.jboss.tools.hibernate.view.views;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
-import java.util.Arrays;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.ResourceBundle;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourceAttributes;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceSorter;
import org.jboss.tools.hibernate.view.ViewPlugin;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/.classpath
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/.classpath 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/.classpath 2007-06-28 14:01:54 UTC (rev 2205)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="/org.jboss.tools.common"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/VizualEditorPlugin.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -10,14 +10,16 @@
******************************************************************************/
package org.jboss.tools.hibernate.veditor;
-import org.eclipse.ui.plugin.*;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
-public class VizualEditorPlugin extends AbstractUIPlugin {
+public class VizualEditorPlugin extends BaseUIPlugin {
public final static String PLUGIN_ID= "org.jboss.tools.hibernate.veditor";
@@ -63,4 +65,12 @@
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -25,7 +25,6 @@
import org.jboss.tools.hibernate.core.IPersistentClassMapping;
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.core.hibernate.ICollectionMapping;
import org.jboss.tools.hibernate.core.hibernate.IComponentMapping;
import org.jboss.tools.hibernate.core.hibernate.IHibernateClassMapping;
@@ -67,7 +66,7 @@
string += tempString;
} while (tempString != null);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage());
+ VizualEditorPlugin.getPluginLog().logError(e.getMessage(),e);
}
childrenLocations = string.split("#");
} else
@@ -112,7 +111,7 @@
resource.setPersistentProperty((new QualifiedName(VizualEditorPlugin.PLUGIN_ID,qualifiedNameString+i)),
string.substring(2048*i));
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, e.getMessage());
+ VizualEditorPlugin.getPluginLog().logError(e.getMessage(),e);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/AutoMappingSetting.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/AutoMappingSetting.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/AutoMappingSetting.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -31,7 +31,6 @@
import org.eclipse.ui.views.properties.PropertySheetPage;
import org.jboss.tools.hibernate.core.IOrmConfiguration;
import org.jboss.tools.hibernate.core.IOrmProject;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.OrmConfiguration;
import org.jboss.tools.hibernate.internal.core.OrmProject;
import org.jboss.tools.hibernate.internal.core.properties.BeanPropertySourceBase;
@@ -109,7 +108,7 @@
try {
ormConfiguration.reload();
} catch(Exception e) {
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
}
super.cancelPressed();
}
@@ -118,7 +117,7 @@
try {
ormConfiguration.save();
} catch(Exception e) {
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
}
setReturnCode(OK);
close();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/ColumnPropertyDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/ColumnPropertyDialog.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/ColumnPropertyDialog.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -119,9 +119,9 @@
//mod.save();
mod.saveMappingStorageForPersistentClassMapping(column.getOwnerTable().getPersistentClassMappings());
} catch (IOException e) {
- ExceptionHandler.handle(new InvocationTargetException(e), getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
} catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
}
setReturnCode(OK);
close();
@@ -149,12 +149,11 @@
mod.refresh(false, true); // edit tau 17.11.2005
}
} catch (IOException e) {
- ExceptionHandler.handle(new InvocationTargetException(e), getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
} catch (CoreException e) {
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
} catch (Throwable e) {
- ExceptionHandler.handle(new InvocationTargetException(e), getShell(), null, null);
- //ExceptionHandler.logThrowableWarning(e,null); // tau 15.09.2005
+ ViewPlugin.getPluginLog().logError(e);
}
super.cancelPressed();
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RenameTableObjectDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RenameTableObjectDialog.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RenameTableObjectDialog.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -156,12 +156,11 @@
//mod.save();
mod.saveMappingStorageForPersistentClassMapping(table.getPersistentClassMappings());
} catch (IOException e) {
- //TODO (tau-tau) for Exception
- ExceptionHandler.handle(new InvocationTargetException(e), getShell(), null,
- null);
+ //TODO (tau-tau) for Exception
+ ViewPlugin.getPluginLog().logError(e);
} catch (CoreException e) {
//TODO (tau-tau) for Exception
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
setReturnCode(OK);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RunTimeSetting.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RunTimeSetting.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/dialog/RunTimeSetting.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -22,8 +22,8 @@
import org.eclipse.ui.views.properties.PropertySheetPage;
import org.jboss.tools.hibernate.core.IMapping;
import org.jboss.tools.hibernate.core.IMappingProperties;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.properties.PropertySheetPageWithDescription;
+import org.jboss.tools.hibernate.view.ViewPlugin;
/**
* @author Gavrs
@@ -69,7 +69,7 @@
try {
mapProperty.reload();
} catch (Exception e) {
- ExceptionHandler.handle(e, getShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
}
// #added#
if(mapProperty!=null)
@@ -127,9 +127,9 @@
//jLogProp.save();
//log4JProp.save();
mapProperty.save();
- }catch(Exception e){
- ExceptionHandler.handle(e, getShell(), null, null);
- }
+ }catch(Exception e) {
+ ViewPlugin.getPluginLog().logError(e);
+ }
super.okPressed();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/refactoring/RefactoringSupport.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/refactoring/RefactoringSupport.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/refactoring/RefactoringSupport.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -46,7 +46,7 @@
RenameSupport renameSupport=RenameSupport.create(cUnit,null,RenameSupport.UPDATE_REFERENCES);
renameSupport.openDialog(parent);
} catch (CoreException e) {
- ExceptionHandler.handle(e,ViewPlugin.getActiveWorkbenchShell(),null, "Error in rename Persistent Class.");
+ ViewPlugin.getPluginLog().logError("Error in rename Persistent Class.");
}
}
@@ -64,16 +64,15 @@
IJavaElement[] jes=null;
try {
jes=cUnit.getChildren();
- } catch (JavaModelException e1) {
- //TODO (tau-tau) for Exception
- e1.printStackTrace();
+ } catch (JavaModelException e) {
+ ViewPlugin.getPluginLog().logError(e);
}
+
try {
RenameSupport renameSupport=RenameSupport.create(cUnit,null,RenameSupport.UPDATE_REFERENCES);
renameSupport.openDialog(parent);
} catch (CoreException e) {
- //TODO (tau-tau) for Exception
- e.printStackTrace();
+ ViewPlugin.getPluginLog().logError(e);
}
}
@@ -106,8 +105,7 @@
//clazz.getPersistentClassMapping().getStorage().save();
clazz.getPersistentClassMapping().getStorage().save(true);
} catch (IOException e) {
- //TODO (tau-tau) for Exception
- ExceptionHandler.logThrowableError(e,e.getMessage());
+ ViewPlugin.getPluginLog().logError(e);
}
}
}
@@ -118,8 +116,7 @@
}
} catch (CoreException e) {
- //TODO (tau-tau) for Exception
- e.printStackTrace();
+ ViewPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/AddOrmNatureAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/AddOrmNatureAction.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/AddOrmNatureAction.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -59,7 +59,6 @@
import org.jboss.tools.hibernate.core.IOrmProject;
import org.jboss.tools.hibernate.core.OrmCore;
import org.jboss.tools.hibernate.core.OrmProgressMonitor;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.dialog.ModelCheckedTreeSelectionDialog;
import org.jboss.tools.hibernate.dialog.SelectAdditionPersClasses;
import org.jboss.tools.hibernate.dialog.StatisticDialog;
@@ -161,7 +160,9 @@
}
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("Ok addNatureToProject for " + project.getName());
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("Ok addNatureToProject for " + project.getName());
+ }
//add tau 04.08.2005
if (ormMapping != null &&
@@ -178,11 +179,14 @@
}
}
} else {
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW)ExceptionHandler.logInfo("Cancel addNatureToProject for " + project.getName());
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("Cancel addNatureToProject for " + project.getName());
+ }
+
OrmCore.getDefault().getOrmModel().removeOrmProject(project);
}
} catch (CoreException e) {
- ExceptionHandler.handle(e,ViewPlugin.getActiveWorkbenchShell(),null, "Error in Add Hibernate capabilities!");
+ ViewPlugin.getPluginLog().logError("Error in Add Hibernate capabilities!",e);
} finally {
// edit tau 27.01.2006
OrmCore.getDefault().updateListener();
@@ -234,7 +238,7 @@
try {
progress.run(false, true, operation);
} catch (InvocationTargetException e1) {
- ExceptionHandler.handle(e1,ViewPlugin.getActiveWorkbenchShell(),null, "PersistentClasses was not created!");
+ ViewPlugin.getPluginLog().logError("PersistentClasses was not created!",e1);
} catch (InterruptedException e1) {
//TODO (tau-tau) for Exception
// Cancelled.
@@ -284,7 +288,9 @@
throw new InvocationTargetException(e);
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("addNatureToProject: for " + project.getName());
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("addNatureToProject: for " + project.getName());
+ }
} finally {
monitor.done();
@@ -297,7 +303,7 @@
try {
progress.run(false, true, operationAddNature);
} catch (InvocationTargetException e1) {
- ExceptionHandler.handle(e1,ViewPlugin.getActiveWorkbenchShell(),null, "Error in order to add Orm Nature");
+ ViewPlugin.getPluginLog().logError("Error in order to add Orm Nature",e1);
} catch (InterruptedException e1) {
//TODO (tau-tau) for Exception
// Cancelled.
@@ -357,14 +363,18 @@
flagLib = true;
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("folderLibPath= " + folderLibPath);
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("folderLibPath= " + folderLibPath);
+ }
break;
}
}
}
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ }
if (folderLibPath == null){
for (int i = 0; i < classpathEntries.length; i++) {
@@ -389,7 +399,9 @@
}
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("2 folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("2 folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ }
if (folderLibPath != null) {
if (folderLibPath.segmentCount() == 1){
@@ -403,7 +415,9 @@
folderLibPath = folderLib.getLocation();
}
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("3 folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("3 folderLibPath= " + folderLibPath + ",flagLib= " + flagLib);
+ }
if (folderLibPath == null) {
for (int i = 0; i < libs.length; i++) {
@@ -455,7 +469,9 @@
monitor.worked(1);
if (folderLib != null){
- if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) ExceptionHandler.logInfo("ref->" + folderLib);
+ if (ViewPlugin.TRACE || ViewPlugin.TRACE_VIEW) {
+ ViewPlugin.getPluginLog().logInfo("ref->" + folderLib);
+ }
folderLib.refreshLocal(IResource.DEPTH_ONE,new NullProgressMonitor());
}
monitor.worked(1);
@@ -503,7 +519,7 @@
try {
fileSource = getFileFromBundle("org.jboss.tools.hibernate.hblibs", new Path("/lib") );
} catch (IOException e) {
- ExceptionHandler.handle(e, ViewPlugin.getActiveWorkbenchShell(), null, null);
+ ViewPlugin.getPluginLog().logError(e);
return false;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/ViewPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/ViewPlugin.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/ViewPlugin.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -26,8 +26,8 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
import org.osgi.framework.BundleContext;
@@ -35,7 +35,7 @@
/**
* The main plugin class to be used in the desktop.
*/
-public class ViewPlugin extends AbstractUIPlugin {
+public class ViewPlugin extends BaseUIPlugin {
//The shared instance.
private static ViewPlugin plugin;
//Resource bundle.
@@ -63,10 +63,6 @@
} catch (MissingResourceException x) {
resourceBundle = null;
}
-
- if (TRACE || TRACE_VIEW )
- ExceptionHandler.logObjectPlugin("ViewPlugin()",PLUGIN_ID, null);
-
}
public static ImageDescriptor getImageDescriptor(String name) {
@@ -166,9 +162,16 @@
try {
properties.load(bain);
} catch (IOException e) {
- ExceptionHandler.logThrowableError(e, null);
+ getPluginLog().logError(e);
}
}
}
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/actions/ViewAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/actions/ViewAction.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/actions/ViewAction.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -24,7 +24,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.hibernate.core.OrmCore;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
+import org.jboss.tools.hibernate.view.ViewPlugin;
import org.jboss.tools.hibernate.view.views.ExplorerBase;
import org.jboss.tools.hibernate.view.views.ExplorerClass;
@@ -57,14 +57,14 @@
ExplorerClass explorer = (ExplorerClass) getPage().showView(ExplorerClass.getExplorerId(), null, IWorkbenchPage.VIEW_ACTIVATE);
explorer.setOrmProjects(OrmCore.getDefault().getOrmModel());
} catch (PartInitException e) {
- ExceptionHandler.logThrowableError(e,null);
+ ViewPlugin.getPluginLog().logError(e);
}
try {
ExplorerBase explorerBase = (ExplorerBase) getPage().showView(ExplorerBase.getExplorerId(),null, IWorkbenchPage.VIEW_VISIBLE);
explorerBase.setOrmProjects(OrmCore.getDefault().getOrmModel());
} catch (PartInitException e) {
- ExceptionHandler.logThrowableError(e,null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/decorator/LightWeightDecoratorVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/decorator/LightWeightDecoratorVisitor.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/view/decorator/LightWeightDecoratorVisitor.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -33,8 +33,8 @@
import org.jboss.tools.hibernate.core.IPersistentField;
import org.jboss.tools.hibernate.core.IPersistentFieldMapping;
import org.jboss.tools.hibernate.core.IPersistentValueMapping;
-import org.jboss.tools.hibernate.core.exception.ExceptionHandler;
import org.jboss.tools.hibernate.internal.core.hibernate.validation.HibernateValidationProblem;
+import org.jboss.tools.hibernate.view.ViewPlugin;
/**
@@ -71,7 +71,7 @@
// }
// }
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
@@ -136,7 +136,7 @@
}
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
}
@@ -168,7 +168,7 @@
HibernateValidationProblem.MARKER_TYPE, true,
IResource.DEPTH_ZERO);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
@@ -219,7 +219,7 @@
HibernateValidationProblem.MARKER_TYPE, true,
IResource.DEPTH_ZERO);
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
@@ -330,7 +330,7 @@
}
}
} catch (CoreException e) {
- ExceptionHandler.logThrowableError(e, null);
+ ViewPlugin.getPluginLog().logError(e);
}
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/wizard/generateDDL/HibernateDDLGenerator.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/wizard/generateDDL/HibernateDDLGenerator.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.view/src/org/jboss/tools/hibernate/wizard/generateDDL/HibernateDDLGenerator.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -20,6 +20,7 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.tool.hbm2ddl.SchemaExport;
+import org.jboss.tools.hibernate.view.ViewPlugin;
@@ -52,9 +53,8 @@
n = n.substring(0, n.length() - suffix.length());
if(n.length() > 0) l.add(n);
}
- } catch (Throwable t) {
- //TODO (tau-tau) for Exception
- t.printStackTrace();
+ } catch (Throwable e) {
+ ViewPlugin.getPluginLog().logError(e);
}
return l.toArray(new String[0]);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -12,6 +12,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.common.log.BaseUIPlugin;
+import org.jboss.tools.common.log.IPluginLog;
import org.osgi.framework.BundleContext;
/**
@@ -68,4 +69,11 @@
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
+
+ /**
+ * @return IPluginLog object
+ */
+ public static IPluginLog getPluginLog() {
+ return getDefault();
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -21,6 +21,7 @@
import org.apache.tools.ant.types.resources.FileResource;
import org.apache.tools.ant.util.FileUtils;
import org.apache.tools.ant.util.ResourceUtils;
+import org.jboss.tools.seam.core.SeamCorePlugin;
public class AntCopyUtils {
@@ -53,7 +54,7 @@
try {
FileUtils.getFileUtils().copyFile(file, new File(destinationFolder,file.getName()),set,override);
} catch (IOException e) {
- e.printStackTrace();
+ SeamCorePlugin.getPluginLog().logError(e);
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2007-06-28 12:26:47 UTC (rev 2204)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2007-06-28 14:01:54 UTC (rev 2205)
@@ -24,6 +24,7 @@
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.w3c.dom.Node;
+import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.selection.VpeSourceSelection;
import org.jboss.tools.vpe.editor.selection.VpeSourceSelectionBuilder;
@@ -163,7 +164,7 @@
try {
rect = composite.getBounds();
} catch (Exception e) {
- e.printStackTrace();
+ VpePlugin.getPluginLog().logError(e);
}
int allItems = selBar.getItems().length;
17 years, 6 months
JBoss Tools SVN: r2204 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-06-28 08:26:47 -0400 (Thu, 28 Jun 2007)
New Revision: 2204
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IRole.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentMethod.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IBijectedAttribute.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlElement.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
Seam tools model
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/BijectedAttributeType.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -11,10 +11,13 @@
package org.jboss.tools.seam.core;
/**
- * @author igels
+ * @author Alexey Kazakov
*
*/
public enum BijectedAttributeType {
IN,
- OUT
+ OUT,
+ Databinder,
+ DataModelSelection,
+ DataModelSelectionIndex
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IBijectedAttribute.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IBijectedAttribute.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IBijectedAttribute.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -13,7 +13,7 @@
import org.eclipse.jdt.core.IMember;
/**
- * @author igels
+ * @author Alexey Kazakov
*/
public interface IBijectedAttribute {
@@ -23,6 +23,12 @@
public String getName();
/**
+ * Sets name
+ * @param name
+ */
+ public void setName(String name);
+
+ /**
* @return type
*/
public BijectedAttributeType getType();
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IRole.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IRole.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IRole.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,54 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IRole {
+
+ /**
+ * @return Name
+ */
+ public String getName();
+
+ /**
+ * Sets name
+ */
+ public void setName(String name);
+
+ /**
+ * @return scope type
+ */
+ public ScopeType getScope();
+
+ /**
+ * Sets scope type
+ */
+ public void setScope(ScopeType type);
+
+ /**
+ * @return source file
+ */
+ public IFile getSourceFile();
+
+ /**
+ * @return start position in source file
+ */
+ public int getStartPosition();
+
+ /**
+ * @return length role definition in source file.
+ */
+ public int getLength();
+}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,24 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+import org.eclipse.jdt.core.IMethod;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ISeamAnnotatedFactory extends ISeamFactory {
+
+ /**
+ * @return source IMethod
+ */
+ public IMethod getSourceMethod();
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -23,16 +23,34 @@
public String getName();
/**
+ * Sets name
+ * @param name
+ */
+ public void setName(String name);
+
+ /**
* @return qualified Class name of component
*/
public String getClassName();
/**
+ * Sets qualified Class name of component
+ * @param className
+ */
+ public void setClassName(String className);
+
+ /**
* @return scope type
*/
public ScopeType getScope();
/**
+ * Sets scope type
+ * @param type
+ */
+ public void setScope(ScopeType type);
+
+ /**
* @return bijected attributes
*/
public Set<IBijectedAttribute> getBijectedAttributes();
@@ -43,6 +61,11 @@
public void addBijectedAttribute(IBijectedAttribute attribute);
/**
+ * Removes bijected attribute
+ */
+ public void removeBijectedAttribute(IBijectedAttribute attribute);
+
+ /**
* Returns bijected attributes by name
* @param name
* @return
@@ -77,6 +100,12 @@
public void addProperty(ISeamProperty<? extends Object> property);
/**
+ * Removes property from component.
+ * @param property
+ */
+ public void removeProperty(ISeamProperty<? extends Object> property);
+
+ /**
* @return Set of Java source classes
*/
public Set<IType> getJavaSourceClasses();
@@ -87,9 +116,99 @@
public void addJavaSourceClass(IType sourceClass);
/**
+ * @param sourceClass
+ */
+ public void removeJavaSourceClass(IType sourceClass);
+
+ /**
* @return Set of source xml elements
*/
public Set<ISeamXmlElement> getXmlSourceElements();
- // TODO add @Rules @Factory ...
+ /**
+ * @param element
+ */
+ public void addmlSourceElement(ISeamXmlElement element);
+
+ /**
+ * @param element
+ */
+ public void removemlSourceElement(ISeamXmlElement element);
+
+ /**
+ * @return true if component marked as Stateful
+ */
+ public boolean isStateful();
+
+ /**
+ * Set true if component marked as Stateful
+ */
+ public void setStateful(boolean stateful);
+
+ /**
+ * @return true if component marked as Entity
+ */
+ public boolean isEntity();
+
+ /**
+ * Set true if component marked as Entity
+ */
+ public void setEntity(boolean entity);
+
+ /**
+ * @return roles of component
+ */
+ public Set<IRole> getRoles();
+
+ /**
+ * Adds role to component
+ * @param role
+ */
+ public void addRole(IRole role);
+
+ /**
+ * Removes role from component
+ * @param role
+ */
+ public void removeRole(IRole role);
+
+ /**
+ * @return methods of component
+ */
+ public Set<ISeamComponentMethod> getMethods();
+
+ /**
+ * @param type
+ * @return return methods by type
+ */
+ public Set<ISeamComponentMethod> getMethodsByType(SeamComponentMethodType type);
+
+ /**
+ * Adds method to component
+ * @param method
+ */
+ public void addMethod(ISeamComponentMethod method);
+
+ /**
+ * Removes method from component
+ * @param method
+ */
+ public void removeMethod(ISeamComponentMethod method);
+
+ /**
+ * @return Factories methods and xml elements of component
+ */
+ public Set<ISeamFactory> getFactories();
+
+ /**
+ * Adds factory method or xml element
+ * @param factory
+ */
+ public void addFactory(ISeamFactory factory);
+
+ /**
+ * Remove factory method or xml element
+ * @param factory
+ */
+ public void removeFactory(ISeamFactory factory);
}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentMethod.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentMethod.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentMethod.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,29 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+import org.eclipse.jdt.core.IMethod;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ISeamComponentMethod {
+
+ /**
+ * @return method type
+ */
+ public SeamComponentMethodType getType();
+
+ /**
+ * @return source IMethod
+ */
+ public IMethod getSourceMethod();
+}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamFactory.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamFactory.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,39 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ISeamFactory {
+
+ /**
+ * @return name
+ */
+ public String getName();
+
+ /**
+ * Sets name
+ * @param name
+ */
+ public void setName(String name);
+
+ /**
+ * @return Scope type
+ */
+ public ScopeType getScope();
+
+ /**
+ * Sets scope type
+ * @param type
+ */
+ public void setScope(ScopeType type);
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -46,4 +46,16 @@
* @return Set of ISeamComponents
*/
public Set<ISeamComponent> getComponents();
+
+ /**
+ * Adds component into project
+ * @param component
+ */
+ public void addComponent(ISeamComponent component);
+
+ /**
+ * Removes component from project
+ * @param component
+ */
+ public void removeComponent(ISeamComponent component);
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlElement.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlElement.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlElement.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -13,7 +13,7 @@
import org.eclipse.core.resources.IFile;
/**
- * @author igels
+ * @author Alexey Kazakov
* TODO should we use WTP's stuff instead?
*/
public interface ISeamXmlElement {
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,39 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ISeamXmlFactory extends ISeamFactory, ISeamXmlElement {
+
+ /**
+ * @return value
+ */
+ public String getValue();
+
+ /**
+ * Sets value
+ * @param value
+ */
+ public void setValue(String value);
+
+ /**
+ * @return method
+ */
+ public String getMethod();
+
+ /**
+ * Sets method
+ * @param method
+ */
+ public void setMethod(String method);
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -12,7 +12,7 @@
/**
* Types of Seam Scopes.
- * @author igels
+ * @author Alexey Kazakov
*/
public enum ScopeType {
STATELESS,
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentMethodType.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -0,0 +1,19 @@
+ /*******************************************************************************
+ * 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.core;
+
+/**
+ * @author Alexey Kazakov
+ */
+public enum SeamComponentMethodType {
+ Create,
+ Destroy
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -19,10 +19,14 @@
import org.eclipse.jdt.core.IType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
+import org.jboss.tools.seam.core.IRole;
import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamComponentMethod;
+import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamProperty;
import org.jboss.tools.seam.core.ISeamXmlElement;
import org.jboss.tools.seam.core.ScopeType;
+import org.jboss.tools.seam.core.SeamComponentMethodType;
public class SeamComponent implements ISeamComponent {
protected Map<String,ISeamProperty<? extends Object>> properties = new HashMap<String, ISeamProperty<? extends Object>>();
@@ -187,4 +191,157 @@
// TODO Auto-generated method stub
return null;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#addFactory(org.jboss.tools.seam.core.ISeamFactory)
+ */
+ public void addFactory(ISeamFactory factory) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#addMethod(org.jboss.tools.seam.core.ISeamComponentMethod)
+ */
+ public void addMethod(ISeamComponentMethod method) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#addRole(org.jboss.tools.seam.core.IRole)
+ */
+ public void addRole(IRole role) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#addmlSourceElement(org.jboss.tools.seam.core.ISeamXmlElement)
+ */
+ public void addmlSourceElement(ISeamXmlElement element) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#getFactories()
+ */
+ public Set<ISeamFactory> getFactories() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#getMethods()
+ */
+ public Set<ISeamComponentMethod> getMethods() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#getMethodsByType(org.jboss.tools.seam.core.SeamComponentMethodType)
+ */
+ public Set<ISeamComponentMethod> getMethodsByType(
+ SeamComponentMethodType type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#getRoles()
+ */
+ public Set<IRole> getRoles() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#isEntity()
+ */
+ public boolean isEntity() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#isStateful()
+ */
+ public boolean isStateful() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeBijectedAttribute(org.jboss.tools.seam.core.IBijectedAttribute)
+ */
+ public void removeBijectedAttribute(IBijectedAttribute attribute) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeFactory(org.jboss.tools.seam.core.ISeamFactory)
+ */
+ public void removeFactory(ISeamFactory factory) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeJavaSourceClass(org.eclipse.jdt.core.IType)
+ */
+ public void removeJavaSourceClass(IType sourceClass) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeMethod(org.jboss.tools.seam.core.ISeamComponentMethod)
+ */
+ public void removeMethod(ISeamComponentMethod method) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeProperty(org.jboss.tools.seam.core.ISeamProperty)
+ */
+ public void removeProperty(ISeamProperty<? extends Object> property) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removeRole(org.jboss.tools.seam.core.IRole)
+ */
+ public void removeRole(IRole role) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#removemlSourceElement(org.jboss.tools.seam.core.ISeamXmlElement)
+ */
+ public void removemlSourceElement(ISeamXmlElement element) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#setEntity(boolean)
+ */
+ public void setEntity(boolean entity) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamComponent#setStateful(boolean)
+ */
+ public void setStateful(boolean stateful) {
+ // TODO Auto-generated method stub
+
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-06-28 11:04:35 UTC (rev 2203)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-06-28 12:26:47 UTC (rev 2204)
@@ -132,4 +132,20 @@
// TODO Auto-generated method stub
return null;
}
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamProject#addComponent(org.jboss.tools.seam.core.ISeamComponent)
+ */
+ public void addComponent(ISeamComponent component) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamProject#removeComponent(org.jboss.tools.seam.core.ISeamComponent)
+ */
+ public void removeComponent(ISeamComponent component) {
+ // TODO Auto-generated method stub
+
+ }
}
\ No newline at end of file
17 years, 6 months
JBoss Tools SVN: r2203 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-06-28 07:04:35 -0400 (Thu, 28 Jun 2007)
New Revision: 2203
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
Log:
bug fixing(Exin 274), some code was adjusted
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-06-28 01:18:02 UTC (rev 2202)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2007-06-28 11:04:35 UTC (rev 2203)
@@ -51,6 +51,11 @@
import org.w3c.dom.Node;
import org.w3c.dom.Text;
+/**
+ * Class created for process key events in VPE editor
+ * @author Max Areshkau
+ *
+ */
public class VpeVisualKeyHandler {
public static final int VK_ENTER = 0x0D;
@@ -249,7 +254,7 @@
}
if (focusNode != null) {
if (focusNode.getNodeType() == Node.TEXT_NODE &&
- selection.getFocusOffset() < ((IndexedRegion)focusNode).getLength()) {
+ selection.getFocusOffset() < (((TextImpl)selection.getFocusNode()).getValueSource().length())) {
deleteRightChar(sourceSelectionBuilder, selection);
return true;
} else if ((focusNode.getNodeType() == Node.ELEMENT_NODE && selection.getFocusOffset() != 2)) {
@@ -350,8 +355,9 @@
}
}
- int offset = (focusNode == selection.getFocusNode() ? selection.getFocusOffset() : 0);
- int length = ((IndexedRegion)focusNode).getLength();
+ int offset = (focusNode == selection.getFocusNode() ? selection.getFocusOffset() : (((TextImpl)focusNode).getValueSource().length()));
+
+ int length = (((TextImpl)selection.getFocusNode()).getValueSource()).length();
if (length <= offset) {
break;
}
@@ -495,7 +501,7 @@
System.out.println(">>> 1. VpeVisualKeyHandler.deleteLeft(): focusNode = " + focusNode + " | focusOffset = " + selection.getFocusOffset());
}
if (focusNode != null) {
- if (focusNode.getNodeType() == Node.TEXT_NODE && selection.getFocusOffset() > 0) {
+ if (focusNode.getNodeType() == Node.TEXT_NODE && selection.getFocusOffset() >= 0) {
deleteLeftChar(sourceSelectionBuilder, selection);
return true;
} else if (focusNode.getNodeType() == Node.TEXT_NODE && selection.getFocusOffset() == 0) {
@@ -677,8 +683,9 @@
}
}
- int offset = (focusNode == selection.getFocusNode() ? selection.getFocusOffset() : ((IndexedRegion)focusNode).getLength());
-
+ int offset = (focusNode == selection.getFocusNode() ? selection.getFocusOffset() : (((TextImpl)focusNode).getValueSource().length()));
+
+
if (offset == 0) {
break;
}
@@ -689,11 +696,13 @@
try {
String sourceText = sourceEditor.getTextViewer().getDocument().get(region.getStartOffset(), region.getEndOffset()-region.getStartOffset());
String escString = TextUtil.isEcsToLeft(sourceText,offset);
+
if(escString != null){
Point range = sourceEditor.getTextViewer().getSelectedRange();
sourceEditor.getTextViewer().getTextWidget().replaceTextRange(range.x-escString.length(), escString.length(), "");
+
atLeastOneCharIsDeleted = true;
- continue;
+ return selection;
}
} catch(Exception ex) {
VpePlugin.getPluginLog().logError(ex);
@@ -1320,17 +1329,23 @@
selection.getFocusNode().getNodeType() == Node.COMMENT_NODE) {
int so = ((IndexedRegion)selection.getFocusNode()).getStartOffset();
int eo = ((IndexedRegion)selection.getFocusNode()).getEndOffset();
- if (selection.getFocusOffset() >= ((IndexedRegion)selection.getFocusNode()).getLength()) {
+ if (selection.getFocusOffset() >= eo-so) {
return moveCursorToNextVisualNode(selection.getFocusNode());
}
int fo = selection.getFocusOffset();
- int diff = 0;
char[] chars = ((TextImpl)selection.getFocusNode()).getValueSource().toCharArray();
+
+ String sourceValue=((TextImpl)selection.getFocusNode()).getValueSource();
+ String nodeValue=selection.getFocusNode().getNodeValue();
+
+ int visualOffser=TextUtil.visualPosition(sourceValue, fo);
+ int sourseOffset=TextUtil.sourcePosition(sourceValue, nodeValue, visualOffser+1);
+ int diff = sourseOffset-fo;
+
while ((fo + diff < chars.length) && isTextToSkip(chars, fo + diff)) {
diff++;
}
- diff++;
- if (fo + diff > chars.length) {
+ if (fo + diff > chars.length||diff==0) {
return moveCursorToNextVisualNode(selection.getFocusNode());
}
setSourceFocus(so + fo + diff);
@@ -1346,12 +1361,15 @@
return false;
}
+ //moves selection to left
private boolean moveLeft() {
+
VpeSourceSelectionBuilder sourceSelectionBuilder = new VpeSourceSelectionBuilder(sourceEditor);
VpeSourceSelection selection = sourceSelectionBuilder.getSelection();
- if (selection == null || selection.getFocusNode() == null)
+ if (selection == null || selection.getFocusNode() == null) {
+
return false;
-
+ }
// We're in the visible attribute
if (selection.getFocusAttribute() != null) {
if (isVisualEditableForNode(selection.getFocusNode())) {
@@ -1377,28 +1395,42 @@
selection.getFocusNode().getNodeType() == Node.COMMENT_NODE) {
int so = ((IndexedRegion)selection.getFocusNode()).getStartOffset();
int eo = ((IndexedRegion)selection.getFocusNode()).getEndOffset();
+
if (selection.getFocusOffset() <= 0) {
+
return moveCursorToPrevVisualNode(selection.getFocusNode());
}
int fo = selection.getFocusOffset();
- int diff = -1;
+
+
+
char[] chars = ((TextImpl)selection.getFocusNode()).getValueSource().toCharArray();
- while ((fo + diff >= 0) && isTextToSkip(chars, fo + diff)) {
+ String sourceValue=((TextImpl)selection.getFocusNode()).getValueSource();
+ String nodeValue=selection.getFocusNode().getNodeValue();
+
+ int visualOffser=TextUtil.visualPosition(sourceValue, fo);
+ int sourseOffset=TextUtil.sourcePosition(sourceValue, nodeValue, visualOffser-1);
+ int diff = sourseOffset-fo;
+
+ while ((fo + diff > 0) && isTextToSkip(chars, fo + diff)) {
diff--;
}
- if (fo + diff < 0) {
+ if (fo + diff < 0||diff==0) {
+
return moveCursorToPrevVisualNode(selection.getFocusNode());
}
+
setSourceFocus(so + fo + diff);
return true;
} else if (selection.getFocusNode().getNodeType() == Node.ELEMENT_NODE) {
// Move to second position of the visual attribute (because we're placed
// either before first char of visual attribute or not in visual attribute
// but still in the beginning of the element
+
return moveCursorToPrevVisualNode(selection.getFocusNode());
}
}
-
+
return false;
}
17 years, 6 months