Author: rob.stryker(a)jboss.com
Date: 2009-01-14 00:42:59 -0500 (Wed, 14 Jan 2009)
New Revision: 13026
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JMXProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerLogActionProvider.java
Log:
slight efficiency improvement in locating the proper node
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JMXProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JMXProvider.java 2009-01-14
02:10:34 UTC (rev 13025)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JMXProvider.java 2009-01-14
05:42:59 UTC (rev 13026)
@@ -72,16 +72,12 @@
selection = (IStructuredSelection) wsSite.getSelectionProvider()
.getSelection();
}
- if( selection != null && selection.toArray().length == 1 ) {
+
+ IContributionItem quick =
menu.find("org.eclipse.ui.navigate.showInQuickMenu");
+ if( quick != null && selection != null && selection.toArray().length
== 1 ) {
if( selection.getFirstElement() instanceof IServer ) {
if( menu instanceof MenuManager ) {
- MenuManager mgr = (MenuManager)menu;
- IContributionItem[] items = mgr.getItems();
- for( int i = 0; i < items.length; i++ ) {
- if( "org.eclipse.ui.navigate.showInQuickMenu".equals(items[i].getId()))
{
- ((MenuManager)items[i]).add(showInJMXViewAction);
- }
- }
+ ((MenuManager)quick).add(showInJMXViewAction);
}
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerLogActionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerLogActionProvider.java 2009-01-14
02:10:34 UTC (rev 13025)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerLogActionProvider.java 2009-01-14
05:42:59 UTC (rev 13026)
@@ -57,16 +57,11 @@
selection = (IStructuredSelection) wsSite.getSelectionProvider()
.getSelection();
}
- if( selection != null && selection.toArray().length == 1 ) {
+ IContributionItem quick =
menu.find("org.eclipse.ui.navigate.showInQuickMenu");
+ if( quick != null && selection != null && selection.toArray().length ==
1 ) {
if( selection.getFirstElement() instanceof IServer ) {
if( menu instanceof MenuManager ) {
- MenuManager mgr = (MenuManager)menu;
- IContributionItem[] items = mgr.getItems();
- for( int i = 0; i < items.length; i++ ) {
- if( "org.eclipse.ui.navigate.showInQuickMenu".equals(items[i].getId()))
{
- ((MenuManager)items[i]).add(showInServerLogAction);
- }
- }
+ ((MenuManager)quick).add(showInServerLogAction);
}
}
}
Show replies by date