JBoss Tools SVN: r3681 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: afrancuzov
Date: 2007-09-18 07:40:59 -0400 (Tue, 18 Sep 2007)
New Revision: 3681
Added:
trunk/documentation/qa/QA test report JSF1.1RI and JSF 1.2.xls
Log:
Added: trunk/documentation/qa/QA test report JSF1.1RI and JSF 1.2.xls
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/QA test report JSF1.1RI and JSF 1.2.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r3680 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: afrancuzov
Date: 2007-09-18 06:37:06 -0400 (Tue, 18 Sep 2007)
New Revision: 3680
Added:
trunk/documentation/qa/QA test report Build RF3.1.0 RC5.xls
Log:
Added: trunk/documentation/qa/QA test report Build RF3.1.0 RC5.xls
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/QA test report Build RF3.1.0 RC5.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r3679 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 06:33:18 -0400 (Tue, 18 Sep 2007)
New Revision: 3679
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
Log:
JBIDE-905
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-09-18 10:09:23 UTC (rev 3678)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-09-18 10:33:18 UTC (rev 3679)
@@ -10,7 +10,12 @@
******************************************************************************/
package org.jboss.tools.common.core.resources;
+import java.io.File;
import java.lang.reflect.Field;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -166,7 +171,26 @@
if(input instanceof IModelObjectEditorInput) return input;
if(input instanceof ILocationProvider) return convertExternalInput((ILocationProvider)input);
if(input instanceof IFileEditorInput) return convertFileInput((IFileEditorInput)input);
- if(input instanceof IStorageEditorInput) return convertStorageEditorInput((IStorageEditorInput)input);
+ if(input instanceof IStorageEditorInput) return convertStorageEditorInput((IStorageEditorInput)input);
+ if(input instanceof IURIEditorInput) {
+ URI uri = ((IURIEditorInput)input).getURI();
+ URL url = null;
+ try {
+ url = uri.toURL();
+ } catch (MalformedURLException e) {
+ return input;
+ }
+ if(url == null) return input;
+ String f = url.getFile();
+ XModelObject o = null;
+ try {
+ o = EclipseResourceUtil.createObjectForLocation(f);
+ if(o != null && o.getFileType() != XModelObject.FILE) o = null;
+ } catch (Exception e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ }
+ return (o == null) ? (IEditorInput)input : new ModelObjectLocationEditorInput(getMainObject(o), new Path(f));
+ }
return input;
}
17 years, 3 months
JBoss Tools SVN: r3678 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 06:09:23 -0400 (Tue, 18 Sep 2007)
New Revision: 3678
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
Log:
JBIDE-905
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2007-09-18 10:00:32 UTC (rev 3677)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2007-09-18 10:09:23 UTC (rev 3678)
@@ -158,6 +158,7 @@
}
private void loadSelectedTabForStorage() {
+ if(object == null) return;
String path = object.getPath();
QualifiedName qn = new QualifiedName("", "Selected_tab_" + path);
IProject p = EclipseResourceUtil.getProject(object);
@@ -188,10 +189,11 @@
}
private void saveSelectedTabForStorage() {
+ if(object == null) return;
+ IProject p = EclipseResourceUtil.getProject(object);
+ if(p == null || !p.isOpen()) return;
String path = object.getPath();
QualifiedName qn = new QualifiedName("", "Selected_tab_" + path);
- IProject p = EclipseResourceUtil.getProject(object);
- if(p == null || !p.isOpen()) return;
try {
p.setPersistentProperty(qn, "" + selectedPageIndex);
} catch (CoreException e) {
17 years, 3 months
JBoss Tools SVN: r3677 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 06:00:32 -0400 (Tue, 18 Sep 2007)
New Revision: 3677
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
Log:
JBIDE-905
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2007-09-18 09:44:30 UTC (rev 3676)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2007-09-18 10:00:32 UTC (rev 3677)
@@ -146,8 +146,8 @@
private void loadSelectedTab() {
IFile file = getFile();
try {
- String q = file.getPersistentProperty(persistentTabQualifiedName);
- if (q == null)
+ String q = (file == null) ? null : file.getPersistentProperty(persistentTabQualifiedName);
+ if (q == null) {
if ("Source".equalsIgnoreCase(VpePreference.EDITOR_VIEW_OPTION
.getValue()))
selectedPageIndex = 2;
@@ -157,7 +157,7 @@
selectedPageIndex = 1;
else
selectedPageIndex = 0;
- else {
+ } else {
int qi = Integer.parseInt(q);
if (qi >= 0 && qi < getTabFolder().getItemCount())
@@ -175,6 +175,7 @@
private void saveSelectedTab() {
IFile file = getFile();
+ if(file == null) return;
String q = "" + selectedPageIndex;
try {
file.setPersistentProperty(persistentTabQualifiedName, q);
@@ -253,9 +254,9 @@
}
private void updateFile() {
+ IFile file = getFile();
+ if (file == null) return;
try {
- IFile file = getFile();
- if (file != null)
file.refreshLocal(0, null);
} catch (CoreException e) {
JspEditorPlugin.getPluginLog().logWarning(e);
17 years, 3 months
JBoss Tools SVN: r3676 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/run.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 05:44:30 -0400 (Tue, 18 Sep 2007)
New Revision: 3676
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/run/IPathSourceImpl.java
Log:
JBIDE-908
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/run/IPathSourceImpl.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/run/IPathSourceImpl.java 2007-09-18 09:43:05 UTC (rev 3675)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/run/IPathSourceImpl.java 2007-09-18 09:44:30 UTC (rev 3676)
@@ -35,6 +35,7 @@
String f = getPath(object);
if(f == null) return null;
String bp = context.getBrowserPrefix(model);
+ if(bp == null) return null;
String path = JSFWebProject.getInstance(model).getUrlPattern().getJSFUrl(f);
String url = (path == null) ? null
: (bp.endsWith("/") && path.startsWith("/"))
17 years, 3 months
JBoss Tools SVN: r3675 - trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 05:43:05 -0400 (Tue, 18 Sep 2007)
New Revision: 3675
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/IPathSourceImpl.java
Log:
JBIDE-908
Modified: trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/IPathSourceImpl.java
===================================================================
--- trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/IPathSourceImpl.java 2007-09-18 09:41:47 UTC (rev 3674)
+++ trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/handlers/page/IPathSourceImpl.java 2007-09-18 09:43:05 UTC (rev 3675)
@@ -37,6 +37,7 @@
if(isPage) object = StrutsProcessStructureHelper.instance.getPhysicalPage(object);
XModel model = object.getModel();
String bp = context.getBrowserPrefix(model);
+ if(bp == null) return null;
String path = (isRoot) ? "/"
: (isForward) ? getCompleteForwardPath(object)
: (isAction) ? getCompleteActionPath(object)
17 years, 3 months
JBoss Tools SVN: r3674 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/browser/wtp.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-18 05:41:47 -0400 (Tue, 18 Sep 2007)
New Revision: 3674
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/browser/wtp/RunOnServerContext.java
Log:
JBIDE-908
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/browser/wtp/RunOnServerContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/browser/wtp/RunOnServerContext.java 2007-09-18 07:13:29 UTC (rev 3673)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/browser/wtp/RunOnServerContext.java 2007-09-18 09:41:47 UTC (rev 3674)
@@ -57,11 +57,7 @@
continue;
}
String classname = pathSources[i][0];
- try {
- ModelFeatureFactory.getInstance().createFeatureInstance(classname);
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
+ ModelFeatureFactory.getInstance().createFeatureInstance(classname);
}
}
@@ -79,6 +75,7 @@
if(server == null ) return "%server%" + WebUIMessages.CANNOT_RUN_SELECTION_WITHOUT_AVAILABLE_SERVER;
IProject p = EclipseResourceUtil.getProject(model.getRoot());
if(p != null && (!p.exists() || !p.isOpen())) p = null;
+ if(p == null) return null;
IModule ms = null;
try {
// TODO Ear project can contain several Web modules, so when ear is selected several options can be shown in
@@ -87,7 +84,6 @@
} catch (Exception e) {
WebModelPlugin.getPluginLog().logError(e);
}
-// WebResource wr = (ms == null || ms.length == 0) ? null : new WebResource(ms[0], new Path(""));
WebResource wr = (ms == null) ? null : new WebResource(ms, new Path("")); //$NON-NLS-1$
HttpLaunchable launchable = getLaunchable(server, wr);
17 years, 3 months
JBoss Tools SVN: r3673 - trunk/tests/features/org.jboss.tools.test.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-18 03:13:29 -0400 (Tue, 18 Sep 2007)
New Revision: 3673
Modified:
trunk/tests/features/org.jboss.tools.test.feature/feature.xml
Log:
fix JUnit tests errors
Failed to read project description file from location 'file:/qa/services/hudson/rhds-build/200709180046-nightly/tests/eclipse/plugins/org.jboss.tools.seam.ui.test_1.0.0.jar!/projects/TestComponentView/.project'.
org.eclipse.core.internal.resources.ResourceException()[567]: java.io.FileNotFoundException: file:/qa/services/hudson/rhds-build/200709180046-nightly/tests/eclipse/plugins/org.jboss.tools.seam.ui.test_1.0.0.jar!/projects/TestComponentView/.project (No such file or directory)
Modified: trunk/tests/features/org.jboss.tools.test.feature/feature.xml
===================================================================
--- trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2007-09-18 06:23:07 UTC (rev 3672)
+++ trunk/tests/features/org.jboss.tools.test.feature/feature.xml 2007-09-18 07:13:29 UTC (rev 3673)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.test_feature"
- label="Tools Tests"
- version="2.0.0">
-
- <description url="http://www.jboss.org/tools">
- JBossTools unit tests feature
- </description>
-
- <copyright>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.test_feature"
+ label="Tools Tests"
+ version="2.0.0">
+
+ <description url="http://www.jboss.org/tools">
+ JBossTools unit tests feature
+ </description>
+
+ <copyright>
Copyright (c) 2007 Exadel, Inc and 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:
-Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- </copyright>
-
- <license url="http://www.eclipse.org/legal/epl-v10.html">
+Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -214,93 +214,92 @@
No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose.
Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <plugin
- id="org.jboss.tools.common.kb.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.model.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.text.ext.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jsf.verification.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.mozilla.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.vpe.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.jst.web.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.seam.core.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.ui.test"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+litigation.
+ </license>
+
+ <plugin
+ id="org.jboss.tools.common.kb.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.model.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.common.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.text.ext.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jsf.verification.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.mozilla.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.vpe.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jst.web.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
17 years, 3 months
JBoss Tools SVN: r3672 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-18 02:23:07 -0400 (Tue, 18 Sep 2007)
New Revision: 3672
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/JMXViewProvider.java
Log:
Properties page being fleshed out.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/JMXViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/JMXViewProvider.java 2007-09-18 06:21:59 UTC (rev 3671)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/JMXViewProvider.java 2007-09-18 06:23:07 UTC (rev 3672)
@@ -1,112 +1,185 @@
package org.jboss.ide.eclipse.as.ui.views.server.providers;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.Arrays;
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerLifecycleListener;
import org.eclipse.wst.server.core.IServerListener;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerEvent;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXClassLoaderRepository;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXAttributesWrapper;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXBean;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXDomain;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXException;
+import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.WrappedMBeanOperationInfo;
+import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView;
+import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
+import org.jboss.ide.eclipse.as.ui.views.server.util.ViewUtilityMethods;
public class JMXViewProvider extends JBossServerViewExtension {
protected static final Object LOADING = new Object();
-
+ protected static final String[] LOADING_STRING_ARRAY = new String[] { "Loading..." };
+ protected static final String ATTRIBUTES_STRING = "Attributes...";
+
+ protected JMXPropertySheetPage propertyPage;
protected JMXServerLifecycleListener lcListener;
protected JMXServerListener serverListener;
protected JMXTreeContentProvider contentProvider;
protected JMXLabelProvider labelProvider;
protected IServer server;
protected JMXModel model;
+
public JMXViewProvider() {
model = new JMXModel();
-
+ addListeners();
+ }
+
+ protected void addListeners() {
+ JBossServerView.addExtensionFrameListener(
+ new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object o = JBossServerView.getDefault()
+ .getExtensionFrame().getViewer()
+ .getSelectedElement();
+ if (o instanceof JMXBean) {
+ ViewUtilityMethods.activatePropertiesView(null);
+ }
+ }
+ });
+
// make sure we know about server events
serverListener = new JMXServerListener();
lcListener = new JMXServerLifecycleListener();
ServerCore.addServerLifecycleListener(lcListener);
IServer[] servers = ServerCore.getServers();
- for( int i = 0; i < servers.length; i++ ) {
+ for (int i = 0; i < servers.length; i++) {
servers[i].addServerListener(serverListener);
}
+
}
-
- protected class JMXServerLifecycleListener implements IServerLifecycleListener {
+
+ protected class JMXServerLifecycleListener implements
+ IServerLifecycleListener {
public void serverAdded(IServer server) {
server.addServerListener(serverListener);
}
+
public void serverChanged(IServer server) {
}
+
public void serverRemoved(IServer server) {
server.removeServerListener(serverListener);
- JMXClassLoaderRepository.getDefault().
- removeConcerned(server, model);
+ JMXClassLoaderRepository.getDefault()
+ .removeConcerned(server, model);
}
}
-
-
+
protected class JMXServerListener implements IServerListener {
public void serverChanged(ServerEvent event) {
- if((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
- if((event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
- if( event.getState() == IServer.STATE_STARTED) {
- JMXClassLoaderRepository.getDefault().
- addConcerned(event.getServer(), model);
+ if ((event.getKind() & ServerEvent.SERVER_CHANGE) != 0) {
+ if ((event.getKind() & ServerEvent.STATE_CHANGE) != 0) {
+ if (event.getState() == IServer.STATE_STARTED) {
+ JMXClassLoaderRepository.getDefault().addConcerned(
+ event.getServer(), model);
} else {
- JMXClassLoaderRepository.getDefault().
- removeConcerned(event.getServer(), model);
+ JMXClassLoaderRepository.getDefault().removeConcerned(
+ event.getServer(), model);
}
}
}
}
}
-
+
+ public IPropertySheetPage getPropertySheetPage() {
+ if (propertyPage == null) {
+ propertyPage = new JMXPropertySheetPage(this);
+ }
+ return propertyPage;
+ }
+
public ITreeContentProvider getContentProvider() {
- if( contentProvider == null )
+ if (contentProvider == null)
contentProvider = new JMXTreeContentProvider();
return contentProvider;
}
+
public LabelProvider getLabelProvider() {
- if( labelProvider == null )
+ if (labelProvider == null)
labelProvider = new JMXLabelProvider();
return labelProvider;
}
-
+
class JMXLabelProvider extends LabelProvider {
public String getText(Object obj) {
- if( obj instanceof JMXDomain )
- return ((JMXDomain)obj).getName();
- if( obj instanceof JMXBean) {
- return ((JMXBean)obj).getName().substring(((JMXBean)obj).getDomain().length()+1);
+ if (obj instanceof JMXDomain)
+ return ((JMXDomain) obj).getName();
+ if (obj instanceof JMXBean) {
+ return ((JMXBean) obj).getName().substring(
+ ((JMXBean) obj).getDomain().length() + 1);
}
- if( obj == LOADING )
+ if (obj instanceof WrappedMBeanOperationInfo) {
+ return ((WrappedMBeanOperationInfo) obj).getInfo().getName();
+ }
+
+ if (obj instanceof JMXException) {
+ String message = "";
+ message += ((JMXException) obj).getException().getClass()
+ .getName()
+ + ": ";
+ message += ((JMXException) obj).getException().getMessage();
+ return message;
+ }
+ if (obj instanceof JMXAttributesWrapper) {
+ return "Attributes";
+ }
+ if (obj == LOADING)
return "loading...";
- return "not sure yet";
+ return "not sure yet: " + obj.getClass().getName();
}
+
public Image getImage(Object obj) {
+ if (obj instanceof JMXException) {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJS_ERROR_TSK);
+ }
+ if (obj instanceof WrappedMBeanOperationInfo)
+ return JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC);
+ if (obj instanceof JMXAttributesWrapper) {
+ return JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC);
+ }
+
return null;
}
@@ -115,257 +188,350 @@
public class JMXTreeContentProvider implements ITreeContentProvider {
public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof ServerViewProvider ) {
- if( server == null ) return new Object[]{};
- if( server.getServerState() != IServer.STATE_STARTED ) {
+ if (parentElement instanceof ServerViewProvider) {
+ if (server == null)
+ return new Object[] {};
+ if (server.getServerState() != IServer.STATE_STARTED) {
model.clearModel(server);
- return new Object[]{};
+ return new Object[] {};
}
JMXDomain[] domains = model.getModel(server).getDomains();
- if( domains == null ) {
- loadChildren(parentElement);
- return new Object[]{LOADING};
+ if (domains == null
+ && model.getModel(server).getException() == null) {
+ loadChildrenRefreshViewer(parentElement);
+ return new Object[] { LOADING };
+ } else if (domains == null
+ && model.getModel(server).getException() != null) {
+ return new Object[] { model.getModel(server).getException() };
}
return domains;
}
- if( parentElement instanceof JMXDomain ) {
- JMXBean[] beans = ((JMXDomain)parentElement).getBeans();
- if( beans == null ) {
- loadChildren(parentElement);
- return new Object[]{LOADING};
+ if (parentElement instanceof JMXDomain) {
+ JMXBean[] beans = ((JMXDomain) parentElement).getBeans();
+ if (beans == null
+ && ((JMXDomain) parentElement).getException() == null) {
+ loadChildrenRefreshViewer(parentElement);
+ return new Object[] { LOADING };
+ } else if (beans == null
+ && ((JMXDomain) parentElement).getException() != null) {
+ return new Object[] { ((JMXDomain) parentElement)
+ .getException() };
}
return beans;
}
+ if (parentElement instanceof JMXBean) {
+ WrappedMBeanOperationInfo[] operations = ((JMXBean) parentElement)
+ .getOperations();
+ if (operations == null
+ && ((JMXBean) parentElement).getException() == null) {
+ loadChildrenRefreshViewer(parentElement);
+ return new Object[] { LOADING };
+ } else if (operations == null
+ && ((JMXBean) parentElement).getException() != null) {
+ return new Object[] { ((JMXBean) parentElement)
+ .getException() };
+ }
+ // add the Attributes element
+ ArrayList<Object> list = new ArrayList<Object>();
+ list.add(new JMXAttributesWrapper((JMXBean) parentElement));
+ list.addAll(Arrays.asList(operations));
+ return (Object[]) list.toArray(new Object[list.size()]);
+ }
return new Object[0];
}
+
public Object getParent(Object element) {
return null; // unused
}
+
public boolean hasChildren(Object element) {
+ if (element instanceof ServerViewProvider) {
+ if (server == null
+ || server.getServerState() != IServer.STATE_STARTED) {
+ return false;
+ }
+ return true;
+ }
+ if (element instanceof JMXException)
+ return false;
+ if (element instanceof WrappedMBeanOperationInfo)
+ return false;
+ if (element instanceof JMXAttributesWrapper)
+ return false;
return true; // always true?
}
+
public Object[] getElements(Object inputElement) {
return null; // unused here
}
+
public void dispose() {
}
+
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if( oldInput != newInput ) {
- server = (IServer)newInput;
+ if (oldInput != newInput) {
+ server = (IServer) newInput;
}
}
-
- protected void loadChildren(final Object parent) {
- new Thread() {
- public void run() {
- if( parent instanceof ServerViewProvider )
- model.getModel(server).loadDomains();
- else if( parent instanceof JMXDomain )
- ((JMXDomain)parent).loadBeans();
- else if( parent instanceof JMXBean )
- ((JMXBean)parent).getName(); // temp
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- refreshViewer(parent);
- }
- });
- }
- }.start();
- }
-
}
-
-
-
-
-
-
- protected class JMXModel {
- protected HashMap<String, JMXModelRoot> root;
- public JMXModel() {
- root = new HashMap<String, JMXModelRoot>();
- }
- public JMXModelRoot getModel(IServer server) {
- if( root.get(server.getId()) == null ) {
- JMXModelRoot serverRoot = new JMXModelRoot(server);
- root.put(server.getId(), serverRoot);
+
+ protected void loadChildrenRefreshViewer(final Object parent) {
+ new Thread() {
+ public void run() {
+ loadChildren(parent);
+ refreshViewerAsync(parent);
}
- return root.get(server.getId());
+ }.start();
+ }
+
+ protected void loadChildren(Object parent) {
+ if (parent instanceof ServerViewProvider)
+ model.getModel(server).loadDomains();
+ else if (parent instanceof JMXDomain)
+ ((JMXDomain) parent).loadBeans();
+ else if (parent instanceof JMXBean)
+ ((JMXBean) parent).loadInfo();
+ }
+
+ protected void refreshViewerAsync(final Object parent) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ refreshViewer(parent);
+ }
+ });
+ }
+
+ public void refreshModel(Object object) {
+ if( object instanceof ContentWrapper )
+ object = ((ContentWrapper)object).getElement();
+ if (object instanceof ServerViewProvider) {
+ model.clearModel(server);
+ } else if (object instanceof JMXDomain) {
+ ((JMXDomain) object).resetChildren();
+ } else if (object instanceof JMXBean) {
+ ((JMXBean) object).resetChildren();
}
- public void clearModel(IServer server) {
- root.remove(server.getId());
- }
}
- protected static class JMXModelRoot {
- protected IServer server;
- protected JMXDomain[] domains = null;
- public JMXModelRoot(IServer server) {
- this.server = server;
+ public class JMXPropertySheetPage implements IPropertySheetPage {
+
+ // data
+ protected JMXViewProvider provider;
+ protected JMXBean bean;
+ protected WrappedMBeanOperationInfo[] operations;
+
+ // ui pieces
+ protected Composite main;
+ protected Combo pulldown;
+ protected PageBook book;
+ protected ErrorGroup errorGroup;
+ protected OperationGroup operationGroup;
+ protected AttributeGroup attributeGroup;
+
+ public JMXPropertySheetPage(JMXViewProvider provider) {
+ this.provider = provider;
}
- public JMXDomain[] getDomains() {
- return domains;
- }
- protected void loadDomains() {
- JMXRunnable run = new JMXRunnable() {
- public void run(MBeanServerConnection connection) {
- try {
- String[] domainNames = connection.getDomains();
- JMXDomain[] domains = new JMXDomain[domainNames.length];
- for( int i = 0; i < domainNames.length; i++ ) {
- domains[i] = new JMXDomain(server, domainNames[i]);
- }
- JMXModelRoot.this.domains = domains;
- } catch( IOException ioe ) {
- JMXModelRoot.this.domains = new JMXDomain[0];
+
+ public void createControl(Composite parent) {
+ main = new Composite(parent, SWT.NONE);
+ main.setLayout(new FormLayout());
+
+ pulldown = new Combo(main, SWT.READ_ONLY);
+ FormData pulldownData = new FormData();
+ pulldownData.left = new FormAttachment(0, 10);
+ // pulldownData.right = new FormAttachment(0,300);
+ pulldownData.top = new FormAttachment(0, 10);
+ pulldown.setLayoutData(pulldownData);
+
+
+ Listener listener = new Listener() {
+ public void handleEvent(Event event) {
+ switch(event.type) {
+ case SWT.Selection:
+ case SWT.Modify:
+ pulldownSelectionChanged();
+ break;
}
}
};
- JMXSafeRunner.run(server, run);
+ pulldown.addListener(SWT.Selection, listener);
+ pulldown.addListener(SWT.Modify, listener);
+
+ book = new PageBook(main, SWT.NONE);
+ FormData bookData = new FormData();
+ bookData.top = new FormAttachment(pulldown, 10);
+ bookData.left = new FormAttachment(0,5);
+ bookData.right = new FormAttachment(100,-5);
+ bookData.bottom = new FormAttachment(100, -5);
+ book.setLayoutData(bookData);
+
+ errorGroup = new ErrorGroup(book, SWT.NONE);
+ operationGroup = new OperationGroup(book, SWT.NONE);
+ attributeGroup = new AttributeGroup(book, SWT.NONE);
}
- }
-
- protected static class JMXDomain {
- protected String name;
- protected IServer server;
- public JMXBean[] mbeans = null;
- public JMXDomain(IServer server, String name) {
- this.server = server;
- this.name = name;
+
+ public void dispose() {
}
- public String getName() { return name; }
- public JMXBean[] getBeans() {
- return mbeans;
+
+ public Control getControl() {
+ return main;
}
- protected void loadBeans() {
- // etc
- JMXRunnable run = new JMXRunnable() {
- public void run(MBeanServerConnection connection) {
- try {
- String query = name + ":*";
- Set s = connection.queryMBeans(new ObjectName(name + ":*"), null);
- Iterator i = s.iterator();
- JMXBean[] beans = new JMXBean[s.size()];
- int count = 0;
- while(i.hasNext()) {
- ObjectInstance tmp = (ObjectInstance)i.next();
- beans[count++] = new JMXBean(server, tmp);
- }
- mbeans = beans;
- } catch( MalformedObjectNameException mone) {
- } catch (IOException e) {
- }
- }
- };
- JMXSafeRunner.run(server, run);
+
+ public void setActionBars(IActionBars actionBars) {
}
- }
-
- protected static class JMXBean {
- protected String domain;
- protected String name;
- protected String clazz;
- protected IServer server;
- public JMXBean(IServer server, ObjectInstance instance) {
- this.server = server;
- this.domain = instance.getObjectName().getDomain();
- this.clazz = instance.getClassName();
- this.name = instance.getObjectName().getCanonicalName();
+
+ public void setFocus() {
}
- public String getDomain() {
- return domain;
+
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection) selection)
+ .getFirstElement();
+ if (obj instanceof ContentWrapper)
+ obj = ((ContentWrapper) obj).getElement();
+
+ if (obj == null)
+ return;
+ setInputObject(obj);
+ }
}
- public String getName() {
- return name;
+
+ protected void setInputObject(Object obj) {
+ if (obj instanceof JMXDomain) {
+ showDomainComposite((JMXDomain) obj);
+ } else if (obj instanceof JMXBean) {
+ setBean((JMXBean) obj);
+ } else if (obj instanceof JMXAttributesWrapper
+ || obj instanceof WrappedMBeanOperationInfo) {
+ setBean(getBeanFromInput(obj));
+ setComboSelectionFromInput(obj);
+ }
}
- public String getClazz() {
- return clazz;
+
+ protected void setBean(JMXBean bean) {
+ if (bean != null ) {
+ boolean requiresLoading = bean.getOperations() == null && bean.getException() == null;
+ boolean hasError = bean.getOperations() == null && bean.getException() != null;
+ boolean currentBeanLoading = bean == this.bean && pulldown.getItems().length == 1 && pulldown.getItems()[0].equals(LOADING_STRING_ARRAY[0]);
+ boolean finishedLoading = bean.getOperations() != null;
+
+ this.bean = bean;
+ if( requiresLoading ) {
+ pulldown.setItems(LOADING_STRING_ARRAY);
+ pulldown.select(0); // select Loading...
+ loadChildrenRefreshProperties(bean);
+ } else if( hasError ) {
+ // some error
+ showErrorComposite();
+ } else if( finishedLoading ) {
+ // finished loading
+ operations = bean.getOperations();
+ pulldown.setItems(pulldownItems());
+ pulldown.select(0); // select Loading...
+ }
+ main.layout();
+ }
}
- public IServer getServer() {
- return server;
+
+ protected JMXBean getBeanFromInput(Object obj) {
+ return obj instanceof JMXAttributesWrapper ?
+ ((JMXAttributesWrapper) obj).getBean() :
+ ((WrappedMBeanOperationInfo) obj).getBean();
}
-
- }
- protected interface JMXRunnable {
- public void run(MBeanServerConnection connection);
- }
- protected static class JMXSafeRunner {
- public static void run(IServer s, JMXRunnable r) {
- ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
- ClassLoader newLoader = JMXClassLoaderRepository.getDefault().getClassLoader(s);
- Thread.currentThread().setContextClassLoader(newLoader);
- InitialContext ic = null;
- try {
- setCredentials(s);
- Properties p = getProperties(s);
- ic = new InitialContext(p);
- Object obj = ic.lookup("jmx/invoker/RMIAdaptor");
- ic.close();
- if (obj instanceof MBeanServerConnection) {
- MBeanServerConnection connection = (MBeanServerConnection) obj;
- r.run(connection);
+ protected void setComboSelectionFromInput(Object obj) {
+ int index = -1;
+ if (obj instanceof WrappedMBeanOperationInfo)
+ index = pulldown
+ .indexOf(getStringForOperation(((WrappedMBeanOperationInfo) obj)));
+ if (index == -1)
+ index = 0;
+ pulldown.select(index);
+ }
+
+ // get the list of combo items based on the bean
+ // The list should be Two larger than the number of operations
+ // ex: {Attributes..., ------, op1, op2, op3... etc}
+ protected String[] pulldownItems() {
+ WrappedMBeanOperationInfo[] ops = bean.getOperations();
+ String[] vals = null;
+ if (ops != null) {
+ if( ops.length == 0 ) return new String[]{ATTRIBUTES_STRING};
+ vals = new String[ops.length + 2];
+ vals[0] = ATTRIBUTES_STRING;
+ vals[1] = "---------------";
+ for (int i = 0; i < ops.length; i++) {
+ vals[i + 2] = getStringForOperation(ops[i]);
}
- } catch( Exception e ) {
}
- Thread.currentThread().setContextClassLoader(currentLoader);
+ return vals;
}
- protected static Properties getProperties(IServer s) {
- int port = ServerConverter.getJBossServer(s).getJNDIPort();
- Properties props = new Properties();
- props.put("java.naming.factory.initial",
- "org.jnp.interfaces.NamingContextFactory");
- props.put("java.naming.factory.url.pkgs",
- "org.jboss.naming:org.jnp.interfaces");
- props.put("java.naming.provider.url", "jnp://"
- + s.getHost() + ":" + port);
- return props;
+ protected String getStringForOperation(WrappedMBeanOperationInfo op) {
+ return op.getInfo().getReturnType() + " " + op.getInfo().getName();
}
+
+ protected void loadChildrenRefreshProperties(final Object bean) {
+ new Thread() {
+ public void run() {
+ loadChildren(bean);
+ Display.getDefault().asyncExec(new Runnable() { public void run() {
+ setInputObject(bean);
+ }});
+ }
+ }.start();
+ }
- protected static void setCredentials(IServer s) {
- Exception temp = null;
- try {
- ILaunchConfiguration lc = s.getLaunchConfiguration(true,
- new NullProgressMonitor());
- // get user from the IServer, but override with launch
- // configuration
- String user = ServerConverter.getJBossServer(s).getUsername();
-
- // get password from the IServer, but override with launch
- // configuration
- String pass = ServerConverter.getJBossServer(s).getPassword();
-
- // get our methods
- Class simplePrincipal = Thread.currentThread()
- .getContextClassLoader().loadClass(
- "org.jboss.security.SimplePrincipal");
- Class securityAssoc = Thread.currentThread()
- .getContextClassLoader().loadClass(
- "org.jboss.security.SecurityAssociation");
- securityAssoc.getMethods(); // force-init the methods since the
- // class hasn't been initialized yet.
+ protected void showDomainComposite(JMXDomain domain) {
+ // nothing
+ }
+ protected void showErrorComposite() {
+ book.showPage(errorGroup);
+ }
+
+ protected void pulldownSelectionChanged() {
+ if( pulldown.getSelectionIndex() != -1 ) {
+ int index = pulldown.getSelectionIndex();
+ if( index == 0 && pulldown.getItem(0).equals(ATTRIBUTES_STRING)) {
+ book.showPage(attributeGroup);
+ } else if( index != 1 && index <= operations.length) {
+ book.showPage(operationGroup);
+ }
+ String selected = pulldown.getItem(pulldown.getSelectionIndex());
+ System.out.println(selected);
+ }
+ }
- Constructor newSimplePrincipal = simplePrincipal
- .getConstructor(new Class[] { String.class });
- Object newPrincipalInstance = newSimplePrincipal
- .newInstance(new Object[] { user });
+ }
+
+ protected static class ErrorGroup extends Composite {
+ protected Group group;
+ public ErrorGroup(Composite parent, int style) {
+ super(parent, style);
+ setLayout(new FillLayout());
+ group = new Group(this, SWT.NONE);
+ group.setText("Error");
+ }
+ }
- // set the principal
- Method setPrincipalMethod = securityAssoc.getMethod(
- "setPrincipal", new Class[] { Principal.class });
- setPrincipalMethod.invoke(null,
- new Object[] { newPrincipalInstance });
+ 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");
+ }
+ }
- // set the credential
- Method setCredentialMethod = securityAssoc.getMethod(
- "setCredential", new Class[] { Object.class });
- setCredentialMethod.invoke(null, new Object[] { pass });
- } catch (Exception e) {}
+ protected static class AttributeGroup extends Composite {
+ protected Group group;
+ public AttributeGroup(Composite parent, int style) {
+ super(parent, style);
+ setLayout(new FillLayout());
+ group = new Group(this, SWT.NONE);
+ group.setText("Attributes");
}
+ }
-
- }
-
}
17 years, 3 months