Author: rob.stryker(a)jboss.com
Date: 2007-09-27 03:40:30 -0400 (Thu, 27 Sep 2007)
New Revision: 3855
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
Log:
changes will not be seen by anyone (extension commented out for release)
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java 2007-09-27
07:40:28 UTC (rev 3854)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/AttributeGroup.java 2007-09-27
07:40:30 UTC (rev 3855)
@@ -38,7 +38,6 @@
public class AttributeGroup extends Composite {
- protected Group group;
protected Tree tree;
protected TreeColumn nameColumn, typeColumn, accessColumn, valueColumn,
descriptionColumn;
@@ -49,9 +48,6 @@
super(parent, style);
this.page = page;
setLayout(new FillLayout());
-// group = new Group(this, SWT.NONE);
-// group.setText("Attributes");
-// group.setLayout(new FillLayout());
tree = new Tree(this, SWT.BORDER | SWT.FULL_SELECTION);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java 2007-09-27
07:40:28 UTC (rev 3854)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXPropertySheetPage.java 2007-09-27
07:40:30 UTC (rev 3855)
@@ -25,7 +25,6 @@
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.WrappedMBeanOperationInfo;
import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
import
org.jboss.ide.eclipse.as.ui.views.server.providers.jmx.JMXViewProvider.ErrorGroup;
-import
org.jboss.ide.eclipse.as.ui.views.server.providers.jmx.JMXViewProvider.OperationGroup;
public class JMXPropertySheetPage implements IPropertySheetPage {
@@ -35,7 +34,7 @@
protected WrappedMBeanOperationInfo[] operations;
// ui pieces
- protected Composite main;
+ protected Composite main, domainGroup;
protected Combo pulldown;
protected Label beanLabel;
protected PageBook book;
@@ -95,8 +94,9 @@
book.setLayoutData(bookData);
errorGroup = new ErrorGroup(book, SWT.NONE);
- operationGroup = new OperationGroup(book, SWT.NONE);
+ operationGroup = new OperationGroup(book, SWT.NONE, this);
attributeGroup = new AttributeGroup(book, SWT.NONE, this);
+ domainGroup = new Composite(book, SWT.NONE);
}
public void dispose() {
@@ -222,7 +222,7 @@
}
protected void showDomainComposite(JMXDomain domain) {
- // nothing
+ book.showPage(domainGroup);
}
protected void showErrorComposite() {
@@ -240,8 +240,17 @@
String selected = pulldown
.getItem(pulldown.getSelectionIndex());
book.showPage(operationGroup);
+ operationGroup.setOperation(findOperation(bean, selected));
}
}
}
+ protected WrappedMBeanOperationInfo findOperation(JMXBean bean, String selected) {
+ WrappedMBeanOperationInfo[] opInfos = bean.getOperations();
+ for( int i = 0; i < opInfos.length; i++ ) {
+ if( getStringForOperation(opInfos[i]).equals(selected))
+ return opInfos[i];
+ }
+ return null;
+ }
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2007-09-27
07:40:28 UTC (rev 3854)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/JMXViewProvider.java 2007-09-27
07:40:30 UTC (rev 3855)
@@ -171,16 +171,4 @@
group.setText("Error");
}
}
-
- protected static class OperationGroup extends Composite {
- protected Group group;
- public OperationGroup(Composite parent, int style) {
- super(parent, style);
- setLayout(new FillLayout());
- group = new Group(this, SWT.NONE);
- group.setText("Operation");
- }
- }
-
-
}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/OperationGroup.java 2007-09-27
07:40:30 UTC (rev 3855)
@@ -0,0 +1,130 @@
+package org.jboss.ide.eclipse.as.ui.views.server.providers.jmx;
+
+import javax.management.MBeanParameterInfo;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.WrappedMBeanOperationInfo;
+
+public class OperationGroup extends Composite {
+ protected Tree tree;
+ protected TreeColumn nameColumn, typeColumn,
+ valueColumn, descriptionColumn;
+ protected TreeViewer treeViewer;
+ protected JMXPropertySheetPage page;
+ protected Button executeButton;
+
+ public OperationGroup(Composite parent, int style, JMXPropertySheetPage page) {
+ super(parent, style);
+ this.page = page;
+ setLayout(new FormLayout());
+
+ executeButton = new Button(this, SWT.PUSH);
+ executeButton.setText("execute");
+ FormData executeData = new FormData();
+ executeData.right = new FormAttachment(100,0);
+ executeData.top = new FormAttachment(0,0);
+ executeData.bottom = new FormAttachment(100,0);
+ executeButton.setLayoutData(executeData);
+
+
+ tree = new Tree(this, SWT.BORDER | SWT.FULL_SELECTION);
+ FormData treeData = new FormData();
+ treeData.left = new FormAttachment(0,0);
+ treeData.right = new FormAttachment(executeButton, 0);
+ treeData.top = new FormAttachment(0,0);
+ treeData.bottom = new FormAttachment(100,0);
+ tree.setLayoutData(treeData);
+
+
+ nameColumn = new TreeColumn(tree, SWT.NONE);
+ typeColumn = new TreeColumn(tree, SWT.NONE);
+ valueColumn = new TreeColumn(tree, SWT.NONE);
+ descriptionColumn = new TreeColumn(tree, SWT.NONE);
+
+ nameColumn.setWidth(100);
+ typeColumn.setWidth(150);
+ valueColumn.setWidth(200);
+ descriptionColumn.setWidth(300);
+
+ nameColumn.setText("Name");
+ typeColumn.setText("Type");
+ valueColumn.setText("Value");
+ descriptionColumn.setText("Description");
+
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ treeViewer = new TreeViewer(tree);
+ treeViewer.setContentProvider(new OperationViewerContentProvider());
+ treeViewer.setLabelProvider(new OperationViewerLabelProvider());
+
+// JMXAttributePropertySelListener selListener = new JMXOperationPropertySelListener();
+// tree.addListener(SWT.MouseDoubleClick, selListener);
+
+ }
+
+ protected class OperationViewerContentProvider implements
+ ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement != null && parentElement instanceof
WrappedMBeanOperationInfo ) {
+ return ((WrappedMBeanOperationInfo)parentElement).getInfo().getSignature();
+ }
+ return new Object[] {};
+ }
+ public Object getParent(Object element) {
+ return null;
+ }
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+ public void dispose() {
+ }
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+
+
+ protected class OperationViewerLabelProvider extends LabelProvider
+ implements ITableLabelProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if( element instanceof MBeanParameterInfo ) {
+ MBeanParameterInfo info = (MBeanParameterInfo)element;
+ if( columnIndex == 0 ) return info.getName();
+ if( columnIndex == 1 ) return info.getType();
+ if( columnIndex == 2 ) return "";
+ if( columnIndex == 3 ) return info.getDescription();
+ }
+ return "";
+ }
+
+ }
+
+ public void setOperation(WrappedMBeanOperationInfo op) {
+ treeViewer.setInput(op);
+ }
+
+}