Author: scabanovich
Date: 2007-09-13 10:06:29 -0400 (Thu, 13 Sep 2007)
New Revision: 3609
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
Log:
JBIDE-893
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-09-13
13:55:43 UTC (rev 3608)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XmlEditorPlugin.java 2007-09-13
14:06:29 UTC (rev 3609)
@@ -99,7 +99,9 @@
Method m =
AbstractUIPlugin.class.getDeclaredMethod("initializeDefaultPluginPreferences",
new Class[0]);
m.setAccessible(true);
m.invoke(JavaPlugin.getDefault(), new Object[0]);
- } catch (Exception e) {}
+ } catch (Exception e) {
+ //ignore
+ }
IPreferenceStore store = getPreferenceStore();
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java 2007-09-13
13:55:43 UTC (rev 3608)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/FreeCaretStyledText.java 2007-09-13
14:06:29 UTC (rev 3609)
@@ -70,7 +70,7 @@
try {
super.redrawRange(start, length, clearBackground);
} catch (Exception x) {
-
+ //ignore
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java 2007-09-13
13:55:43 UTC (rev 3608)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/ui/xpl/XmlPreferenceConstants.java 2007-09-13
14:06:29 UTC (rev 3609)
@@ -12,16 +12,19 @@
*******************************************************************************/
package org.jboss.tools.common.text.xml.ui.xpl;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jdt.internal.core.ModelUpdater;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.jboss.tools.common.text.xml.XmlEditorPlugin;
/**
* @author Jeremy
@@ -163,7 +166,15 @@
Method m =
AbstractUIPlugin.class.getDeclaredMethod("initializeDefaultPluginPreferences",
new Class[0]);
m.setAccessible(true);
m.invoke(plugin, new Object[0]);
- } catch (Exception e) {}
+ } catch (NoSuchMethodException e1) {
+ //ignore
+ } catch (IllegalAccessException e2) {
+ //ignore
+ } catch (IllegalArgumentException e3) {
+ XmlEditorPlugin.getPluginLog().logError(e3);
+ } catch (InvocationTargetException e4) {
+ XmlEditorPlugin.getPluginLog().logError(e4);
+ }
final IPreferenceStore editorsStore = ((AbstractUIPlugin)plugin).getPreferenceStore();
for (int i = 0; i < BOOLEAN_PROPERTIES.length; i++) {
String p = BOOLEAN_PROPERTIES[i];
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-09-13
13:55:43 UTC (rev 3608)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/xpl/ToggleOccurencesMarkUpAction.java 2007-09-13
14:06:29 UTC (rev 3609)
@@ -102,10 +102,11 @@
String relPath= getString(bundle, imageKey, null);
try {
- ImageDescriptor id=
ImageDescriptor.createFromURL(makeIconFileURL("resources/icons/xpl", relPath));
//$NON-NLS-1$
+ ImageDescriptor id =
ImageDescriptor.createFromURL(makeIconFileURL("resources/icons/xpl", relPath));
//$NON-NLS-1$
if (id != null)
setImageDescriptor(id);
} catch (MalformedURLException e) {
+ //ignore
}
relPath= getString(bundle, disabledImageKey, null);
@@ -114,6 +115,7 @@
if (id != null)
setDisabledImageDescriptor(id);
} catch (MalformedURLException e) {
+ //ignore
}
}
@@ -128,6 +130,7 @@
markOccurences = fPreferenceStore.getBoolean(fKey);
fPreferenceStore.setValue(fKey, !markOccurences);
} catch (Exception x) {
+ //ignore
}
}
@@ -149,19 +152,16 @@
fPreferenceStore.addPropertyChangeListener(this);
}
} catch (Exception x) {
+ //ignore
}
boolean markOccurences = false;
boolean enabled = false;
- try {
-
- // determine if action should be enabled or not
- if(fPreferenceStore!=null) {
- markOccurences = fPreferenceStore.getBoolean(fKey);
- }
- enabled = (getTextEditor() != null);
- } catch (Exception x) {
+ // determine if action should be enabled or not
+ if(fPreferenceStore != null) {
+ markOccurences = fPreferenceStore.getBoolean(fKey);
}
+ enabled = (getTextEditor() != null);
setChecked(markOccurences);
setEnabled(enabled);
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-09-13
13:55:43 UTC (rev 3608)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/jst/jsp/text/xpl/DefaultStructuredTextOccurrenceStructureProvider.java 2007-09-13
14:06:29 UTC (rev 3609)
@@ -415,6 +415,7 @@
fEditorID));
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
@@ -595,10 +596,12 @@
if (fMarkNodeOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagOccurencies(matches, xmlNode, tagName);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -626,10 +629,12 @@
if (fMarkAttributeOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagAttrNameOccurencies(matches, xmlNode, attrName);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -661,11 +666,12 @@
if (fMarkAttributeValueOccurrences) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTagAttrValueOccurencies(matches, xmlNode, attrValue);
} catch (Exception x) {
-
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}
@@ -698,10 +704,12 @@
if (fMarkTextOccurrences && !isEmptyString (data)) {
NodeList children = (NodeContainer)dom.getChildNodes();
for (int i = 0; children != null && i < children.getLength(); i++) {
+ if(!(children.item(i) instanceof IDOMNode)) continue;
try {
IDOMNode xmlNode = (IDOMNode)children.item(i);
addTextOccurencies(matches, xmlNode, data);
} catch (Exception x) {
+ XmlEditorPlugin.getPluginLog().logError(x);
}
}
}