Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82622 Details for
Bug 207831
[registryview] add a 'diagnose' action
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
org.eclipse.pde.runtime.patch
clipboard.txt (text/plain), 13.03 KB, created by
Chris Aniszczyk
on 2007-11-11 15:28:06 EST
(
hide
)
Description:
org.eclipse.pde.runtime.patch
Filename:
MIME Type:
Creator:
Chris Aniszczyk
Created:
2007-11-11 15:28:06 EST
Size:
13.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.runtime >Index: src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties,v >retrieving revision 1.61 >diff -u -r1.61 pderuntimeresources.properties >--- src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties 30 Oct 2007 19:27:30 -0000 1.61 >+++ src/org/eclipse/pde/internal/runtime/pderuntimeresources.properties 11 Nov 2007 20:27:27 -0000 >@@ -20,6 +20,7 @@ > RegistryView_folders_libraries = Run-time Libraries > RegistryView_folders_extensionPoints = Extension Points > RegistryView_folders_extensions = Extensions >+RegistryView_found_problems=The following problems were found: > RegistryView_showRunning_label = &Show Active Plug-ins Only > RegistryView_showAdvanced_label = Show Advanced &Operations > RegistryBrowserLabelProvider_nameIdBind={0} [{1}] >@@ -27,7 +28,15 @@ > RegistryView_startAction_label = Start > RegistryView_stopAction_label = Stop > RegistryView_enableAction_label = Enable >+RegistryView_diag_dialog_title=Diagnosis >+RegistryView_diagnoseAction_label=Diagnose > RegistryView_disableAction_label = Disable >+RegistryView_no_unresolved_constraints=No problems detected. >+ >+MessageHelper_missing_optional_required_bundle=Missing optionally required bundle {0} >+MessageHelper_missing_required_bundle=Missing required bundle {0} >+MessageHelper_missing_imported_package=Missing imported package {0} >+MessageHelper_missing_host=Missing host {0} > > # Plug-in Spy > SpyDialog_title = Plug-in Spy >Index: src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java,v >retrieving revision 1.13 >diff -u -r1.13 PDERuntimeMessages.java >--- src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java 30 Oct 2007 19:27:29 -0000 1.13 >+++ src/org/eclipse/pde/internal/runtime/PDERuntimeMessages.java 11 Nov 2007 20:27:27 -0000 >@@ -23,13 +23,24 @@ > public static String RegistryView_folders_libraries; > public static String RegistryView_folders_extensionPoints; > public static String RegistryView_folders_extensions; >+ >+ public static String RegistryView_found_problems; > public static String RegistryView_showRunning_label; > public static String RegistryView_showAdvanced_label; > public static String RegistryView_titleSummary; > public static String RegistryView_startAction_label; > public static String RegistryView_stopAction_label; > public static String RegistryView_enableAction_label; >+ public static String RegistryView_diag_dialog_title; >+ >+ public static String RegistryView_diagnoseAction_label; > public static String RegistryView_disableAction_label; >+ public static String RegistryView_no_unresolved_constraints; >+ >+ public static String MessageHelper_missing_optional_required_bundle; >+ public static String MessageHelper_missing_required_bundle; >+ public static String MessageHelper_missing_imported_package; >+ public static String MessageHelper_missing_host; > > public static String RegistryBrowserLabelProvider_nameIdBind; > >Index: src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java,v >retrieving revision 1.54 >diff -u -r1.54 RegistryBrowser.java >--- src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java 30 Oct 2007 18:15:10 -0000 1.54 >+++ src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java 11 Nov 2007 20:27:27 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla <b.muskalla@gmx.net> - bug 207831 > *******************************************************************************/ > package org.eclipse.pde.internal.runtime.registry; > >@@ -19,13 +20,18 @@ > import org.eclipse.core.runtime.IExtensionPoint; > import org.eclipse.core.runtime.IRegistryChangeEvent; > import org.eclipse.core.runtime.IRegistryChangeListener; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.MultiStatus; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.core.runtime.Status; > import org.eclipse.jface.action.Action; > import org.eclipse.jface.action.IMenuListener; > import org.eclipse.jface.action.IMenuManager; > import org.eclipse.jface.action.IToolBarManager; > import org.eclipse.jface.action.MenuManager; > import org.eclipse.jface.action.Separator; >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.jface.viewers.TreeViewer; > import org.eclipse.jface.viewers.Viewer; >@@ -34,8 +40,11 @@ > import org.eclipse.osgi.service.resolver.BundleDescription; > import org.eclipse.osgi.service.resolver.DisabledInfo; > import org.eclipse.osgi.service.resolver.PlatformAdmin; >+import org.eclipse.osgi.service.resolver.ResolverError; > import org.eclipse.osgi.service.resolver.State; >+import org.eclipse.osgi.service.resolver.VersionConstraint; > import org.eclipse.pde.internal.runtime.IHelpContextIds; >+import org.eclipse.pde.internal.runtime.MessageHelper; > import org.eclipse.pde.internal.runtime.PDERuntimeMessages; > import org.eclipse.pde.internal.runtime.PDERuntimePlugin; > import org.eclipse.pde.internal.runtime.PDERuntimePluginImages; >@@ -84,6 +93,7 @@ > private Action fStopAction; > private Action fEnableAction; > private Action fDisableAction; >+ private Action fDiagnoseAction; > > private DrillDownAdapter drillDownAdapter; > private ViewerFilter fActiveFilter = new ViewerFilter() { >@@ -279,6 +289,9 @@ > if(selectedBundlesStarted()) > manager.add(fStopAction); > >+ if(getSelectedBundles().size() == 1) >+ manager.add(fDiagnoseAction); >+ > // security related actions > if(selectedBundlesDisabled()) > manager.add(fEnableAction); >@@ -365,6 +378,8 @@ > } > } > private Object findTreeBundleData(Bundle bundle) { >+ if(tree.isDisposed()) >+ return null; > Object data = null; > boolean found = false; > TreeItem[] items = tree.getItems(); >@@ -587,6 +602,59 @@ > } > }; > >+ fDiagnoseAction = new Action(PDERuntimeMessages.RegistryView_diagnoseAction_label) { >+ public void run() { >+ List bundles = getSelectedBundles(); >+ State state = PDERuntimePlugin.getDefault().getState(); >+ for (Iterator it = bundles.iterator(); it.hasNext();) { >+ Bundle bundle = (Bundle) it.next(); >+ BundleDescription desc = state.getBundle(bundle.getBundleId()); >+ PlatformAdmin platformAdmin = PDERuntimePlugin.getDefault().getPlatformAdmin(); >+ VersionConstraint[] unsatisfied = platformAdmin >+ .getStateHelper().getUnsatisfiedConstraints(desc); >+ ResolverError[] resolverErrors = platformAdmin.getState(false).getResolverErrors(desc); >+ MultiStatus problems = new MultiStatus(PDERuntimePlugin.ID, >+ IStatus.INFO, >+ PDERuntimeMessages.RegistryView_found_problems, >+ null); >+ for (int i = 0; i < resolverErrors.length; i++) { >+ if ((resolverErrors[i].getType() & (ResolverError.MISSING_FRAGMENT_HOST >+ | ResolverError.MISSING_GENERIC_CAPABILITY >+ | ResolverError.MISSING_IMPORT_PACKAGE | ResolverError.MISSING_REQUIRE_BUNDLE)) != 0) >+ continue; >+ IStatus status = new Status(IStatus.WARNING, >+ PDERuntimePlugin.ID, resolverErrors[i] >+ .toString()); >+ problems.add(status); >+ } >+ >+ for (int i = 0; i < unsatisfied.length; i++) { >+ IStatus status = new Status( >+ IStatus.WARNING, >+ PDERuntimePlugin.ID, >+ MessageHelper >+ .getResolutionFailureMessage(unsatisfied[i])); >+ problems.add(status); >+ } >+ Dialog dialog; >+ if (unsatisfied.length != 0 || resolverErrors.length != 0) { >+ dialog = new DiagnosticsDialog( >+ getSite().getShell(), >+ PDERuntimeMessages.RegistryView_diag_dialog_title, >+ null, problems, IStatus.WARNING); >+ dialog.open(); >+ } else { >+ MessageDialog >+ .openInformation( >+ getSite().getShell(), >+ PDERuntimeMessages.RegistryView_diag_dialog_title, >+ PDERuntimeMessages.RegistryView_no_unresolved_constraints); >+ } >+ >+ } >+ } >+ }; >+ > fCollapseAllAction = new Action("collapseAll"){ //$NON-NLS-1$ > public void run(){ > fTreeViewer.collapseAll(); >Index: src/org/eclipse/pde/internal/runtime/MessageHelper.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/runtime/MessageHelper.java >diff -N src/org/eclipse/pde/internal/runtime/MessageHelper.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/runtime/MessageHelper.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,39 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.pde.internal.runtime; >+ >+import org.eclipse.osgi.service.resolver.BundleSpecification; >+import org.eclipse.osgi.service.resolver.ImportPackageSpecification; >+import org.eclipse.osgi.service.resolver.VersionConstraint; >+import org.eclipse.osgi.util.NLS; >+ >+public class MessageHelper { >+ public static String getResolutionFailureMessage(VersionConstraint unsatisfied) { >+ if (unsatisfied.isResolved()) >+ throw new IllegalArgumentException(); >+ if (unsatisfied instanceof ImportPackageSpecification) >+ return NLS.bind(PDERuntimeMessages.MessageHelper_missing_imported_package, toString(unsatisfied)); >+ else if (unsatisfied instanceof BundleSpecification) { >+ if (((BundleSpecification) unsatisfied).isOptional()) >+ return NLS.bind(PDERuntimeMessages.MessageHelper_missing_optional_required_bundle, toString(unsatisfied)); >+ return NLS.bind(PDERuntimeMessages.MessageHelper_missing_required_bundle, toString(unsatisfied)); >+ } else >+ return NLS.bind(PDERuntimeMessages.MessageHelper_missing_host, toString(unsatisfied)); >+ } >+ >+ private static String toString(VersionConstraint constraint) { >+ org.eclipse.osgi.service.resolver.VersionRange versionRange = constraint.getVersionRange(); >+ if (versionRange == null) >+ return constraint.getName(); >+ return constraint.getName() + '_' + versionRange; >+ } >+ >+} >Index: src/org/eclipse/pde/internal/runtime/registry/DiagnosticsDialog.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/runtime/registry/DiagnosticsDialog.java >diff -N src/org/eclipse/pde/internal/runtime/registry/DiagnosticsDialog.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/runtime/registry/DiagnosticsDialog.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,44 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla <b.muskalla@gmx.net> - bug 207831 >+ *******************************************************************************/ >+package org.eclipse.pde.internal.runtime.registry; >+ >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.jface.dialogs.ErrorDialog; >+import org.eclipse.jface.dialogs.IDialogConstants; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Shell; >+ >+public class DiagnosticsDialog extends ErrorDialog { >+ >+ public DiagnosticsDialog(Shell parentShell, String dialogTitle, >+ String message, IStatus status, int displayMask) { >+ super(parentShell, dialogTitle, message, status, displayMask); >+ } >+ >+ protected Control createDialogArea(Composite parent) { >+ Control area = super.createDialogArea(parent); >+ createDropDownList((Composite) area); >+ return area; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) >+ */ >+ protected void createButtonsForButtonBar(Composite parent) { >+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, >+ true); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207831
:
81527
| 82622 |
82623