Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2015 IBM Corporation and others.
* Copyright (c) 2005, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -70,8 +70,7 @@ protected void selectionChanged(IStructuredSelection selection) {
@Override
protected void handleDoubleClick(IStructuredSelection selection) {
if (selection.size() == 1) {
IPluginModelBase entry = (IPluginModelBase) selection.getFirstElement();
String version = VersionUtil.computeInitialPluginVersion(entry.getBundleDescription().getVersion().toString());
String version = getVersion(selection.getFirstElement());
setVersion(version, ""); //$NON-NLS-1$
}
}
Expand All @@ -80,15 +79,7 @@ protected void handleDoubleClick(IStructuredSelection selection) {
protected void buttonSelected(Button button, int index) {
IStructuredSelection selection = getTableViewer().getStructuredSelection();
if (selection.size() == 1) {
String version;
if (isPlugin) {
IPluginModelBase entry = (IPluginModelBase) selection.getFirstElement();
version = VersionUtil
.computeInitialPluginVersion(entry.getBundleDescription().getVersion().toString());
} else {
PackageObject po = (PackageObject) selection.getFirstElement();
version = po.getVersion();
}
String version = getVersion(selection.getFirstElement());
setVersion(version, ""); //$NON-NLS-1$
} else {
// plug-ins come back in a sorted order so we assume min/max
Expand Down Expand Up @@ -116,6 +107,14 @@ protected void buttonSelected(Button button, int index) {
}
}

private String getVersion(Object firstElement) {
if (isPlugin) {
IPluginModelBase entry = (IPluginModelBase) firstElement;
return VersionUtil.computeInitialPluginVersion(entry.getBundleDescription().getVersion().toString());
}
PackageObject po = (PackageObject) firstElement;
return po.getVersion();
}
}

private static class PluginVersionContentProvider implements IStructuredContentProvider {
Expand Down
Loading