Skip to content

Commit b8ce236

Browse files
committed
Fix editing of Implicit Plugin-Dpendencies
Currently editing the Implicit Plugin-Dpendencies only seem to work randomly (e.g. if one change some other property along with the change). This now do not refresh the full target (what seem to reset the underlying model and remove the dirty flag before changes are applied) but only updates the UI so finally these thing appear in the target file. Fixes #451
1 parent bb04e28 commit b8ce236

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetDefinition.java

+1
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ public NameVersionDescriptor[] getImplicitDependencies() {
819819

820820
@Override
821821
public void setImplicitDependencies(NameVersionDescriptor[] bundles) {
822+
incrementSequenceNumber();
822823
if (bundles != null && bundles.length == 0) {
823824
bundles = null;
824825
}

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ImplicitDependenciesSection.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ protected void handleAdd() {
217217
if (currentBundles != null) {
218218
allDependencies.addAll(Arrays.asList(currentBundles));
219219
}
220-
getTarget().setImplicitDependencies(allDependencies.toArray(new NameVersionDescriptor[allDependencies.size()]));
221220
markDirty();
222-
refresh();
221+
getTarget().setImplicitDependencies(allDependencies.toArray(new NameVersionDescriptor[allDependencies.size()]));
222+
updateUI();
223223
}
224224
}
225225

@@ -260,26 +260,30 @@ private void handleRemove() {
260260
bundles.remove(removeBundle);
261261
}
262262
}
263-
getTarget().setImplicitDependencies(bundles.toArray((new NameVersionDescriptor[bundles.size()])));
264263
markDirty();
265-
refresh();
264+
getTarget().setImplicitDependencies(bundles.toArray((new NameVersionDescriptor[bundles.size()])));
265+
updateUI();
266266
}
267267
}
268268

269269
private void handleRemoveAll() {
270-
getTarget().setImplicitDependencies(null);
271270
markDirty();
272-
refresh();
271+
getTarget().setImplicitDependencies(null);
272+
updateUI();
273273
}
274274

275275
@Override
276276
public void refresh() {
277277
// TODO Try to retain selection during refresh, add and remove operations
278+
updateUI();
279+
super.refresh();
280+
}
281+
282+
protected void updateUI() {
278283
fViewer.setInput(getTarget());
279284
fViewer.refresh();
280285
updateButtons();
281286
updateCount();
282-
super.refresh();
283287
}
284288

285289
}

0 commit comments

Comments
 (0)