Skip to content

Commit

Permalink
Make the "Cleanup Manifest" action more accessible/visible to the user
Browse files Browse the repository at this point in the history
PDE has a wizzard to cleanup a manifest, but this is currently quite
hidden. One can select from the context menu Plugin-Tools>Organize
Manifests, or one can open the manifest editor and under "Exporting" to
open the wizard. Especially the second one indicates tha this is more a
task done before exporting the plugin (what most of the time happens in
a CI build instead from the IDE) and is not accessible when one of the
other tabs are open.

This change adds a new icon at the toolbar next to the run icons so it
is visible on every tab so people hopefully use tthis feature more.
  • Loading branch information
laeubi committed Dec 29, 2022
1 parent ebceefd commit 47ef407
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ public class PDEPluginImages {
public static final ImageDescriptor DESC_PROFILE_EXC = create(PATH_OBJ, "profile_exc.png"); //$NON-NLS-1$

public static final ImageDescriptor DESC_CON_SEV = create(PATH_LCL, "configure_problem_severity.png"); //$NON-NLS-1$
public static final ImageDescriptor DESC_ORGANIZE_MANIFESTS_ACTION = create(PATH_LCL,
"cleanmanifest.png"); //$NON-NLS-1$
/**
* WIZ
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.osgi.service.resolver.BaseDescription;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.util.NLS;
Expand All @@ -45,6 +47,7 @@
import org.eclipse.pde.internal.ui.editor.build.*;
import org.eclipse.pde.internal.ui.editor.context.InputContext;
import org.eclipse.pde.internal.ui.editor.context.InputContextManager;
import org.eclipse.pde.internal.ui.wizards.tools.OrganizeManifestsAction;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.*;
import org.eclipse.ui.ide.FileStoreEditorInput;
Expand Down Expand Up @@ -696,9 +699,23 @@ protected void setShowExtensions(boolean show) throws BackingStoreException {
@Override
public void contributeToToolbar(IToolBarManager manager) {
contributeLaunchersToToolbar(manager);
manager.add(getOrganizeManifestsAction());
manager.add(getExportAction());
}

private Action getOrganizeManifestsAction() {
Action action = new Action() {
@Override
public void run() {
OrganizeManifestsAction organizeAction = new OrganizeManifestsAction();
organizeAction.runOrganizeManfestsAction(new StructuredSelection(getCommonProject()));
}
};
action.setToolTipText(PDEUIMessages.OrganizeManifestJob_taskName);
action.setImageDescriptor(PDEPluginImages.DESC_ORGANIZE_MANIFESTS_ACTION);
return action;
}

private PluginExportAction getExportAction() {
if (fExportAction == null) {
fExportAction = new PluginExportAction(this);
Expand Down

0 comments on commit 47ef407

Please sign in to comment.