Author: scabanovich
Date: 2007-09-11 10:56:20 -0400 (Tue, 11 Sep 2007)
New Revision: 3562
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiImages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddCapabilitiesActionDelegate.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/JSFMultiPageContributor.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/adopt/JSPAdopt.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditorMessages.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/dnd/DndHelper.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFElement.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java
Log:
JBIDE-895
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiImages.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiImages.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiImages.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -36,7 +36,7 @@
);
} catch (MalformedURLException e) {
-
+ JsfUiPlugin.getPluginLog().logError(e);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddCapabilitiesActionDelegate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddCapabilitiesActionDelegate.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/AddCapabilitiesActionDelegate.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -16,17 +16,13 @@
import org.jboss.tools.common.model.ui.action.file.ProjectRootActionDelegate;
public class AddCapabilitiesActionDelegate extends ProjectRootActionDelegate {
+
protected String getActionPath() {
return "EclipseActions.AddCustomJSFCapabilities";
}
protected boolean hasModelNature(IProject project) {
- try {
- if(EclipseResourceUtil.getModelNature(project) != null) return true;
- } catch (Exception e) {
- //ignore
- }
- return false;
+ return EclipseResourceUtil.getModelNature(project) != null;
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/JSFMultiPageContributor.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/JSFMultiPageContributor.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/action/JSFMultiPageContributor.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -25,6 +25,7 @@
import org.eclipse.ui.ide.IDEActionFactory;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.common.gef.action.ActionRegistrySupport;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jsf.ui.editor.FacesConfigGuiEditor;
import org.jboss.tools.jsf.ui.editor.actions.JSFCutRetargetAction;
@@ -120,10 +121,12 @@
}
try {
- fToggleOccurencesMarkUp.setEditor(getTextEditor(part));
- fToggleOccurencesMarkUp.update();
+ if(fToggleOccurencesMarkUp != null) {
+ fToggleOccurencesMarkUp.setEditor(getTextEditor(part));
+ fToggleOccurencesMarkUp.update();
+ }
} catch (Exception x) {
- //ignore
+ JsfUiPlugin.getPluginLog().logError(x);
}
updateStatus();
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/adopt/JSPAdopt.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/adopt/JSPAdopt.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/adopt/JSPAdopt.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -56,8 +56,11 @@
String bundle = getBundle(object.getParent());
int pos = -1;
try {
- pos = Integer.parseInt(p.getProperty("pos"));
- } catch (Exception e) {}
+ String s = p.getProperty("pos");
+ if(s != null && s.length() > 0) pos = Integer.parseInt(s);
+ } catch (Exception e) {
+ JsfUiPlugin.getPluginLog().logError(e);
+ }
SourceViewer viewer = (SourceViewer)p.get("viewer");
JSPTokenizer tokenizer = new JSPTokenizer();
@@ -112,7 +115,9 @@
viewer.getDocument().replace(pos, 0, start);
viewer.setSelectedRange(pos, 0);
viewer.getTextWidget().setFocus();
- } catch (Exception e) {}
+ } catch (Exception e) {
+ JsfUiPlugin.getPluginLog().logError(e);
+ }
p.remove("start text");
}
@@ -158,8 +163,11 @@
int pos = -1;
try {
- pos = Integer.parseInt(p.getProperty("pos"));
- } catch (Exception e) {}
+ String s = p.getProperty("pos");
+ if(s != null && s.length() > 0) pos = Integer.parseInt(s);
+ } catch (Exception e) {
+ JsfUiPlugin.getPluginLog().logError(e);
+ }
SourceViewer viewer = (SourceViewer)p.get("viewer");
JSPTokenizer tokenizer = new JSPTokenizer();
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditorMessages.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditorMessages.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/FacesConfigEditorMessages.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -15,6 +15,7 @@
import java.util.ResourceBundle;
import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
/**
* @author Igels
@@ -56,6 +57,7 @@
fResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault());
}
catch (MissingResourceException x) {
+ JsfUiPlugin.getPluginLog().logError(x);
fResourceBundle = null;
}
return fResourceBundle;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/JSFEditor.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -110,6 +110,7 @@
import org.jboss.tools.common.reporting.ProblemReportingHelper;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.model.helpers.JSFProcessStructureHelper;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jsf.ui.editor.actions.JSFCopyAction;
import org.jboss.tools.jsf.ui.editor.actions.JSFCutAction;
import org.jboss.tools.jsf.ui.editor.actions.JSFDeleteAction;
@@ -173,6 +174,7 @@
if (delta != null)
delta.accept(this);
} catch (CoreException exception) {
+ JsfUiPlugin.getPluginLog().logError(exception);
// What should be done here?
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/dnd/DndHelper.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/dnd/DndHelper.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/dnd/DndHelper.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -18,6 +18,7 @@
import org.eclipse.draw2d.geometry.Point;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.meta.action.XAction;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
public class DndHelper{
@@ -40,6 +41,7 @@
try {
copy.executeHandler((XModelObject) source, properties);
} catch (Exception e) {
+ JsfUiPlugin.getPluginLog().logError(e);
XModelTransferBuffer.getInstance().disable();
return false;
}
@@ -63,7 +65,7 @@
try {
DnDUtil.paste((XModelObject) target, properties);
} catch (Exception ex) {
- //ignore
+ JsfUiPlugin.getPluginLog().logError(ex);
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/commands/JSFCompoundCommand.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -18,6 +18,7 @@
import org.jboss.tools.common.meta.action.XAction;
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
public class JSFCompoundCommand extends Command {
private List<Object> elements = new ArrayList<Object>();
@@ -38,6 +39,7 @@
if(action != null) return true;
else return false;
}catch(Exception ex){
+ JsfUiPlugin.getPluginLog().logError(ex);
return false;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFElement.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFElement.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/JSFElement.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -23,6 +23,7 @@
import org.jboss.tools.common.model.*;
import org.jboss.tools.common.meta.*;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jsf.ui.editor.model.IJSFElement;
import org.jboss.tools.jsf.ui.editor.model.IJSFModel;
@@ -116,6 +117,7 @@
if (oldValue == null ||!oldValue.equals(newValue))
getJSFModel().setModified(true);
} catch (Exception exception) {
+ JsfUiPlugin.getPluginLog().logError(exception);
if (newValue != null)
getJSFModel().setModified(true);
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java 2007-09-11
14:50:51 UTC (rev 3561)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/model/impl/Segment.java 2007-09-11
14:56:20 UTC (rev 3562)
@@ -10,8 +10,11 @@
******************************************************************************/
package org.jboss.tools.jsf.ui.editor.model.impl;
+import java.beans.PropertyVetoException;
+
import org.w3c.dom.*;
+import org.jboss.tools.jsf.ui.JsfUiPlugin;
import org.jboss.tools.jsf.ui.editor.model.ILink;
import org.jboss.tools.jsf.ui.editor.model.ISegment;
@@ -23,9 +26,17 @@
super(parent);
try {
setName("SEGMENT");
- length = Integer.parseInt(segmentElement.getAttribute("length"));
+ String s = segmentElement.getAttribute("length");
+ if(s == null || s.length() == 0) {
+ length = 0;
+ } else {
+ length = Integer.parseInt(s);
+ }
+ } catch(PropertyVetoException exception) {
+ length = 0;
} catch(Exception exception) {
- length = 0;
+ length = 0;
+ JsfUiPlugin.getPluginLog().logError(exception);
}
this.prevSegment = prevSegment;
if(prevSegment!=null)
@@ -37,7 +48,7 @@
try {
setName("SEGMENT");
this.length = length;
- } catch(Exception exception) {
+ } catch(PropertyVetoException exception) {
length = 0;
}