Author: dgolovin
Date: 2008-08-28 20:21:46 -0400 (Thu, 28 Aug 2008)
New Revision: 9949
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormRuntimeException.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbConnectorFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/AddNatureActionDelegate.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBar.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBarListener.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/AdapterFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckBoxFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaChoicerFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaEclipseChoicerFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderCellEditorEx.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/TableStructuredFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/DefaultEditorPart.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectJarEntryEditorInput.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/AbsoluteFilePathAttributeValueLoader.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/ElementGeneratorFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/JSPTagProposalFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagProposalsComposite.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormContainer.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/GreedyLayoutDataFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/InfoLayoutDataFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayouredFormFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayoutDataFactory.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/FilteredTreeContentProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/TreeViewerModelListenerImpl.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/PropertiesWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/outline/XModelObjectContentProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ProblemReporter.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/TemplatesConfiguration.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaConfigurationLoader.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/ExtensionPointUtils.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorContentProvider.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorMenuInvoker.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/TextAndReferenceComponent.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileContext.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizardView.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardStep.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/BundleEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesCompoundEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/text/PropertyTextEditorSupport.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/CommonPlugin.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/ProblemReportingHelper.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/Submit.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/util/ResourcesUtils.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddJSFNatureActionDelegate.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/RunPageActionDelegate.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/SaveProjectAsTemplateActionDelegate.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportAction.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlinkPartitioner.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/ScopePresentationActionProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/LinkFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-351
Fix for exceptions handling.
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/CommonPlugin.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/CommonPlugin.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/CommonPlugin.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -18,7 +18,6 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
import org.jboss.tools.common.log.BasePlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.osgi.framework.Bundle;
Added:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common;
+
+/**
+ * @author eskimo
+ *
+ */
+public class MethodNotImplementedException extends RuntimeException {
+
+ public MethodNotImplementedException() {
+ super("Method is not implemented yet");
+ }
+
+ public MethodNotImplementedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public MethodNotImplementedException(String message) {
+ super(message);
+ }
+
+ public MethodNotImplementedException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/MethodNotImplementedException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/ProblemReportingHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/ProblemReportingHelper.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/ProblemReportingHelper.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,7 +12,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.jboss.tools.common.CommonPlugin;
/**
* Helper class for processing all exceptions caught in Red Hat code.
@@ -52,11 +51,7 @@
return;
}
IProblemReporter reporter = ProblemReporterFactory.getInstance().getProblemReporter();
- try {
- reporter.reportProblem(status);
- } catch (Exception t) {
- CommonPlugin.getPluginLog().logError("Failed to call custom reporter.", t);
- }
+ reporter.reportProblem(status);
}
public static final ProblemBuffer buffer = new ProblemBuffer();
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/Submit.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/Submit.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/reporting/Submit.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,13 +10,14 @@
******************************************************************************/
package org.jboss.tools.common.reporting;
+import java.io.IOException;
+
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-
import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.util.HttpUtil;
@@ -55,7 +56,7 @@
public IStatus run(IProgressMonitor monitor) {
try {
submitReport(reportText);
- } catch (Exception e) {
+ } catch (IOException e) {
String exceptionMessage = e.getMessage();
String message = ERROR_MESSAGE;
if(exceptionMessage!=null && exceptionMessage.trim().length()>0) {
@@ -74,7 +75,7 @@
job.schedule();
}
- private int submitReport(String reportText) throws Exception {
+ private int submitReport(String reportText) throws IOException {
HttpClient httpClient = HttpUtil.createHttpClient(URL);
PostMethod httpPost = new PostMethod(URL);
httpPost.addParameter(REPORT_DESRIPTION_PARAMETER_NAME, reportText);
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 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,9 +10,34 @@
******************************************************************************/
package org.jboss.tools.common.util;
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
@@ -345,11 +370,11 @@
}
}
- public static void jar(File[] fs, String path) throws Exception {
+ public static void jar(File[] fs, String path) throws IOException {
jar(fs, path, null);
}
- public static void jar(File[] fs, String path, Manifest mf) throws Exception {
+ public static void jar(File[] fs, String path, Manifest mf) throws IOException {
File f = new File(path);
FileOutputStream fos = new FileOutputStream(f);
JarOutputStream jos = mf == null ? new JarOutputStream(fos) : new
JarOutputStream(fos, mf);
@@ -361,13 +386,13 @@
}
}
- public static void add(File root, File f, JarOutputStream jos) throws Exception {
+ public static void add(File root, File f, JarOutputStream jos) throws IOException {
int l = root.getAbsolutePath().length();
String en = f.getAbsolutePath().substring(l + 1).replace('\\',
'/');
add(f, en, jos);
}
- public static void add(File f, String name, JarOutputStream jos) throws Exception {
+ public static void add(File f, String name, JarOutputStream jos) throws IOException
{
String en = name;
if(f.isDirectory()) en += "/";
JarEntry entry = (en.endsWith("/")) ? null : new JarEntry(en);
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/ResourcesUtils.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -24,12 +24,8 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.dialogs.IOverwriteQuery;
import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbConnectorFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbConnectorFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbConnectorFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -76,7 +76,7 @@
* @throws IllegalAccessException
* @throws ClassNotFoundException
*/
- public KbConnector createConnector(KbConnectorType type, Object key) throws
InstantiationException, IllegalAccessException, ClassNotFoundException {
+ public KbConnector createConnector(KbConnectorType type, Object key) throws
KbException{
Object realKey = key;
if(type.isSingleton()) {
Object o = connectorInstances.get(type.toString());
@@ -90,9 +90,17 @@
if(o!=null) {
return (KbConnector)o;
}
- Object newInstance = type.getConnectorClass().newInstance();
- connectorInstances.put(realKey, newInstance);
- return (KbConnector) newInstance;
+
+ try {
+ Object newInstance = newInstance = type.getConnectorClass().newInstance();
+ connectorInstances.put(realKey, newInstance);
+ return (KbConnector) newInstance;
+ } catch (InstantiationException e) {
+ throw new KbException(e);
+ } catch (IllegalAccessException e) {
+ throw new KbException(e);
+ }
+
}
public void removeConnector(KbConnectorType type, Object key) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,21 +11,22 @@
package org.jboss.tools.common.model.util.extension;
import org.eclipse.core.runtime.*;
+import org.jboss.tools.common.model.XModelException;
public class ExtensionPointUtil {
- public static Object findClassByElementId(String pointId, String id) throws
CoreException, IllegalArgumentException {
+ public static Object findClassByElementId(String pointId, String id) throws
CoreException {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pointId);
return findClassByElementId(point, id);
}
- public static Object findClassByElementId(IExtensionPoint point, String id) throws
CoreException, IllegalArgumentException {
+ public static Object findClassByElementId(IExtensionPoint point, String id) throws
CoreException {
IConfigurationElement element = getElementById(point, id);
if(element == null)
- throw new IllegalArgumentException("Configuration element with id=" + id +
" is not found");
+ throw new XModelException("Configuration element with id=" + id + " is
not found");
String className = element.getAttribute("class");
if(className == null || className.length() == 0)
- throw new IllegalArgumentException("Configuration element with id=" + id +
" does not define 'class' attribute");
+ throw new XModelException("Configuration element with id=" + id + "
does not define 'class' attribute");
return element.createExecutableExtension("class");
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/AddNatureActionDelegate.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/AddNatureActionDelegate.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/AddNatureActionDelegate.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,22 +10,23 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.action;
-import java.io.*;
+import java.io.File;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.actions.RefreshAction;
-
import org.jboss.tools.common.model.ui.ModelUIPlugin;
public abstract class AddNatureActionDelegate implements IObjectActionDelegate,
IWorkbenchWindowActionDelegate {
@@ -43,14 +44,10 @@
}
return;
}
- try {
- doRun();
- } catch(Exception ex) {
- ModelUIPlugin.getPluginLog().logError(ex);
- }
+ doRun();
}
- protected void doRun() throws Exception {
+ protected void doRun() {
if(project == null) return;
RefreshAction refreshAction = new
RefreshAction(ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell());
refreshAction.selectionChanged(new StructuredSelection(project));
@@ -61,7 +58,7 @@
dialog.open();
}
- protected abstract IWizard getWizard(IProject project) throws Exception;
+ protected abstract IWizard getWizard(IProject project);
protected abstract String getNatureID();
public void selectionChanged(IAction action, ISelection selection) {
@@ -80,7 +77,7 @@
try {
if (!project.isOpen() || project.hasNature(getNatureID()))
project = null;
- } catch (Exception ex) {
+ } catch (CoreException ex) {
project = null;
ModelUIPlugin.getPluginLog().logError(ex);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBar.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBar.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBar.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -16,6 +16,8 @@
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.graphics.*;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
public class CommandBar {
@@ -274,7 +276,13 @@
}
public void widgetSelected(SelectionEvent e) {
- if(listener != null) listener.action(command);
+ if(listener != null) {
+ try {
+ listener.action(command);
+ } catch (XModelException e1) {
+ ModelUIPlugin.getPluginLog().logError(e1);
+ }
+ }
}
public void widgetDefaultSelected(SelectionEvent e) {}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBarListener.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBarListener.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/CommandBarListener.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.action;
+import org.jboss.tools.common.model.XModelException;
+
public interface CommandBarListener {
- public void action(String command);
+ public void action(String command) throws XModelException;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/AdapterFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/AdapterFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/AdapterFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -39,12 +39,15 @@
}
public static IModelPropertyEditorAdapter getAdapter(XAttribute attribute, XModelObject
modelObject, XAttributeData attributeData, XModel model) {
- IModelPropertyEditorAdapter adapter;
- try {
- adapter = (IModelPropertyEditorAdapter)getAdapterClass(attribute).newInstance();
- } catch (Exception e) {
- adapter = new DefaultValueAdapter();
- }
+ IModelPropertyEditorAdapter adapter = new DefaultValueAdapter();;
+ try {
+ adapter = (IModelPropertyEditorAdapter)getAdapterClass(attribute).newInstance();
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
+
if (model == null && modelObject != null) model = modelObject.getModel();
adapter.setModel(model);
adapter.setAttribute(attribute);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/adapter/DefaultXAttributeTreeContentProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -104,11 +104,7 @@
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- try {
- viewer.refresh();
- } catch (Exception e) {
- ignore();
- }
+ viewer.refresh();
}
void ignore() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckBoxFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckBoxFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/CheckBoxFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,8 +13,6 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import org.jboss.tools.common.model.ui.IValueChangeListener;
-import org.jboss.tools.common.model.ui.IValueProvider;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@@ -26,7 +24,9 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
-
+import org.jboss.tools.common.MethodNotImplementedException;
+import org.jboss.tools.common.model.ui.IValueChangeListener;
+import org.jboss.tools.common.model.ui.IValueProvider;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
public class CheckBoxFieldEditor extends ExtendedFieldEditor implements IFieldEditor,
IPropertyFieldEditor, IPropertyChangeListener, PropertyChangeListener {
@@ -58,6 +58,7 @@
if (style == SKIP_LABEL) numColumns--;
((GridData)checkBox.getLayoutData()).horizontalSpan = numColumns;
}
+
protected void doFillIntoGrid(Composite parent, int numColumns) {
String text = getLabelText();
if (style == SKIP_LABEL) {
@@ -76,20 +77,25 @@
checkBox.setLayoutData(gd);
if (text != null) checkBox.setText(text);
}
+
protected Control createCheckBoxLabelControl (Composite parent) {
Button checkBox = createChangeControl(parent);
if (getLabelText() != null) checkBox.setText(getLabelText());
return checkBox;
}
+
protected void doLoad() {
- throw new RuntimeException("Not implemented");
+ throw new MethodNotImplementedException();
}
+
protected void doLoadDefault() {
- throw new RuntimeException("Not implemented");
+ throw new MethodNotImplementedException();
}
+
protected void doStore() {
// getPreferenceStore().setValue(getPreferenceName(), checkBox.getSelection());
}
+
protected Button createChangeControl(Composite parent) {
if (checkBox != null) {
checkParent(checkBox, parent);
@@ -109,6 +115,7 @@
checkBox.setSelection(booleanValue);
return checkBox;
}
+
private void createSelectionListener() {
checkBox.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -118,6 +125,7 @@
}
});
}
+
private void createDisposeListener() {
checkBox.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
@@ -125,14 +133,17 @@
}
});
}
+
public int getNumberOfControls() {
return (style == SKIP_LABEL || style == SEPARATE_LABEL) ? 2 : 1;
}
+
public void setFocus() {
if (checkBox != null) {
checkBox.setFocus();
}
}
+
public void setLabelText(String text) {
super.setLabelText(text);
Control label = getLabelComposite();
@@ -140,6 +151,7 @@
checkBox.setText(text);
}
}
+
protected void valueChanged(boolean oldValue, boolean newValue) {
setPresentsDefaultValue(false);
if (oldValue != newValue)
@@ -169,6 +181,7 @@
}
}
}
+
public boolean getBooleanValue() {
if (checkBox != null)
return checkBox.getSelection();
@@ -179,6 +192,7 @@
public int getStyle() {
return style;
}
+
public void setStyle(int style) {
this.style = style;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaAdapter.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,8 +12,15 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IElementChangedListener;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.templates.configuration.MetaClassTemplateHelper;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -52,7 +59,7 @@
try {
javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
} catch (CoreException e) {
- ModelUIPlugin.getPluginLog().logError("Cannot find Java Project
Nature.", new Exception());
+ ModelUIPlugin.getPluginLog().logError("Cannot find Java Project
Nature.", e);
return null;
}
IResource r = EclipseResourceUtil.getJavaSourceRoot(project);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaChoicerFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaChoicerFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaChoicerFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -16,15 +16,6 @@
import java.util.List;
import java.util.StringTokenizer;
-import org.jboss.tools.common.meta.XAttribute;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.ui.IValueChangeListener;
-import org.jboss.tools.common.model.ui.IValueEditor;
-import org.jboss.tools.common.model.ui.IValueProvider;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.attribute.IPropertyDescriptorEx;
-import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
-import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -45,17 +36,22 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
+import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.IValueChangeListener;
+import org.jboss.tools.common.model.ui.IValueEditor;
+import org.jboss.tools.common.model.ui.IValueProvider;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.attribute.IPropertyDescriptorEx;
+import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
+import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
+import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
import org.jboss.tools.common.model.util.AccessibleClasses;
-//import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.common.model.util.AccessibleJava;
import org.jboss.tools.common.model.util.ISimpleTree;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.model.util.ModelImages;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
-import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
public class JavaChoicerFieldEditor extends ExtendedFieldEditor implements IFieldEditor,
IPropertyFieldEditor, IValueEditor, ModifyListener, ISelectionChangedListener {
protected IPropertyEditor propertyEditor;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaEclipseChoicerFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaEclipseChoicerFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaEclipseChoicerFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -19,17 +19,11 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.jboss.tools.common.model.ui.IValueChangeListener;
-import org.jboss.tools.common.model.ui.IValueProvider;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.core.search.TypeNameMatch;
@@ -41,8 +35,11 @@
import org.eclipse.swt.widgets.Control;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.ui.IValueChangeListener;
+import org.jboss.tools.common.model.ui.IValueProvider;
+import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class JavaEclipseChoicerFieldEditor extends ExtendedFieldEditor implements
IFieldEditor, IPropertyFieldEditor, PropertyChangeListener {
protected IPropertyEditor propertyEditor;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/JavaHyperlinkLineFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -18,20 +18,13 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.ui.IValueChangeListener;
-import org.jboss.tools.common.model.ui.IValueProvider;
-import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
-import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog;
import
org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.action.Action;
@@ -40,19 +33,23 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
-
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
-import org.jboss.tools.common.model.util.AccessibleJava;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.ModelFeatureFactory;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.ui.IValueChangeListener;
+import org.jboss.tools.common.model.ui.IValueProvider;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.attribute.adapter.DefaultValueAdapter;
+import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.jboss.tools.common.model.ui.templates.ControlContentAssistHelper;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
import org.jboss.tools.common.model.ui.wizards.NewClassWizard;
import org.jboss.tools.common.model.ui.wizards.NewTypeWizardAdapter;
+import org.jboss.tools.common.model.util.AccessibleJava;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
public class JavaHyperlinkLineFieldEditor extends StringButtonFieldEditorEx
implements JavaHyperlinkCueLabelProvider.JavaClassHolder {
@@ -266,17 +263,6 @@
return null;
}
- //Overrides to show standard dialog
-// protected String changePressed() {
-// IJavaSearchScope scope = project != null ? getScope(project.getName()) : null;
-// FilteredTypesSelectionDialog d = new
FilteredTypesSelectionDialog(getChangeControl().getShell(), false, null, scope,
0/*IJavaSearchConstants.CLASS + IJavaSearchConstants.INTERFACE*/);
-// d.create();
-// int q = d.open();
-// Object result = d.getFirstResult();
-// if(result instanceof String) return result.toString();
-// return null;
-// }
-
private IJavaSearchScope getScope(String javaProjectName) {
IJavaElement[] elements = new IJavaElement[0];
if(javaProjectName != null) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/PropertyEditorFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -15,6 +15,7 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XAttributeData;
import org.jboss.tools.common.meta.key.WizardKeys;
@@ -53,12 +54,16 @@
}
private static PropertyEditor createPropertyEditor(Object adapter, XAttribute attribute,
boolean required, IWidgetSettings settings) {
- PropertyEditor propertyEditor;
+ PropertyEditor propertyEditor=null;
try {
propertyEditor = (PropertyEditor)getEditorClass(attribute).newInstance();
propertyEditor.setSettings(settings);
- } catch (Exception e) {
+ } catch (IllegalAccessException e) {
ModelUIPlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
+ if (propertyEditor == null) {
propertyEditor = new StringEditor(settings);
}
String labelText = WizardKeys.getAttributeDisplayName(attribute, true);
@@ -84,14 +89,14 @@
private static Class<?> getEditorClass(String id) {
Class<?> c = classes.get(id);
if(c != null) return c;
+ c = StringEditor.class;
try {
c = ExtensionPointUtil.findClassByElementId(ATTRIBUTE_EDITOR_EXT_POINT,
id).getClass();
- } catch (Exception e) {
+ } catch (CoreException e) {
if(!defaultEditorIds.contains(id)) {
defaultEditorIds.add(id);
ModelUIPlugin.getPluginLog().logInfo("PropertyEditorFactory: Default editor used
for " + id);
- }
- c = StringEditor.class;
+ }
}
classes.put(id, c);
return c;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderCellEditorEx.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderCellEditorEx.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderCellEditorEx.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -69,7 +69,7 @@
if (intValue <= MAX_SLIDER_VALUE && intValue >= MIN_SLIDER_VALUE) {
slider.setSelection(intValue);
}
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
// Do nothing
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/SliderFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -71,7 +71,7 @@
*/
try {
intValue = Integer.parseInt(valueProvider.getStringValue(true));
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
// Do nothing
}
setPropertyChangeListener(this);
@@ -211,7 +211,7 @@
slider.addSelectionListener(selectionListener);
try {
intValue = Integer.parseInt(valueProvider.getStringValue(true).toString());
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
intValue = DEFAULT_SLIDER_VALUE;
}
@@ -259,7 +259,7 @@
if (null != sliderLabel) {
sliderLabel.setText(weightsString);
}
- } catch (Exception e) {
+ } catch ( NumberFormatException e) {
// Do nothing
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -31,6 +31,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.common.MethodNotImplementedException;
import org.jboss.tools.common.model.ui.widgets.BorderedControl;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
import org.jboss.tools.common.model.ui.widgets.ScrolledComposite;
@@ -110,11 +111,11 @@
}
protected void doLoad() {
- throw new RuntimeException("Not implemented");
+ throw new MethodNotImplementedException();
}
protected void doLoadDefault() {
- throw new RuntimeException("Not implemented");
+ throw new MethodNotImplementedException();
}
protected void doStore() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/TableStructuredFieldEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/TableStructuredFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/TableStructuredFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -254,11 +254,7 @@
}
});
}
- try {
- structureChanged(null);
- } catch (Exception e ) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ structureChanged(null);
}
return this.tableControl;
@@ -341,15 +337,11 @@
if(table == null || table.isDisposed()) return;
int i = table.getSelectionIndex();
if(i < 0) i = 0;
- try {
- tableViewer.refresh();
- int c = tableViewer.getTable().getItemCount();
- while(i >= c) --i;
- if(i >= 0) {
- tableViewer.setSelection(new
StructuredSelection(tableViewer.getTable().getItem(i).getData()));
- }
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
+ tableViewer.refresh();
+ int c = tableViewer.getTable().getItemCount();
+ while(i >= c) --i;
+ if(i >= 0) {
+ tableViewer.setSelection(new
StructuredSelection(tableViewer.getTable().getItem(i).getData()));
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -22,6 +22,7 @@
import org.jboss.tools.common.meta.XAdoptManager;
import org.jboss.tools.common.model.event.*;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelTransferBuffer;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -335,7 +336,7 @@
}
} catch (ActionDeclinedException de) {
ignore();
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
}
@@ -367,21 +368,17 @@
}
public Widget findTreeItem (int x, int y) {
- try {
- Tree tree = (provider.getControl() instanceof Tree) ? (Tree)provider.getControl() :
null;
- Vector<TreeItem> items = getTreeExpandedItems(tree);
- for (int i = 0; i < items.size(); i++) {
- TreeItem item = items.get(i);
- Rectangle bounds = item.getBounds();
- Point p = tree.toDisplay(bounds.x, bounds.y);
-
- if (/*x >= p.x && x <= p.x + bounds.width &&*/
- y >= p.y && y <= p.y + bounds.height) {
- return item;
- }
- }
- } catch (Exception ex) {
- ModelUIPlugin.getPluginLog().logError("Error while looking for tree item at given
point", ex);
+ Tree tree = (provider.getControl() instanceof Tree) ? (Tree)provider.getControl() :
null;
+ Vector<TreeItem> items = getTreeExpandedItems(tree);
+ for (int i = 0; i < items.size(); i++) {
+ TreeItem item = items.get(i);
+ Rectangle bounds = item.getBounds();
+ Point p = tree.toDisplay(bounds.x, bounds.y);
+
+ if (/*x >= p.x && x <= p.x + bounds.width &&*/
+ y >= p.y && y <= p.y + bounds.height) {
+ return item;
+ }
}
return null;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/DnDUtil.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -88,7 +88,7 @@
copy.executeHandler(object, targets, p);
}
return true;
- } catch (Exception e) {
+ } catch (XModelException e) {
return false;
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/DefaultEditorPart.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/DefaultEditorPart.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/DefaultEditorPart.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -168,7 +168,7 @@
public void doOperation(int operation) {
if (operation>actionMapping.size()) {
- ModelUIPlugin.getPluginLog().logError(new RuntimeException("Can not find global
action with index: "+operation));
+ ModelUIPlugin.getPluginLog().logError(new IllegalArgumentException("Can not find
global action with index: "+operation));
} else {
String globalAction = (String)actionMapping.get(operation);
this.doGlobalAction(globalAction);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,7 @@
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.ui.IEditorActionBarContributor;
import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class EditorPartFactory {
IConfigurationElement element;
@@ -20,7 +21,7 @@
Class editorClass;
Class contributorClass;
- EditorPartFactory(IConfigurationElement element, Class editorClass, Class
contributorClass) throws Exception {
+ EditorPartFactory(IConfigurationElement element, Class editorClass, Class
contributorClass) throws InstantiationException, IllegalAccessException {
this.element = element;
this.editorClass = editorClass;
this.contributorClass = contributorClass;
@@ -34,19 +35,27 @@
}
public IEditorPart createEditorPart() {
- try {
- return (IEditorPart)editorClass.newInstance();
- } catch (Exception e) {
- return null;
- }
+ IEditorPart part = null;
+ try {
+ part = (IEditorPart)editorClass.newInstance();
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
+ return part;
}
public IEditorActionBarContributor createEditorActionBarContributor() {
+ IEditorActionBarContributor contributor = null;
try {
- return (IEditorActionBarContributor)contributorClass.newInstance();
- } catch (Exception e) {
- return null;
+ contributor = (IEditorActionBarContributor)contributorClass.newInstance();
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
+ return contributor;
}
public IConfigurationElement getConfigurationElement() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapper.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -94,13 +94,8 @@
EditorPartWrapperExtension extension = EditorPartWrapperExtension.getInstance();
EditorPartFactory f = extension.getFactory(entity);
editor = f.createEditorPart();
-//// if(editor == null) editor = new XmlEditor();
if(editor != null) {
- try {
((WorkbenchPart)editor).setInitializationData(f.getConfigurationElement(),
"", null);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
}
editor.init(site, input);
setSite(site);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,12 +10,17 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.editor;
-import java.util.*;
-import org.eclipse.core.runtime.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.part.EditorActionBarContributor;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.osgi.framework.Bundle;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class EditorPartWrapperExtension {
static String POINT_ID = "org.jboss.tools.common.model.ui.xmlEditor";
@@ -50,13 +55,13 @@
if(priorityString != null && priorityString.length() > 0) {
priority = Integer.parseInt(priorityString);
}
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
ModelUIPlugin.getPluginLog().logError("Incorrect priority value " +
priorityString + ".");
}
Class editorClass = null;
try {
editorClass = bundle.loadClass(editor);
- } catch (Exception e) {
+ } catch (ClassNotFoundException e) {
if(ModelUIPlugin.getDefault().isDebugging()) {
ModelUIPlugin.getPluginLog().logError("Cannot load editor class " +
editor + " from " + es[i].getNamespaceIdentifier(), e);
}
@@ -66,7 +71,7 @@
Class contributorClass = null;
try {
contributorClass = bundle.loadClass(contributor);
- } catch (Exception e) {
+ } catch (ClassNotFoundException e) {
if(ModelUIPlugin.getDefault().isDebugging()) {
String message = "Cannot load contributor class " + contributor;
ModelUIPlugin.getPluginLog().logError( message, e);
@@ -77,14 +82,10 @@
EditorPartFactory f = null;
try {
f = new EditorPartFactory(cs[j], editorClass, contributorClass);
- } catch (ClassCastException e) {
- if(ModelUIPlugin.getDefault().isDebugging()) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
- continue;
- } catch (Exception e) {
+ } catch (InstantiationException e) {
ModelUIPlugin.getPluginLog().logError(e);
- continue;
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
StringTokenizer st = new StringTokenizer(entities, ",;");
while(st.hasMoreTokens()) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectJarEntryEditorInput.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectJarEntryEditorInput.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/ModelObjectJarEntryEditorInput.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,9 +11,10 @@
package org.jboss.tools.common.model.ui.editor;
import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IStorageEditorInput;
-
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class ModelObjectJarEntryEditorInput extends ModelObjectStorageEditorInput {
String jarFile;
@@ -39,8 +40,8 @@
IStorage storage = null;
try {
storage = input.getStorage();
- } catch (Exception e) {
- //ignore
+ } catch (CoreException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
String s = (storage == null) ? "" : storage.toString();
if(jarEntryFileToString().equals(s)) return true;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/AbsoluteFilePathAttributeValueLoader.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/AbsoluteFilePathAttributeValueLoader.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/AbsoluteFilePathAttributeValueLoader.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,14 +11,16 @@
package org.jboss.tools.common.model.ui.editors.dnd;
import java.util.Properties;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.eclipse.ui.IFileEditorInput;
import org.jboss.tools.common.model.XModelBuffer;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class AbsoluteFilePathAttributeValueLoader implements IAttributeValueLoader {
@@ -75,7 +77,7 @@
DnDUtil.paste(t, p);
return p.getProperty("start text");
- } catch (Exception e) {
+ } catch (XModelException e) {
return null;
} finally {
b.clear();
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropCommandFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,7 +12,6 @@
import java.util.HashMap;
-import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
/**
@@ -95,14 +94,18 @@
* @return the drop command
*/
public IDropCommand getDropCommand(String mimeType, ITagProposalFactory
tagProposalFactory) {
- IDropCommand fInstance = null;
+ IDropCommand fInstance = UNKNOWN_MIME_COMMAND;
try {
String fClassName = (String)fMimeCommandMap.get(mimeType);
Class newClass = this.getClass().getClassLoader().loadClass(fClassName);
fInstance = (IDropCommand)newClass.newInstance();
fInstance.setTagProposalFactory(tagProposalFactory);
- } catch (Exception e) {
- return UNKNOWN_MIME_COMMAND;
+ } catch (ClassNotFoundException e) {
+ //ignore
+ } catch (InstantiationException e) {
+ //ignore
+ } catch (IllegalAccessException e) {
+ //ignore
}
return fInstance;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/DropUtils.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -23,23 +23,23 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
-
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.kb.AttributeDescriptor;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
+import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.KbTldResource;
import org.jboss.tools.common.kb.TagDescriptor;
import org.jboss.tools.common.kb.wtp.JspWtpKbConnector;
import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
+import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.common.model.ui.editors.dnd.composite.TagAttributesComposite;
import
org.jboss.tools.common.model.ui.editors.dnd.composite.TagAttributesComposite.AttributeDescriptorValue;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.tld.ITaglibMapping;
import org.jboss.tools.jst.web.tld.IWebProject;
import org.jboss.tools.jst.web.tld.WebProjectFactory;
@@ -61,28 +61,22 @@
*/
public static String getTldContent(IEditorInput input, String uri) {
String tldContent = null;
- try {
- XModel xModel = null;
- if(input instanceof IModelObjectEditorInput) {
- xModel = ((IModelObjectEditorInput)input).getXModelObject().getModel();
- } else if(input instanceof IFileEditorInput) {
- IFile f = ((IFileEditorInput)input).getFile();
- XModelObject o = EclipseResourceUtil.getObjectByResource(f);
- if(o != null) xModel = o.getModel();
+ XModel xModel = null;
+ if(input instanceof IModelObjectEditorInput) {
+ xModel = ((IModelObjectEditorInput)input).getXModelObject().getModel();
+ } else if(input instanceof IFileEditorInput) {
+ IFile f = ((IFileEditorInput)input).getFile();
+ XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ if(o != null) xModel = o.getModel();
+ }
+ if(xModel != null) {
+ ITaglibMapping mapping =
WebProjectFactory.instance.getWebProject(xModel).getTaglibMapping();
+ XModelObject xmo = mapping.getTaglibObject(uri);
+ if(xmo != null) {
+// tldLocation = EclipseResourceUtil.getResource(xmo).getFullPath().toString();
+ FileAnyImpl fai = (FileAnyImpl)xmo;
+ tldContent = fai.getAsText();
}
- if(xModel != null) {
- ITaglibMapping mapping =
WebProjectFactory.instance.getWebProject(xModel).getTaglibMapping();
- XModelObject xmo = mapping.getTaglibObject(uri);
- if(xmo != null) {
-// tldLocation = EclipseResourceUtil.getResource(xmo).getFullPath().toString();
- FileAnyImpl fai = (FileAnyImpl)xmo;
- tldContent = fai.getAsText();
- }
- }
- } catch (Exception ex) {
-// VpePlugin.reportProblem(ex);
- ModelUIPlugin.getPluginLog().logError(ex);
- // empty TLD content will be set
}
return tldContent;
}
@@ -121,10 +115,8 @@
if(tagInfo != null) {
attributes = tagInfo.getAttributesDescriptors();
}
- } catch (Exception ex) {
-// VpePlugin.reportProblem(ex);
+ } catch (KbException ex) {
ModelUIPlugin.getPluginLog().logError(ex);
- // empty array will be returned
}
if(attributes==null)return new AttributeDescriptorValue[0];
List<AttributeDescriptorValue> attributesValues = new
ArrayList<AttributeDescriptorValue>();
@@ -152,7 +144,7 @@
}
wtpKbConnector.registerResource(new KbTldResource(uri, "", tagPrefix,
version), true);
tagInfo =
wtpKbConnector.getTagInformation("/"+(tagPrefix==TagProposal.EMPTY_PREFIX?"":tagPrefix+":")+tagName);
- } catch (Exception ex) {
+ } catch (KbException ex) {
ModelUIPlugin.getPluginLog().logError(ex);
}
return tagInfo;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/ElementGeneratorFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/ElementGeneratorFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/ElementGeneratorFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,8 @@
import java.util.HashMap;
import java.util.Map;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+
public class ElementGeneratorFactory {
private static final ElementGeneratorFactory INSTANCE
@@ -37,12 +39,14 @@
}
public IElementGenerator getElementGenerator(String uri) {
- IElementGenerator fInstance = null;
+ IElementGenerator fInstance = DEFAULT_ELEMENT_GENERATOR;
try {
Class fClass = (Class)generatorMap.get(uri);
fInstance = (IElementGenerator)fClass.newInstance();
- } catch (Exception e) {
- return DEFAULT_ELEMENT_GENERATOR;
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
return fInstance;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/JSPTagProposalFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/JSPTagProposalFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/JSPTagProposalFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,8 @@
import java.util.HashMap;
import java.util.Map;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+
public class JSPTagProposalFactory implements ITagProposalFactory {
private static final JSPTagProposalFactory INSTANCE = new JSPTagProposalFactory();
public static Map<String,String> loaderMap = new HashMap<String,String>();
@@ -30,13 +32,17 @@
}
public ITagProposalLoader getProposalLoader(String mimeType) {
- ITagProposalLoader fInstance = null;
+ ITagProposalLoader fInstance = DEFAULT_PROPOSAL_LOADER;
try {
String fClassName = (String)loaderMap.get(mimeType);
Class newClass = this.getClass().getClassLoader().loadClass(fClassName);
fInstance = (ITagProposalLoader)newClass.newInstance();
- } catch (Exception e) {
- return DEFAULT_PROPOSAL_LOADER;
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (ClassNotFoundException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
return fInstance;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/PaletteDropCommand.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,8 @@
import java.util.Properties;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -57,16 +59,12 @@
}
protected void addCustomProperties(Properties runningProperties) {
- try {
- newLine = properties.getProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE);
- if (newLine == null) newLine="true";
- runningProperties.setProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE, newLine);
- String addTaglib = properties.getProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB);
- if(addTaglib == null) addTaglib = "true";
- runningProperties.setProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, addTaglib);
- } catch (Exception e){
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ newLine = properties.getProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE);
+ if (newLine == null) newLine="true";
+ runningProperties.setProperty(PaletteInsertHelper.PROPOPERTY_NEW_LINE, newLine);
+ String addTaglib = properties.getProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB);
+ if(addTaglib == null) addTaglib = "true";
+ runningProperties.setProperty(PaletteInsertHelper.PROPOPERTY_ADD_TAGLIB, addTaglib);
}
public void execute() {
@@ -102,7 +100,7 @@
text += "></"+container.getNodeName()+">";
document.replace(containerOffset+slashPosition,
containerString.length()-slashPosition, text);
}
- }catch(Exception ex){
+ }catch(BadLocationException ex){
ModelUIPlugin.getPluginLog().logError(ex);
}
}
@@ -173,7 +171,7 @@
properties.setProperty("new line", "newLine");
}
}
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
startText = properties.getProperty(TLDToPaletteHelper.START_TEXT);
@@ -308,11 +306,7 @@
IDropWizard wizard = null;
if(wizardName != null) {
- try {
- wizard =
(IDropWizard)PaletteInsertManager.getInstance().createWizardInstance(properties);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ wizard =
(IDropWizard)PaletteInsertManager.getInstance().createWizardInstance(properties);
}
if(wizard == null) wizard = new DropWizard();
wizard.setCommand(this);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagAttributesComposite.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,12 +12,23 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import java.util.*;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.objecteditor.ExtendedCellEditorProvider;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnPixelData;
+import org.eclipse.jface.viewers.ICellEditorListener;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IElementComparer;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -26,11 +37,15 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
import org.jboss.tools.common.kb.AttributeDescriptor;
import org.jboss.tools.common.kb.AttributeValueDescriptor;
import org.jboss.tools.common.model.ui.editors.dnd.IDropWizardModel;
+import org.jboss.tools.common.model.ui.objecteditor.ExtendedCellEditorProvider;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
/**
*
@@ -349,7 +364,7 @@
case ATTRIBUTE_VALUE_INDEX:
return attrDescr.getValue()==null?"":attrDescr.getValue().toString();
}
- throw new RuntimeException("Wrong column index for LabelProvider");
+ throw new IllegalArgumentException("Wrong column index for
LabelProvider");
}
public void addListener(ILabelProviderListener listener) {
@@ -372,14 +387,7 @@
private Properties context = new Properties();
private ExtendedCellEditorProvider createCellEditorProvider() {
- try {
- return
(ExtendedCellEditorProvider)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.jsp.outline.JSPCellEditorProviderImpl");
- } catch (Exception e) {
-// VpePlugin.reportProblem(e);
- ModelUIPlugin.getPluginLog().logError(e);
- }
-
- return null;
+ return
(ExtendedCellEditorProvider)ModelFeatureFactory.getInstance().createFeatureInstance("org.jboss.tools.jst.jsp.outline.JSPCellEditorProviderImpl");
}
/**
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagProposalsComposite.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagProposalsComposite.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/composite/TagProposalsComposite.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -26,10 +26,10 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
+import org.jboss.tools.common.model.ui.editors.dnd.IDropWizardModel;
+import org.jboss.tools.common.model.ui.editors.dnd.ITagProposalFactory;
+import org.jboss.tools.common.model.ui.editors.dnd.TagProposal;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.editors.dnd.*;
-
public class TagProposalsComposite extends Composite {
private TagProposal selection = IDropWizardModel.UNDEFINED_TAG_PROPOSAL;
@@ -90,21 +90,16 @@
tableTreeViewer.addCheckStateListener(
new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
- try {
- TagProposal proposal = (TagProposal) event.getElement();
- if (event.getChecked()) {
- if(selection!=IDropWizardModel.UNDEFINED_TAG_PROPOSAL) {
- tableTreeViewer.setChecked(selection, false);
- }
- selection = proposal;
- } else {
- selection = IDropWizardModel.UNDEFINED_TAG_PROPOSAL;
+ TagProposal proposal = (TagProposal) event.getElement();
+ if (event.getChecked()) {
+ if(selection!=IDropWizardModel.UNDEFINED_TAG_PROPOSAL) {
+ tableTreeViewer.setChecked(selection, false);
}
- fModel.setTagProposal(selection);
- } catch (Exception e) {
-// VpePlugin.reportProblem(e);
- ModelUIPlugin.getPluginLog().logError(e);
+ selection = proposal;
+ } else {
+ selection = IDropWizardModel.UNDEFINED_TAG_PROPOSAL;
}
+ fModel.setTagProposal(selection);
}
}
);
@@ -143,7 +138,7 @@
case TAG_URI_INDEX:
return prop.getUri();
}
- throw new RuntimeException("Wrong column index for LabelProvider");
+ throw new IllegalArgumentException("Wrong column index for
LabelProvider");
}
public void addListener(ILabelProviderListener listener) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -27,7 +27,6 @@
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.events.TypedEvent;
-import org.eclipse.wst.sse.ui.internal.TextDropAction;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelTransferBuffer;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
@@ -124,7 +123,7 @@
File f = new File(s[0]);
try {
return f.toURL().toString();
- } catch (Exception e) {
+ } catch (MalformedURLException e) {
return s[0];
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,13 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.forms;
-import java.util.*;
-import org.eclipse.core.runtime.Status;
-import org.jboss.tools.common.model.ui.action.CommandBar;
-import org.jboss.tools.common.model.ui.action.CommandBarListener;
-import org.jboss.tools.common.model.ui.objecteditor.XChildrenEditor;
-import org.jboss.tools.common.model.ui.objecteditor.XTable;
-import org.jboss.tools.common.model.ui.objecteditor.XTableProvider;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -24,17 +20,25 @@
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TableItem;
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.impl.AnyElementObjectImpl;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.forms.ExpandableForm;
-import org.jboss.tools.common.model.ui.widgets.*;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.objecteditor.XChildrenEditor;
+import org.jboss.tools.common.model.ui.objecteditor.XTable;
+import org.jboss.tools.common.model.ui.objecteditor.XTableProvider;
+import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
+import org.jboss.tools.common.model.ui.widgets.WhiteSettings;
public class AnyElementForm extends ExpandableForm {
private XModelObject xmo;
@@ -251,17 +255,13 @@
}
class CommandBarListenerImpl implements CommandBarListener {
- public void action(String command) {
+ public void action(String command) throws XModelException {
if(XChildrenEditor.ADD.equals(command)) {
add();
} else if(XChildrenEditor.EDIT.equals(command)) {
edit();
} else if(XChildrenEditor.DELETE.equals(command)) {
- try {
delete();
- } catch (XModelException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
}
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,18 +11,10 @@
package org.jboss.tools.common.model.ui.forms;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
-import org.eclipse.core.runtime.Status;
-import org.jboss.tools.common.editor.form.RightFormContainer;
-import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
-import
org.jboss.tools.common.model.ui.attribute.adapter.XChildrenTableStructuredAdapter;
-import org.jboss.tools.common.model.ui.attribute.editor.ExtendedFieldEditor;
-import org.jboss.tools.common.model.ui.attribute.editor.IFieldEditor;
-import org.jboss.tools.common.model.ui.attribute.editor.IPropertyEditor;
-import org.jboss.tools.common.model.ui.attribute.editor.IPropertyFieldEditor;
-import org.jboss.tools.common.model.ui.attribute.editor.TableStructuredEditor;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -30,12 +22,17 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
-
+import org.jboss.tools.common.editor.form.RightFormContainer;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.ModelUIMessages;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.forms.ExpandableForm;
-import org.jboss.tools.common.model.ui.forms.IFormContainer;
+import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
+import
org.jboss.tools.common.model.ui.attribute.adapter.XChildrenTableStructuredAdapter;
+import org.jboss.tools.common.model.ui.attribute.editor.ExtendedFieldEditor;
+import org.jboss.tools.common.model.ui.attribute.editor.IFieldEditor;
+import org.jboss.tools.common.model.ui.attribute.editor.IPropertyEditor;
+import org.jboss.tools.common.model.ui.attribute.editor.IPropertyFieldEditor;
+import org.jboss.tools.common.model.ui.attribute.editor.TableStructuredEditor;
import org.jboss.tools.common.model.ui.widgets.IWidgetSettings;
/**
@@ -134,9 +131,16 @@
((ExtendedFieldEditor)wraper).setEnabled(xmo.isAttributeEditable(attributes[i].getName()));
fieldEditors.add((ExtendedFieldEditor)wraper);
support.registerFieldEditor(editor.getAttributeName(),
(ExtendedFieldEditor)wraper);
- }
- catch (Exception e) {
+ } catch (ClassNotFoundException e) {
ModelUIPlugin.getPluginLog().logError(e);
+ } catch (NoSuchMethodException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
} else {
ExtendedFieldEditor fieldEditor =
(ExtendedFieldEditor)((IFieldEditor)editor.getFieldEditor(composite));
@@ -148,7 +152,7 @@
support.registerFieldEditor(editor.getAttributeName(),
(ExtendedFieldEditor)fieldEditor);
}
} else {
- ModelUIPlugin.getPluginLog().logInfo(
ModelUIMessages.getString(CANNOT_LOAD_ATTRIBUTE, new String[] {attributes[i].getName()}),
new Exception(ModelUIMessages.getString(CANNOT_LOAD_ATTRIBUTE, new String[]
{attributes[i].getName()})));
+ ModelUIPlugin.getPluginLog().logInfo(
ModelUIMessages.getString(CANNOT_LOAD_ATTRIBUTE, new String[]
{attributes[i].getName()}));
}
}
} else {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormContainer.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormContainer.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormContainer.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,10 +11,8 @@
package org.jboss.tools.common.model.ui.forms;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.ModelFeatureFactory;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.forms.DefaultFormContainer;
-import org.jboss.tools.common.model.ui.forms.IForm;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
/**
* @author Igels
@@ -66,7 +64,7 @@
child = xmo.getChildByPath(entity);
if(child == null) {
String message = "Cannot build child form '" +
forms[i].getEntityName() + "' for form '" + formData.getEntityName() +
"'.";
- Exception exc = new RuntimeException(message);
+ Exception exc = new FormRuntimeException(message);
ModelUIPlugin.getPluginLog().logError(exc);
} else {
this.get(i).initialize(child);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,9 +11,8 @@
package org.jboss.tools.common.model.ui.forms;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.forms.IForm;
/**
* @author Igels
@@ -42,8 +41,10 @@
IForm form = null;
try {
form = (IForm)formClass.newInstance();
- } catch(Exception e) {
+ } catch (InstantiationException e) {
ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
return form;
}
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormRuntimeException.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormRuntimeException.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormRuntimeException.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.model.ui.forms;
+
+/**
+ * @author eskimo
+ *
+ */
+public class FormRuntimeException extends RuntimeException {
+
+ public FormRuntimeException() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public FormRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public FormRuntimeException(String message) {
+ super(message);
+ }
+
+ public FormRuntimeException(Throwable cause) {
+ super(cause);
+ }
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormRuntimeException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/GreedyLayoutDataFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/GreedyLayoutDataFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/GreedyLayoutDataFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -31,6 +31,6 @@
} else if(type == AttributeControlType.EDITOR) {
return new GridData(GridData.FILL_BOTH);
}
- throw new RuntimeException("Attribute control type may be only Label or
Editor but this is " + type);
+ throw new FormRuntimeException("Attribute control type may be only Label or
Editor but this is " + type);
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/InfoLayoutDataFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/InfoLayoutDataFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/InfoLayoutDataFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -43,6 +43,6 @@
gd.heightHint = 60;
return gd;
}
- throw new RuntimeException("Attribute control type may be only Label or Editor but
this is " + type);
+ throw new FormRuntimeException("Attribute control type may be only Label or Editor
but this is " + type);
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayouredFormFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayouredFormFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayouredFormFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,10 +10,11 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.forms;
+import java.lang.reflect.InvocationTargetException;
+
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.util.ModelFeatureFactory;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.forms.IForm;
/**
* @author Igels
@@ -27,6 +28,7 @@
initialize();
}
+ // FIXME: Get rid of reflection
private void initialize() {
// String entityName = getXModelObject().getModelEntity().getName();
String formLayoutDataClassName = null;
@@ -34,8 +36,12 @@
Class formLayoutDataClass =
ModelFeatureFactory.getInstance().getFeatureClass(formLayoutDataClassName);
try {
formLayoutData =
(IFormLayoutData)formLayoutDataClass.getMethod("getInstance",
(Class[])null).invoke(null, (Object[])null);
- } catch(Exception e) {
+ } catch (IllegalAccessException e) {
ModelUIPlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (NoSuchMethodException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
}
@@ -43,20 +49,15 @@
public IForm getForm() {
IForm form = null;
- try {
- String entity = getXModelObject().getModelEntity().getName();
- IFormData formData = formLayoutData.getFormData(entity);
- if(formData == null) {
- String message = "Cannot find form for entity " + entity + ".";
- ModelUIPlugin.getPluginLog().logError(new Exception(message));
- } else if(formData.getForms() != null) {
- form = new FormContainer(formData);
- } else {
- form = new DefaultFormContainer(new Form(formData));
- }
- } catch(Exception e) {
- String message = "Cannot build form.";
- ModelUIPlugin.getPluginLog().logError( message, e);
+ String entity = getXModelObject().getModelEntity().getName();
+ IFormData formData = formLayoutData.getFormData(entity);
+ if(formData == null) {
+ String message = "Cannot find form for entity " + entity + ".";
+ ModelUIPlugin.getPluginLog().logError(message);
+ } else if(formData.getForms() != null) {
+ form = new FormContainer(formData);
+ } else {
+ form = new DefaultFormContainer(new Form(formData));
}
return form;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayoutDataFactory.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayoutDataFactory.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/LayoutDataFactory.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -38,6 +38,6 @@
} else if(type == AttributeControlType.EDITOR) {
return new GridData(GridData.FILL_HORIZONTAL);
}
- throw new RuntimeException("Attribute control type may be only Label or
Editor but this is " + type);
+ throw new FormRuntimeException("Attribute control type may be only Label or
Editor but this is " + type);
}
}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/FilteredTreeContentProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/FilteredTreeContentProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/FilteredTreeContentProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,8 +10,12 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.navigator;
-import org.eclipse.jface.viewers.*;
-import org.jboss.tools.common.model.*;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.tools.common.model.XFilteredTree;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class FilteredTreeContentProvider implements ITreeContentProvider {
@@ -42,8 +46,12 @@
String classname =
model.getMetaData().getMapping("FilteredTrees").getValue(filteredTreeName);
result =
(XFilteredTree)getClass().getClassLoader().loadClass(classname).newInstance();
result.setModel(model);
- } catch(Exception ex) {
- ModelUIPlugin.getPluginLog().logError(ex);
+ } catch (InstantiationException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (ClassNotFoundException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
}
}
return result;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/TreeViewerModelListenerImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/TreeViewerModelListenerImpl.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/navigator/TreeViewerModelListenerImpl.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,12 +10,17 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.navigator;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.jface.viewers.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.util.*;
-import org.jboss.tools.common.model.event.*;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.widgets.Control;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.event.XModelTreeEvent;
+import org.jboss.tools.common.model.event.XModelTreeListener;
+import org.jboss.tools.common.model.util.XModelObjectCache;
public class TreeViewerModelListenerImpl implements XModelTreeListener {
protected TreeViewer viewer;
@@ -61,26 +66,17 @@
XModelObject r = getRoot();
if(root != r) {
root = r;
- try { viewer.refresh(); } catch (Exception e) { /* ignore */}
+ viewer.refresh();
return;
}
XModelObject selected = getSelectedObject();
XModelObject refreshObject = event.getModelObject();
if(refreshObject != null) {
- try {
- if(isFileParent(refreshObject, r)) {
- viewer.refresh(r);
- } else {
- viewer.refresh(refreshObject);
- }
- } catch (Exception e) {
- if(reportRefreshProblemCount == 0) {
- reportRefreshProblemCount = 1;
- String message = "Cannot refresh tree for " +
refreshObject.getPresentationString();
- ModelUIPlugin.getPluginLog().logError( message, e);
- }
- return;
- }
+ if(isFileParent(refreshObject, r)) {
+ viewer.refresh(r);
+ } else {
+ viewer.refresh(refreshObject);
+ }
}
if(event.kind() == XModelTreeEvent.CHILD_ADDED) {
// XModelObject c = (XModelObject)event.getInfo();
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/ExtendedPropertiesWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,12 +12,14 @@
import java.util.Properties;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.wizards.query.*;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
public class ExtendedPropertiesWizard extends AbstractQueryWizard {
@@ -50,18 +52,14 @@
public void setObject(Object data) {
super.setObject(data);
- try {
- Properties p = findProperties(data);
- ExtendedProperties attributes =
(ExtendedProperties)p.get("extendedProperties");
- objectEditor.setExtendedProperties(attributes);
- boolean viewMode = p != null &&
"true".equals(p.getProperty("viewMode"));
- objectEditor.setReadOnly(viewMode);
- setWindowTitle("Attributes");
- String nodeName = attributes.getNodeName();
- setTitle((nodeName != null) ? "<" + nodeName + ">" :
"");
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ Properties p = findProperties(data);
+ ExtendedProperties attributes =
(ExtendedProperties)p.get("extendedProperties");
+ objectEditor.setExtendedProperties(attributes);
+ boolean viewMode = p != null &&
"true".equals(p.getProperty("viewMode"));
+ objectEditor.setReadOnly(viewMode);
+ setWindowTitle("Attributes");
+ String nodeName = attributes.getNodeName();
+ setTitle((nodeName != null) ? "<" + nodeName + ">" :
"");
}
public Control createControl(Composite parent) {
@@ -78,11 +76,7 @@
}
public void stopEditing() {
- try {
- if(objectEditor != null) objectEditor.stopEditing();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ if(objectEditor != null) objectEditor.stopEditing();
}
public void dispose() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/PropertiesWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/PropertiesWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/PropertiesWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,17 +12,15 @@
import java.util.Properties;
-import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-
+import org.jboss.tools.common.meta.key.WizardKeys;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
+import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
public class PropertiesWizard extends AbstractQueryWizard {
@@ -52,17 +50,13 @@
//this.setMessage(WizardKeys.getString(getHelpKey()+".Message"));
Object[] ds = (Object[])data;
dataObject = ds[0];
- try {
- objectEditor.setModelObject((XModelObject)dataObject);
- Properties p = findProperties(data);
- if(windowTitle == null) {
- windowTitle = WizardKeys.getHeader("Properties");
- }
- boolean viewMode = p != null &&
"true".equals(p.getProperty("viewMode"));
- objectEditor.setViewMode(viewMode);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
+ objectEditor.setModelObject((XModelObject)dataObject);
+ Properties p = findProperties(data);
+ if(windowTitle == null) {
+ windowTitle = WizardKeys.getHeader("Properties");
}
+ boolean viewMode = p != null &&
"true".equals(p.getProperty("viewMode"));
+ objectEditor.setViewMode(viewMode);
}
public Control createControl(Composite parent) {
@@ -80,11 +74,7 @@
}
public void stopEditing() {
- try {
- if(objectEditor != null) objectEditor.stopEditing();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ if(objectEditor != null) objectEditor.stopEditing();
}
public void dispose() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,25 +13,28 @@
import java.util.Properties;
import java.util.Set;
-import org.jboss.tools.common.editor.AbstractSelectionProvider;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.action.CommandBar;
-import org.jboss.tools.common.model.ui.action.CommandBarListener;
-import org.jboss.tools.common.model.ui.dnd.*;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
-import org.jboss.tools.common.model.ui.swt.util.BorderLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
-
+import org.jboss.tools.common.editor.AbstractSelectionProvider;
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.CommandBarListener;
+import org.jboss.tools.common.model.ui.dnd.ControlDragDrop;
+import org.jboss.tools.common.model.ui.dnd.IControlDragDropProvider;
+import org.jboss.tools.common.model.ui.dnd.IControlDropListener;
+import org.jboss.tools.common.model.ui.swt.util.BorderLayout;
import org.jboss.tools.common.model.util.AbstractTableHelper;
public class XChildrenEditor implements CommandBarListener {
@@ -266,15 +269,11 @@
}
public void callAction(XModelObject o, String path) {
- try {
- Properties p = new Properties();
- p.put("shell", bar.getControl().getShell());
- int i = xtable.getSelectionIndex();
- p.put("insertAfter", Integer.valueOf(i));
- XActionInvoker.invoke(path, o, getTargets(), p);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ Properties p = new Properties();
+ p.put("shell", bar.getControl().getShell());
+ int i = xtable.getSelectionIndex();
+ p.put("insertAfter", Integer.valueOf(i));
+ XActionInvoker.invoke(path, o, getTargets(), p);
}
private XModelObject[] getTargets() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/outline/XModelObjectContentProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/outline/XModelObjectContentProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/outline/XModelObjectContentProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,15 +10,15 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.outline;
-import java.util.*;
+import java.util.ArrayList;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.util.*;
+import org.jboss.tools.common.model.XFilteredTreeConstraint;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.XModelObjectCache;
public class XModelObjectContentProvider extends WorkbenchContentProvider {
XFilteredTreeConstraint[] filters = null;
@@ -29,13 +29,9 @@
if(isEqualObject(cache)) return;
this.cache = cache;
if(viewer != null) {
- try {
- viewer.refresh();
- ((TreeViewer)viewer).expandToLevel(2);
- if(cache != null) viewer.setSelection(new StructuredSelection(cache.getObject()));
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ viewer.refresh();
+ ((TreeViewer)viewer).expandToLevel(2);
+ if(cache != null) viewer.setSelection(new StructuredSelection(cache.getObject()));
}
}
@@ -107,13 +103,9 @@
((TreeViewer)viewer).setAutoExpandLevel(2);
}
if(viewer == null || viewer.getControl() == null || viewer.getControl().isDisposed())
return;
- try {
- viewer.refresh();
- if(viewer.getSelection() == null || viewer.getSelection().isEmpty()) {
- if(cache != null) viewer.setSelection(new StructuredSelection(cache.getObject()));
- }
- } catch (Exception t) {
- ModelUIPlugin.getPluginLog().logError(t);
+ viewer.refresh();
+ if(viewer.getSelection() == null || viewer.getSelection().isEmpty()) {
+ if(cache != null) viewer.setSelection(new StructuredSelection(cache.getObject()));
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ProblemReporter.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ProblemReporter.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ProblemReporter.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,16 +13,15 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
+
import org.eclipse.core.runtime.IStatus;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.dialog.ErrorDialog;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.ui.dialog.ErrorDialog;
import org.jboss.tools.common.reporting.IProblemReporter;
-import org.jboss.tools.common.reporting.ProblemReportingHelper;
public class ProblemReporter implements IProblemReporter {
static int DO_NOTNING_ACTION = 0;
@@ -44,31 +43,6 @@
showProblemDialog(status);
}
}
-
- /**
- *
- class R implements Runnable {
- IStatus status;
- R(IStatus status) {
- this.status = status;
- }
- public void run() {
- int action = ADD_TO_BUFFER_ACTION;
- if(isShowProblemDialogOn() && Display.getDefault()!=null) {
- action = showProblemDialog(status);
- } else if(isSubmitProblemAutomaticallyOn()) {
- action = REPORT_ACTION;
- }
- if(action == REPORT_ACTION) {
- String email = ReportPreference.E_MAIL_OPTION.getValue();
- String other = ReportPreference.OTHER_OPTION.getValue();
- ProblemReportingHelper.buffer.report(throwableToString(status.getMessage(),
status.getException()), email, other, false);
- } else if(action == ADD_TO_BUFFER_ACTION) {
- ProblemReportingHelper.buffer.writeToBuffer(status);
- }
- }
- }
- */
private boolean isShowProblemDialogOn() {
return "yes".equals(ReportPreference.SHOW_ERROR_DIALOG_OPTION.getValue());
@@ -80,12 +54,7 @@
private int showProblemDialog(IStatus status) {
Shell shell = null;
- try {
- shell =
ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- } catch (Exception e) {
- //we cannot call reporting service here!
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ shell = ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
return ErrorDialog.openError(shell, "Error", status.getMessage(),
status.getException());
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -21,6 +21,7 @@
import java.io.StringWriter;
import java.text.Collator;
import java.text.DateFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Comparator;
@@ -276,7 +277,7 @@
lastOldSession = new String(t);
isAccept = false;
}
- }catch(Exception ex){
+ }catch(ParseException ex){
//ModelUIPlugin.getPluginLog().logError(ex);
sb.append(t);
isAccept = true;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -29,17 +29,15 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.Status;
+import org.jboss.tools.common.model.ui.ModelUIMessages;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.xml.SafeDocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import org.jboss.tools.common.xml.SafeDocumentBuilderFactory;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.ModelUIMessages;
-
/**
* @author AU
*/
@@ -237,7 +235,7 @@
serial.asDOMSerializer();
serial.serialize(document);
writer.close();
- } catch (Exception e) {
+ } catch (IOException e) {
//log(Status.ERROR, ModelUIMessages.getString(ERROR_CREATE_DOCUMENT, new String[]
{fullLayoutLocation, fullResourceLocation}), e);
ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_CREATE_DOCUMENT,
new String[] {layoutLocation, fullResourceLocation}), e);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -55,20 +55,12 @@
oe.selectPageByName(preferredPage);
}
}
- try {
- p.getSite().getSelectionProvider().setSelection(getSelection((XModelObject)object));
- } catch (Exception e) {
- // we cannot avoid exception if third party editor is used
- }
+ p.getSite().getSelectionProvider().setSelection(getSelection((XModelObject)object));
IWorkbenchPage page =
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart vs = page.findView("org.eclipse.ui.views.ContentOutline");
ISelectionProvider sp = vs == null ? null : vs.getSite().getSelectionProvider();
if(sp != null) {
- try {
sp.setSelection(getSelection(object));
- } catch (Exception e) {
- // we cannot avoid exception if third party outline is used
- }
}
}
});
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/XModelObjectSelectionProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,13 +10,21 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.select;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jface.viewers.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.jboss.tools.common.model.XModelObject;
public class XModelObjectSelectionProvider implements ISelectionProvider,
ISelectionChangedListener {
private List<ISelectionChangedListener> listeners;
@@ -64,13 +72,7 @@
}
public ISelection getSelection() {
- try {
- return (host == null) ? null : convertSelectionToAdapter(host.getSelection());
- } catch (Exception e) {
- //TODO study possible problems and narrow caught exceptions.
- ModelUIPlugin.getPluginLog().logError(e);
- return null;
- }
+ return (host == null) ? null : convertSelectionToAdapter(host.getSelection());
}
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/TemplatesConfiguration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/TemplatesConfiguration.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/TemplatesConfiguration.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -49,16 +49,12 @@
}
}
public void customizeDocumentCommand(IDocument d, DocumentCommand c) {
- try {
- if (c instanceof DocumentCommand) {
- DocumentCommand structuredDocumentCommand = (DocumentCommand)c;
- if (structuredDocumentCommand.length == 0 && structuredDocumentCommand.text
!= null && TextUtilities.endsWith(d.getLegalLineDelimiters(),
structuredDocumentCommand.text) != -1) {
- _autoIndentAfterNewLine(d, structuredDocumentCommand);
- return;
- }
+ if (c instanceof DocumentCommand) {
+ DocumentCommand structuredDocumentCommand = (DocumentCommand)c;
+ if (structuredDocumentCommand.length == 0 && structuredDocumentCommand.text
!= null && TextUtilities.endsWith(d.getLegalLineDelimiters(),
structuredDocumentCommand.text) != -1) {
+ _autoIndentAfterNewLine(d, structuredDocumentCommand);
+ return;
}
- } catch (Exception x) {
- ModelUIPlugin.getPluginLog().logError("Error in customizing document
command", x);
}
super.customizeDocumentCommand(d, c);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaClassTemplateHelper.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -56,8 +56,8 @@
QualifiedName qn = new QualifiedName(ModelUIPlugin.ID_PLUGIN,
ModelUIPlugin.PROJECT_OVERRIDE);
try {
String projectOverride =
ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(qn);
- return projectOverride != null &&
Boolean.valueOf(projectOverride).booleanValue();
- } catch (Exception e) {
+ return projectOverride != null && Boolean.parseBoolean(projectOverride);
+ } catch (CoreException e) {
return false;
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaConfigurationLoader.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaConfigurationLoader.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/templates/configuration/MetaConfigurationLoader.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -29,7 +29,7 @@
try {
String path =
FileLocator.resolve(MetaConfigurationLoader.class.getResource("/dtds/meta-templates.dtd")).toString();
XMLEntityResolver.registerPublicEntity("-//Red Hat Inc.//DTD Meta
Templates 1.0//EN", path);
- } catch (Exception e) {
+ } catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
}
@@ -62,7 +62,7 @@
StringWriter writer = new StringWriter();
try {
XMLUtilities.serialize(element, writer);
- } catch (Exception e) {
+ } catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
ModelUIPlugin.getDefault().getPluginPreferences().setValue(PREFERENCE_KEY,
writer.toString());
@@ -82,7 +82,7 @@
saveConfiguration(c, element);
try {
XMLUtilities.serialize(element, location);
- } catch (Exception e) {
+ } catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
}
@@ -139,7 +139,7 @@
Bundle bundle = Platform.getBundle(name);
try {
url = FileLocator.resolve(bundle.getEntry("/"));
- } catch (Exception e) {
+ } catch (IOException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
String file = element.getAttribute(FILE);
@@ -184,18 +184,14 @@
if(!file.isFile()) return null;
try {
return XMLUtilities.getDocument(new FileReader(file), createResolver());
- } catch (Exception e) {
+ } catch (FileNotFoundException e) {
return null;
}
}
Document getDocument(String text) {
if(text == null) return null;
- try {
- return XMLUtilities.getDocument(new StringReader (text), createResolver());
- } catch (Exception e) {
- return null;
- }
+ return XMLUtilities.getDocument(new StringReader (text), createResolver());
}
XMLEntityResolver createResolver() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/ExtensionPointUtils.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/ExtensionPointUtils.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/ExtensionPointUtils.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.util;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.INewWizard;
@@ -23,7 +24,7 @@
Platform.getBundle(pluginId);
try {
return
(INewWizard)ExtensionPointUtil.findClassByElementId("org.eclipse.ui.newWizards",
wizardId);
- } catch (Exception ex) {
+ } catch (CoreException ex) {
ModelUIPlugin.getPluginLog().logError(ex);
}
return null;
@@ -33,7 +34,7 @@
Platform.getBundle(pluginId);
try {
return
(IImportWizard)ExtensionPointUtil.findClassByElementId("org.eclipse.ui.importWizards",
wizardId);
- } catch (Exception ex) {
+ } catch (CoreException ex) {
ModelUIPlugin.getPluginLog().logError(ex);
}
return null;
@@ -44,7 +45,7 @@
Platform.getBundle(pluginId);
try {
return
(IObjectActionDelegate)ExtensionPointUtil.findClassByElementId("org.eclipse.ui.popupMenus",
actionId);
- } catch (Exception ex) {
+ } catch (CoreException ex) {
ModelUIPlugin.getPluginLog().logError(ex);
}
return null;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorContentProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorContentProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorContentProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -24,22 +24,20 @@
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
-import org.jboss.tools.common.model.util.XModelTreeListenerSWTASync;
-import org.jboss.tools.common.model.ui.navigator.TreeViewerModelListenerImpl;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-
import org.jboss.tools.common.model.XFilteredTree;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.ui.navigator.TreeViewerModelListenerImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.util.XModelTreeListenerSWTASync;
public class NavigatorContentProvider implements ITreeContentProvider,
IResourceChangeListener {
protected FilteredTreesCache filteredTrees = FilteredTreesCache.getInstance();
@@ -263,13 +261,8 @@
if(project == null || !project.isOpen()) return null;
IModelNature nature = EclipseResourceUtil.getModelNature(project);
if(nature == null) return null;
- try {
- XFilteredTree filteredTree = getFilteredTree(nature.getModel().getRoot());
- return (filteredTree != null) ? filteredTree.getRoot() : null;
- } catch (Exception ex) {
- ModelUIPlugin.getPluginLog().logError(ex);
- }
- return null;
+ XFilteredTree filteredTree = getFilteredTree(nature.getModel().getRoot());
+ return (filteredTree != null) ? filteredTree.getRoot() : null;
}
private void check() {
@@ -278,35 +271,25 @@
if(swtTree == null || swtTree.isDisposed()) return;
TreeItem[] is = swtTree.getItems();
if(is == null || is.length == 0) return;
- try {
- for (int i = 0; i < is.length; i++) {
- XModelObject o = (XModelObject)is[i].getData();
- if(o == null) continue;
- IProject p = EclipseResourceUtil.getProject(o);
- IModelNature nature = EclipseResourceUtil.getModelNature(p);
- if(nature == null) {
+ for (int i = 0; i < is.length; i++) {
+ XModelObject o = (XModelObject)is[i].getData();
+ if(o == null) continue;
+ IProject p = EclipseResourceUtil.getProject(o);
+ IModelNature nature = EclipseResourceUtil.getModelNature(p);
+ if(nature == null) {
+ o.getModel().removeModelTreeListener(syncListener);
+ viewer.remove(o);
+ projects.remove(p.getLocation().toString());
+ } else {
+ String classname =
o.getModel().getMetaData().getMapping("FilteredTrees").getValue(getFilteredTreeName(o.getModel()));
+ XFilteredTree tree = getFilteredTree(o.getModel().getRoot());
+ if(tree != null && !tree.getClass().getName().equals(classname)) {
o.getModel().removeModelTreeListener(syncListener);
- viewer.remove(o);
projects.remove(p.getLocation().toString());
- } else {
- String classname =
o.getModel().getMetaData().getMapping("FilteredTrees").getValue(getFilteredTreeName(o.getModel()));
- XFilteredTree tree = getFilteredTree(o.getModel().getRoot());
- if(tree != null && !tree.getClass().getName().equals(classname)) {
- o.getModel().removeModelTreeListener(syncListener);
- projects.remove(p.getLocation().toString());
-// filteredTrees.remove(tree);
- viewer.remove(o);
- viewer.refresh();
- }
+ viewer.remove(o);
+ viewer.refresh();
}
}
- } catch (Exception e) {
- //ModelUIPlugin.log("NavigatorContentProvider:check");
- try {
- viewer.refresh();
- } catch (Exception e2) {
- //ignore
- }
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorMenuInvoker.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorMenuInvoker.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorMenuInvoker.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,20 +11,19 @@
package org.jboss.tools.common.model.ui.views.navigator;
import java.util.Properties;
-import org.eclipse.swt.events.*;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Point;
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.ui.navigator.TreeViewerMenuInvoker;
import org.jboss.tools.common.model.util.FindObjectHelper;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.navigator.*;
-
public class NavigatorMenuInvoker extends TreeViewerMenuInvoker {
private static XModelObject eclipseWorkspace = null;
@@ -62,12 +61,7 @@
}
private boolean isOpenOnSingleClick() {
- try {
- return
Platform.getPreferencesService().getBoolean("org.eclipse.ui.workbench",
"OPEN_ON_SINGLE_CLICK", true, new IScopeContext[]{new InstanceScope()});
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- return false;
- }
+ return
Platform.getPreferencesService().getBoolean("org.eclipse.ui.workbench",
"OPEN_ON_SINGLE_CLICK", true, new IScopeContext[]{new InstanceScope()});
}
protected void fillRunningProperties(Properties p) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -132,11 +132,7 @@
dnd.enable();
initContextMenu();
- try {
- activateF3();
- } catch (Exception e) {
- //ignore
- }
+ activateF3();
getSite().getPage().addPartListener(partListener);
@@ -166,11 +162,7 @@
}
private IAction createActionInstance(String name) {
- try {
- return (IAction)ModelFeatureFactory.getInstance().createFeatureInstance(name);
- } catch (Exception exc) {
- return null;
- }
+ return (IAction)ModelFeatureFactory.getInstance().createFeatureInstance(name);
}
protected String[] getActionClasses() {
@@ -372,24 +364,16 @@
}
public void saveState(IMemento _memento) {
- try {
- XModelObject o = getSelectedModelObject();
- if(o != null) _memento.putString("selection", getNodePath(o));
- saveLinkingEnabled(_memento);
- } catch (Exception exc) {
- //ignore
- }
+ XModelObject o = getSelectedModelObject();
+ if(o != null) _memento.putString("selection", getNodePath(o));
+ saveLinkingEnabled(_memento);
}
public void restoreState(IMemento _memento) {
- try {
- String selection = _memento.getString("selection");
- XModelObject o = findModelObject(selection);
- if(o != null) viewer.setSelection(new StructuredSelection(o));
- restoreLinkingEnabled();
- } catch (Exception exc) {
- //ignore
- }
+ String selection = _memento.getString("selection");
+ XModelObject o = findModelObject(selection);
+ if(o != null) viewer.setSelection(new StructuredSelection(o));
+ restoreLinkingEnabled();
}
private String getNodePath(XModelObject o) {
@@ -638,11 +622,7 @@
if(isHandlingActivation) return;
isHandlingActivation = true;
IProject[] ps = null;
- try {
- ps = ModelUIPlugin.getWorkspace().getRoot().getProjects();
- } catch (Exception e) {
- //Workspace has been closed. There is no other way to know it.
- }
+ ps = ModelUIPlugin.getWorkspace().getRoot().getProjects();
if(ps == null) return;
for (int i = 0; i < ps.length; i++) {
IModelNature n = EclipseResourceUtil.getModelNature(ps[i]);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/TextAndReferenceComponent.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/TextAndReferenceComponent.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/TextAndReferenceComponent.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,11 +11,22 @@
package org.jboss.tools.common.model.ui.widgets;
import java.util.ArrayList;
+
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
public class TextAndReferenceComponent extends Canvas implements PaintListener,
MouseMoveListener {
int defaultWidth = 100;
@@ -34,13 +45,9 @@
addPaintListener(this);
addMouseMoveListener(this);
addMouseListener(new MA());
- try {
- plain = getFont();
- FontData d = plain.getFontData()[0];
- bold = new Font(null, d.getName(), d.getHeight(), d.getStyle() | SWT.BOLD);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ plain = getFont();
+ FontData d = plain.getFontData()[0];
+ bold = new Font(null, d.getName(), d.getHeight(), d.getStyle() | SWT.BOLD);
}
public void mouseMove(MouseEvent e) {
@@ -84,11 +91,7 @@
defaultWidth = width;
this.width = width;
tokens = Tokenizer.tokenize(text, plain, bold);
- try {
- pack();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ pack();
}
public void paintControl(PaintEvent ev) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileContext.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileContext.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileContext.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,17 +10,20 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.wizard.newfile;
-import java.util.*;
-import org.eclipse.core.resources.*;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
-import org.jboss.tools.common.model.ui.util.ModelUtilities;
import org.eclipse.jface.viewers.IStructuredSelection;
-
-import org.jboss.tools.common.meta.action.*;
+import org.jboss.tools.common.meta.action.XAction;
+import org.jboss.tools.common.meta.action.XActionList;
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
+import org.jboss.tools.common.model.ui.util.ModelUtilities;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class NewFileContext {
@@ -67,13 +70,8 @@
errorMesage = "Project is closed";
return;
}
- try {
- if(EclipseResourceUtil.getModelNature(resource.getProject()) == null)
- errorMesage = "Add Struts Nature to project";
- } catch (Exception e) {
- errorMesage = e.getMessage();
- return;
- }
+ if(EclipseResourceUtil.getModelNature(resource.getProject()) == null)
+ errorMesage = "Add Struts Nature to project";
folder = EclipseResourceUtil.getObjectByResource(resource);
if(folder != null) {
@@ -102,7 +100,7 @@
return support.getValidator(0).getErrorMessage();
}
- public void execute() throws Exception {
+ public void execute() throws XModelException {
Properties p = new Properties();
if(resource != null) p.put("resource", resource);
action.executeHandler(support.getTarget(), p);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizard/newfile/NewFileWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,7 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.*;
import org.eclipse.ui.*;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.ui.ModelUIImages;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
@@ -39,7 +40,7 @@
public boolean performFinish() {
try {
context.execute();
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
return false;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/NewClassWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -94,9 +94,6 @@
return false;
} catch (InterruptedException e) {
return false;
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- return false;
}
return true;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizardView.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizardView.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizardView.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -97,18 +97,12 @@
if(CANCEL.equals(command)) {
code = 1;
dispose();
- }
- else if(OK.equalsIgnoreCase(command)) {
+ } else if(OK.equalsIgnoreCase(command)) {
code = 0;
dispose();
+ } else if(HELP.equals(command)) {
+ HelpUtil.helpEclipse(model, helpkey);
}
- else if(HELP.equals(command)) {
- if(model != null) try {
- HelpUtil.helpEclipse(model, helpkey);
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
- }
}
public int code() {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/special/DefaultSpecialWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,6 +11,8 @@
package org.jboss.tools.common.model.ui.wizards.special;
import java.util.Properties;
+
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.ui.action.CommandBar;
import org.jboss.tools.common.model.ui.wizards.standard.DefaultStandardWizard;
import org.eclipse.jface.dialogs.IMessageProvider;
@@ -79,7 +81,7 @@
setStep();
try {
support.action("STEP");
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
dialog.open();
@@ -91,18 +93,14 @@
CommandBar bar = dialog.getCommandBar();
bar.disable();
if(SpecialWizardSupport.HELP.equals(name)) {
- try {
- HelpUtil.helpEclipse(support.getTarget().getModel(), support.getHelpKey());
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ HelpUtil.helpEclipse(support.getTarget().getModel(), support.getHelpKey());
return;
}
try {
save();
support.action(name);
dialog.setMessage("");
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
setStep();
@@ -132,11 +130,7 @@
dialog.getShell().setText(support.getTitle());
dialog.setTitle(support.getSubtitle());
if(message != null) dialog.setMessage(message);
- try {
- wizardStep.validate();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ wizardStep.validate();
}
private ISpecialWizardStep getStep(int i) {
@@ -162,11 +156,7 @@
public void dispose() {
stopValidator();
if(dialog == null) return;
- try {
- if(dialog.getShell() != null && !dialog.getShell().isDisposed())
dialog.close();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ if(dialog.getShell() != null && !dialog.getShell().isDisposed())
dialog.close();
dialog = null;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardStep.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardStep.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardStep.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,17 +10,19 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.wizards.standard;
-import java.util.*;
import java.beans.PropertyChangeEvent;
+import java.util.Properties;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
import org.eclipse.jface.preference.FieldEditor;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
import org.jboss.tools.common.meta.action.XAttributeData;
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
public class DefaultStandardStep extends WizardPage implements
java.beans.PropertyChangeListener {
protected DefaultStandardWizard wizard;
@@ -75,7 +77,7 @@
if(support.getStepId() > id) {
try {
support.action(SpecialWizardSupport.BACK);
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
}
@@ -96,12 +98,8 @@
private void validateAll() {
attributes.store();
- try {
- validate();
- updateFieldEnablement();
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ validate();
+ updateFieldEnablement();
}
public void propertyChange(PropertyChangeEvent arg0) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/standard/DefaultStandardWizard.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,16 +10,17 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.wizards.standard;
-import java.util.*;
+import java.util.Properties;
+
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.PlatformUI;
-
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.meta.action.impl.SpecialWizardControlListener;
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class DefaultStandardWizard extends Wizard implements SpecialWizardControlListener
{
@@ -37,7 +38,7 @@
try {
support.action(SpecialWizardSupport.FINISH);
return support.isFinished();
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
return false;
@@ -77,7 +78,7 @@
public IWizardPage getNextPage(IWizardPage page) {
try {
support.action(SpecialWizardSupport.NEXT);
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
int id = support.getStepId();
@@ -138,7 +139,7 @@
step.save();
support.action(name);
- } catch (Exception e) {
+ } catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/BundleEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/BundleEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/BundleEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -38,12 +38,8 @@
super.dispose();
if(fActivationListener != null && bundleModel != null) {
IWorkbenchWindow window = getSite().getWorkbenchWindow();
- if(window != null) try {
- window.getPartService().removePartListener(fActivationListener);
- window.getShell().removeShellListener(fActivationListener);
- } catch (Exception e) {
- //ignore
- }
+ window.getPartService().removePartListener(fActivationListener);
+ window.getShell().removeShellListener(fActivationListener);
}
fActivationListener = null;
if (childrenEditor!=null) childrenEditor.dispose();
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesCompoundEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesCompoundEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesCompoundEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,10 +10,13 @@
******************************************************************************/
package org.jboss.tools.common.propertieseditor;
-import org.jboss.tools.common.editor.*;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.common.editor.AbstractSelectionProvider;
+import org.jboss.tools.common.editor.ObjectMultiPageEditor;
+import org.jboss.tools.common.editor.ObjectTextEditor;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.propertieseditor.text.*;
-import org.eclipse.jface.viewers.ISelectionProvider;
+import org.jboss.tools.common.propertieseditor.text.PropertiesTextEditor;
public class PropertiesCompoundEditor extends ObjectMultiPageEditor {
protected PropertiesEditor propertiesEditor;
@@ -36,7 +39,7 @@
try {
propertiesEditor.init(getEditorSite(), getEditorInput());
index = addPage(propertiesEditor, getEditorInput());
- } catch (Exception e) {
+ } catch (PartInitException e) {
ModelUIPlugin.getPluginLog().logError(e);
return;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/PropertiesEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,28 +10,41 @@
******************************************************************************/
package org.jboss.tools.common.propertieseditor;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.texteditor.*;
-
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.jboss.tools.common.meta.action.XAction;
import org.jboss.tools.common.meta.action.XActionInvoker;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.util.*;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-//import org.jboss.tools.common.core.jdt.Messages;
-import org.jboss.tools.common.model.ui.action.*;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextOperationTarget;
-import org.eclipse.jface.viewers.*;
-import org.jboss.tools.common.model.ui.objecteditor.*;
+import org.jboss.tools.common.model.ui.action.CommandBar;
+import org.jboss.tools.common.model.ui.action.XMenuInvoker;
+import org.jboss.tools.common.model.ui.objecteditor.XChildrenEditor;
import org.jboss.tools.common.model.ui.texteditors.TextActionHelper;
+import org.jboss.tools.common.model.util.AbstractTableHelper;
public class PropertiesEditor extends XChildrenEditor implements ITextEditor,
ITextOperationTarget {
private ArrayList<String> actionMapping = new ArrayList<String>();
@@ -175,12 +188,8 @@
public void removePropertyListener(IPropertyListener listener) {}
public void setFocus() {
- try {
- if(xtable == null || !xtable.isActive()) return;
- xtable.getTable().setFocus();
- } catch(Exception e) {
- //ignore
- }
+ if(xtable == null || !xtable.isActive()) return;
+ xtable.getTable().setFocus();
}
public Object getAdapter(Class adapter) {
@@ -216,7 +225,7 @@
public void doOperation(int operation) {
if (operation>actionMapping.size()) {
- ModelUIPlugin.getPluginLog().logError(new RuntimeException("Can not find global
action with index: "+operation));
+ ModelUIPlugin.getPluginLog().logError(new IllegalArgumentException("Can not find
global action with index: "+operation));
} else {
String globalAction = (String)actionMapping.get(operation);
doGlobalAction(globalAction);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/bundlemodel/BundleModel.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -16,7 +16,13 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -127,7 +133,7 @@
IResource[] rs = new IResource[0];
try {
rs = main.getParent().members();
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
for (int i = 0; i < rs.length; i++) {
@@ -264,7 +270,7 @@
try {
if(f.exists()) f.setContents(is, true, true, null);
else f.create(is, true, null);
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/text/PropertyTextEditorSupport.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/text/PropertyTextEditorSupport.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/propertieseditor/text/PropertyTextEditorSupport.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,11 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.propertieseditor.text;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.texteditors.TextEditorSupport;
-
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.loaders.impl.PropertiesLoader;
+import org.jboss.tools.common.model.ui.texteditors.TextEditorSupport;
/**
* @author Jeremy
@@ -35,8 +33,6 @@
lock++;
try {
loader.edit(getModelObject(), provider.getText());
- } catch (Exception e) {
- ModelUIPlugin.getPluginLog().logError(e);
} finally {
lock--;
setModified (false);
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddJSFNatureActionDelegate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddJSFNatureActionDelegate.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddJSFNatureActionDelegate.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -22,12 +22,12 @@
public class AddJSFNatureActionDelegate extends AddNatureActionDelegate {
- protected IWizard getWizard(IProject project) throws Exception {
+ protected IWizard getWizard(IProject project) {
ImportProjectWizard wizard =
(ImportProjectWizard)ExtensionPointUtils.findImportWizardsItem(
JSFModelPlugin.PLUGIN_ID,
"org.jboss.tools.jsf.ui.wizard.project.ImportProjectWizard"
);
- if (wizard == null) throw new Exception("Wizard
org.jboss.tools.common.model.ui.wizards.ImportProjectWizard is not found.");
+ if (wizard == null) throw new IllegalArgumentException("Wizard
org.jboss.tools.common.model.ui.wizards.ImportProjectWizard is not found.");
wizard.setInitialName(project.getName());
wizard.setInitialLocation(findWebXML(project.getLocation().toString()));
wizard.init(ModelUIPlugin.getDefault().getWorkbench(), null);
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -14,6 +14,7 @@
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -24,15 +25,12 @@
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TaglibTracker;
import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
import org.eclipse.jst.jsp.ui.internal.contentassist.JSPContentAssistProcessor;
import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames;
-import org.eclipse.jst.jsp.ui.internal.templates.TemplateContextTypeIdsJSP;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor;
-import org.eclipse.wst.html.core.text.IHTMLPartitions;
import
org.eclipse.wst.javascript.ui.internal.common.contentassist.JavaScriptContentAssistProcessor;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
@@ -70,11 +68,6 @@
import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.jst.web.tld.TaglibData;
-import org.jboss.tools.jst.web.tld.VpeTaglibListener;
-import org.jboss.tools.jst.web.tld.VpeTaglibManager;
-import org.jboss.tools.jst.web.tld.VpeTaglibManagerProvider;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -215,12 +208,8 @@
try {
wtpKbConnector =
(WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR,
document);
jspActiveCAP.setKbConnector(wtpKbConnector);
- } catch (ClassNotFoundException e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
- } catch (InstantiationException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (IllegalAccessException e) {
- JspEditorPlugin.getPluginLog().logError(e);
}
}
return wtpKbConnector;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletsHtmlContentAssistProcessor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -57,7 +57,6 @@
import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.common.model.util.ELParser;
-import org.jboss.tools.common.reporting.ProblemReportingHelper;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.editor.TLDRegisterHelper;
import org.jboss.tools.jst.jsp.outline.ValueHelper;
@@ -484,11 +483,7 @@
jspActiveCAP.setKbConnector(wtpKbConnector);
FaceletsJsfCResource fsfCResource = new
FaceletsJsfCResource(wtpKbConnector);
wtpKbConnector.registerResource(fsfCResource);
- } catch(ClassNotFoundException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (InstantiationException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (IllegalAccessException e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/SourceEditorPageContext.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -18,6 +18,7 @@
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
+import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
@@ -99,12 +100,8 @@
}
try {
connector =
(WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR,
iDocument);
- } catch (InstantiationException e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
- } catch (IllegalAccessException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (ClassNotFoundException e) {
- JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/support/kb/WTPTextJspKbConnector.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -130,13 +130,8 @@
fTaglibResource = taglibResource;
registerResource(fTaglibResource);
}
- invokeDelayedUpdateKnownTagLists();
- } catch(ClassNotFoundException e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
- } catch (InstantiationException e) {
- JspEditorPlugin.getPluginLog().logError(e);
- } catch (IllegalAccessException e) {
- JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/RunPageActionDelegate.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/RunPageActionDelegate.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/RunPageActionDelegate.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,31 +10,44 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.action;
-import java.util.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jface.action.*;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.jboss.tools.common.log.LogHelper;
-import org.jboss.tools.common.model.util.XModelTreeListenerSWTASync;
-import org.jboss.tools.common.model.ui.dnd.DnDUtil;
-import org.eclipse.jface.viewers.*;
-
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.action.impl.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.event.*;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.jboss.tools.common.meta.action.XActionInvoker;
+import org.jboss.tools.common.meta.action.XEntityData;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.event.XModelTreeEvent;
+import org.jboss.tools.common.model.event.XModelTreeListener;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.action.AbstractModelActionDelegate;
+import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
-import org.jboss.tools.common.model.ui.action.*;
-import org.jboss.tools.jst.web.browser.*;
+import org.jboss.tools.common.model.util.XModelTreeListenerSWTASync;
+import org.jboss.tools.jst.web.browser.AbstractBrowserContext;
import org.jboss.tools.jst.web.browser.wtp.RunOnServerContext;
import org.jboss.tools.jst.web.server.ServerManager;
import org.jboss.tools.jst.web.server.ServerManagerListener;
@@ -147,7 +160,7 @@
return context.getModelActionPath();
}
- protected void doRun() throws Exception {
+ protected void doRun() {
if(context.isJustUrl(context.getLastRunURL())) {
if(!saveAllEditors()) return;
context.runJustUrl();
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/SaveProjectAsTemplateActionDelegate.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/SaveProjectAsTemplateActionDelegate.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/SaveProjectAsTemplateActionDelegate.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -24,7 +24,7 @@
return true;
}
- protected void doRun() throws Exception {
+ protected void doRun() {
XActionInvoker.invoke("WebWorkspace", "SaveAsTemplate", object,
null);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportAction.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportAction.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/adf/AddADFSupportAction.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -10,11 +10,15 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.action.adf;
+import java.lang.reflect.InvocationTargetException;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IObjectActionDelegate;
import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.ui.action.*;
+import org.jboss.tools.jst.web.ui.WebUiPlugin;
public class AddADFSupportAction extends AbstractModelActionDelegate implements
IObjectActionDelegate {
AddADFSupportHelper helper = new AddADFSupportHelper();
@@ -33,7 +37,13 @@
}
protected void doRun() throws XModelException {
- helper.execute();
+ try {
+ helper.execute();
+ } catch (InvocationTargetException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (InterruptedException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
}
public void setActivePart(IAction action, IWorkbenchPart targetPart) {}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -127,7 +127,7 @@
}
public Collection<ISeamProperty> getProperties() {
- throw new RuntimeException("Not implemented");
+ throw new IllegalStateException("Not implemented");
}
public Collection<String> getPropertyNames() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -203,12 +203,7 @@
if(cls == null) return;
if(!CLASS_SCANNER.isLikelyComponentSource(cls)) return;
LoadedDeclarations ds1 = null;
- try {
- ds1 = CLASS_SCANNER.parse(type, cls, sourcePath);
- } catch (Exception e) {
- // FIXME parse method should throw particular exception or catch block should be
removed
- SeamCorePlugin.getPluginLog().logError(e);
- }
+ ds1 = CLASS_SCANNER.parse(type, cls, sourcePath);
if(ds1 != null) {
ds.add(ds1);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -21,7 +21,6 @@
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.SeamCoreMessages;
-import org.jboss.tools.seam.core.SeamCorePlugin;
import org.w3c.dom.Element;
/**
@@ -276,10 +275,10 @@
*/
public void addLinkedResource(String variableName, IPath linkedResourcePath) {
if(linkedResourcePath==null) {
- throw new
RuntimeException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_LINKED_RESOURCE_PATH_MUST_NOT_BE_NULL);
+ throw new
IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_LINKED_RESOURCE_PATH_MUST_NOT_BE_NULL);
}
if(variableName==null) {
- throw new
RuntimeException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_VARIABLE_NAME_MUST_NOT_BE_NULL);
+ throw new
IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_VARIABLE_NAME_MUST_NOT_BE_NULL);
}
Set<IPath> linkedResources = resourcesByVariableName.get(variableName);
if(linkedResources==null) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlink.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlink.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlink.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,7 @@
import java.text.MessageFormat;
import java.util.List;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.text.BadLocationException;
@@ -49,7 +50,7 @@
// could not open editor
openFileFailed();
}
- } catch (Exception x) {
+ } catch (CoreException x) {
// could not open editor
openFileFailed();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -14,7 +14,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -30,7 +29,6 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
-import org.jboss.tools.seam.internal.core.el.ELToken;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
@@ -46,8 +44,6 @@
public class SeamBeanHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements
IHyperlinkPartitionRecognizer, IHyperLinkPartitionPriority {
public static final String SEAM_BEAN_PARTITION =
"org.jboss.tools.seam.text.ext.SEAM_BEAN";
- private final SeamELCompletionEngine fEngine= new SeamELCompletionEngine();
-
/**
* @see
com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument,
com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
*/
@@ -73,9 +69,6 @@
IHyperlinkRegion region = new HyperlinkRegion(offset, length, axis, contentType,
type);
return region;
- } catch (Exception x) {
- SeamExtPlugin.getPluginLog().logError(x);
- return null;
} finally {
smw.dispose();
}
@@ -131,7 +124,7 @@
IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength, null, null,
null);
return region;
- } catch (Exception x) {
+ } catch (BadLocationException x) {
SeamExtPlugin.getPluginLog().logError(x);
return null;
} finally {
@@ -183,7 +176,7 @@
IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength, null, null,
null);
return region;
- } catch (Exception x) {
+ } catch (BadLocationException x) {
SeamExtPlugin.getPluginLog().logError(x);
return null;
} finally {
@@ -212,9 +205,6 @@
IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength);
return region;
- } catch (Exception x) {
- SeamExtPlugin.getPluginLog().logError(x);
- return null;
} finally {
smw.dispose();
}
@@ -235,9 +225,6 @@
List<IJavaElement> javaElements = findJavaElements(document, region);
return (javaElements != null && javaElements.size() > 0);
- } catch (Exception x) {
- SeamExtPlugin.getPluginLog().logError(x);
- return false;
} finally {
smw.dispose();
}
@@ -336,7 +323,7 @@
seamProject, file, elText.toString());
}
return javaElements;
- } catch (Exception x) {
+ } catch (BadLocationException x) {
SeamExtPlugin.getPluginLog().logError(x);
return null;
} finally {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -20,7 +20,6 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlink;
import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -21,7 +21,6 @@
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.ext.hyperlink.LinkHyperlink;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
-import org.jboss.tools.seam.text.ext.SeamExtPlugin;
public class SeamViewHyperlink extends LinkHyperlink {
@@ -50,14 +49,8 @@
protected IFile getFileFromProject(String fileName) {
IFile documentFile = getFile();
-
- try {
- IProject project = documentFile.getProject();
- return super.getFileFromProject(updateFilenameForModel(fileName, project));
- } catch (Exception x) {
- SeamExtPlugin.getPluginLog().logError(x);
- return null;
- }
+ IProject project = documentFile.getProject();
+ return super.getFileFromProject(updateFilenameForModel(fileName, project));
}
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlinkPartitioner.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlinkPartitioner.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlinkPartitioner.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.hyperlink.jsp.JSPLinkHyperlinkPartitioner;
@@ -49,7 +50,7 @@
return true;
}
return false;
- } catch (Exception x) {
+ } catch (CoreException x) {
SeamExtPlugin.getPluginLog().logError(x);
return false;
} finally {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.ui.actions;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@@ -347,8 +348,14 @@
Object result = m.invoke(multiPageEditor, new Object[]{});
return (result instanceof IEditorPart ? (IEditorPart)result : null);
}
- } catch (NoSuchMethodException ne) {
- } catch (Exception e) {
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalArgumentException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
}
editorClass = editorClass.getSuperclass();
}
@@ -373,8 +380,14 @@
Object result = m.invoke(editor, new Object[]{});
return (result instanceof ISourceViewer ? (ISourceViewer)result : null);
}
- } catch (NoSuchMethodException ne) {
- } catch (Exception e) {
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalArgumentException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
}
editorClass = editorClass.getSuperclass();
}
@@ -388,11 +401,7 @@
* @return
*/
private Shell getShell() {
- try {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- } catch (Throwable x) {
- return null;
- }
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
}
// IWorkbenchPart fActiveWorkbenchPart = null;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/ScopePresentationActionProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/ScopePresentationActionProvider.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/ScopePresentationActionProvider.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -22,7 +22,6 @@
import org.eclipse.ui.navigator.IExtensionActivationListener;
import org.eclipse.ui.navigator.IExtensionStateModel;
import org.eclipse.ui.navigator.INavigatorActivationService;
-import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.ui.views.ViewConstants;
@@ -119,12 +118,7 @@
.getActiveWorkbenchWindow().getShell().getDisplay(),
new Runnable() {
public void run() {
- try {
- getActionSite().getStructuredViewer().refresh();
- } catch (Exception e2) {
- SeamCorePlugin.getPluginLog().logError(e2);
- //ignore
- }
+ getActionSite().getStructuredViewer().refresh();
}
}
);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -29,7 +29,7 @@
private ButtonPressedAction buttonAction = new
ButtonPressedAction(SeamUIMessages.BUTTON_FIELD_EDITOR_BROWSE) {
@Override
public void run() {
- throw new RuntimeException(SeamUIMessages.BUTTON_FIELD_EDITOR_NOT_IMPLEMENTED_YET);
+ throw new
IllegalStateException(SeamUIMessages.BUTTON_FIELD_EDITOR_NOT_IMPLEMENTED_YET);
}
};
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/LinkFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/LinkFieldEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/LinkFieldEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -12,7 +12,7 @@
private ButtonPressedAction buttonAction = new
ButtonPressedAction(SeamUIMessages.BUTTON_FIELD_EDITOR_BROWSE) {
@Override
public void run() {
- throw new RuntimeException(SeamUIMessages.BUTTON_FIELD_EDITOR_NOT_IMPLEMENTED_YET);
+ throw new
IllegalStateException(SeamUIMessages.BUTTON_FIELD_EDITOR_NOT_IMPLEMENTED_YET);
}
};
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -170,8 +170,6 @@
result = new Status(IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,e.getMessage(),e);
} catch (CoreException e) {
result = new Status(IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,e.getMessage(),e);
- } catch(Exception e) {
- result = new Status(IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,e.getMessage(),e);
}
finally {
try {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesEditor.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesEditor.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -3,6 +3,7 @@
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.jboss.tools.common.editor.AbstractSelectionProvider;
import org.jboss.tools.common.editor.ObjectMultiPageEditor;
@@ -65,7 +66,7 @@
selectionProvider.setHost(guiEditor.getSelectionProvider());
guiEditor.addErrorSelectionListener(createErrorSelectionListener());
selectionProvider.addHost("guiEditor", guiEditor.getSelectionProvider());
- } catch(Exception ex) {
+ } catch(PartInitException ex) {
SeamUiPagesPlugin.getDefault().logError(ex);
}
}
Modified:
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/struts/plugins/org.jboss.tools.struts.ui/src/org/jboss/tools/struts/ui/internal/action/AddStrutsNatureActionDelegate.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -11,23 +11,23 @@
package org.jboss.tools.struts.ui.internal.action;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.wizard.IWizard;
import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.model.ui.util.ExtensionPointUtils;
-import org.eclipse.jface.wizard.IWizard;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.action.AddNatureActionDelegate;
+import org.jboss.tools.common.model.ui.util.ExtensionPointUtils;
import org.jboss.tools.struts.StrutsProjectUtil;
import org.jboss.tools.struts.ui.StrutsUIPlugin;
import org.jboss.tools.struts.ui.wizard.project.ImportProjectWizard;
public class AddStrutsNatureActionDelegate extends AddNatureActionDelegate {
- protected IWizard getWizard(IProject project) throws Exception {
+ protected IWizard getWizard(IProject project) {
ImportProjectWizard wizard =
(ImportProjectWizard)ExtensionPointUtils.findImportWizardsItem(
StrutsUIPlugin.PLUGIN_ID,
"org.jboss.tools.struts.ui.wizard.project.ImportProjectWizard"
);
- if (wizard == null) throw new Exception("Wizard
org.jboss.tools.common.model.ui.wizards.ImportProjectWizard is not found.");
+ if (wizard == null) throw new IllegalArgumentException("Wizard
org.jboss.tools.common.model.ui.wizards.ImportProjectWizard is not found.");
wizard.setInitialName(project.getName());
wizard.setInitialLocation(findWebXML(project.getLocation().toString()));
wizard.init(ModelUIPlugin.getDefault().getWorkbench(), null);
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -27,6 +27,7 @@
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
+import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.jst.jsp.editor.IVisualContext;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
@@ -87,12 +88,8 @@
IDocument document = sourceBuilder.getStructuredTextViewer().getDocument();
try {
connector =
(WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR,
document);
- } catch (InstantiationException e) {
+ } catch (KbException e) {
VpePlugin.getPluginLog().logError(e);
- } catch (IllegalAccessException e) {
- VpePlugin.getPluginLog().logError(e);
- } catch (ClassNotFoundException e) {
- VpePlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-28
20:56:59 UTC (rev 9948)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2008-08-29
00:21:46 UTC (rev 9949)
@@ -23,6 +23,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.editors.text.ILocationProvider;
import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.common.componentcore.ComponentCore;
@@ -82,39 +83,41 @@
*/
public static IFile getFile(String fileName, IFile includeFile) {
IFile file = null;
- if(fileName.startsWith("/")) { //$NON-NLS-1$
- try {
- ResourceReference[] resources =
AbsoluteFolderReferenceList.getInstance().getAllResources(includeFile);
- if(resources!=null && resources.length==1) {
- String location =resources[0].getLocation()+fileName;
- IPath path=new Path(location);
- return ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- }else {
- WebArtifactEdit edit =
- WebArtifactEdit.getWebArtifactEditForRead(includeFile.getProject());
- IVirtualComponent com = ComponentCore.createComponent(includeFile.getProject());
- IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new
Path("/"));
- IContainer folder = webRootFolder.getUnderlyingFolder();
- IPath path = folder.getFullPath().append(fileName);
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }catch (Exception ex) {
- // do nothing that means include will shown as text region with included file name
+ if (fileName.startsWith("/")) { //$NON-NLS-1$
+ ResourceReference[] resources = AbsoluteFolderReferenceList
+ .getInstance().getAllResources(includeFile);
+ if (resources != null && resources.length == 1) {
+ String location = resources[0].getLocation() + fileName;
+ IPath path = new Path(location);
+ return ResourcesPlugin.getWorkspace().getRoot()
+ .getFileForLocation(path);
+ } else {
+ WebArtifactEdit edit = WebArtifactEdit
+ .getWebArtifactEditForRead(includeFile.getProject());
+ IVirtualComponent com = ComponentCore
+ .createComponent(includeFile.getProject());
+ IVirtualFolder webRootFolder = com.getRootFolder().getFolder(
+ new Path("/"));
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ IPath path = folder.getFullPath().append(fileName);
+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
}
- } else {
- ResourceReference[] resources =
RelativeFolderReferenceList.getInstance().getAllResources(includeFile);
- if ((resources != null) && resources.length == 1) {
- String location = resources[0].getLocation() +
File.separator+fileName;
- IPath path = new Path(location);
- //new File(location);
- return
ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);//ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- } else {
- IPath currentFolder = includeFile.getParent().getFullPath();
- IPath path = currentFolder.append(fileName);
- file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- }
- }
- return file;
+ } else {
+ ResourceReference[] resources = RelativeFolderReferenceList
+ .getInstance().getAllResources(includeFile);
+ if ((resources != null) && resources.length == 1) {
+ String location = resources[0].getLocation() + File.separator
+ + fileName;
+ IPath path = new Path(location);
+ return ResourcesPlugin.getWorkspace().getRoot()
+ .getFileForLocation(path);
+ } else {
+ IPath currentFolder = includeFile.getParent().getFullPath();
+ IPath path = currentFolder.append(fileName);
+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ }
+ }
+ return file;
}
/**
@@ -129,7 +132,7 @@
if (file != null) {
IDE.openEditor(workbenchPage, file, true);
}
- } catch (Exception ex) {
+ } catch (PartInitException ex) {
VpePlugin.reportProblem(ex);
}