|
Lines 52-62
Link Here
|
| 52 |
|
52 |
|
| 53 |
private TreeViewer fTreeViewer; |
53 |
private TreeViewer fTreeViewer; |
| 54 |
private Button fAddButton; |
54 |
private Button fAddButton; |
| 55 |
private Button fEditButton; |
55 |
public Button fEditButton; |
| 56 |
private Button fRemoveButton; |
56 |
private Button fRemoveButton; |
| 57 |
private Button fUpdateButton; |
57 |
private Button fUpdateButton; |
| 58 |
private Button fReloadButton; |
58 |
private Button fReloadButton; |
| 59 |
private Button fShowContentButton; |
59 |
private Button fShowContentButton; |
|
|
60 |
private boolean isTargetResolving = false; |
| 60 |
|
61 |
|
| 61 |
private ITargetDefinition fTarget; |
62 |
private ITargetDefinition fTarget; |
| 62 |
private ListenerList fChangeListeners = new ListenerList(); |
63 |
private ListenerList fChangeListeners = new ListenerList(); |
|
Lines 324-330
Link Here
|
| 324 |
Object currentSelection = iterator.next(); |
325 |
Object currentSelection = iterator.next(); |
| 325 |
if (currentSelection instanceof ITargetLocation) { |
326 |
if (currentSelection instanceof ITargetLocation) { |
| 326 |
ITargetLocation location = (ITargetLocation) currentSelection; |
327 |
ITargetLocation location = (ITargetLocation) currentSelection; |
| 327 |
ITargetLocationEditor editor = (ITargetLocationEditor) Platform.getAdapterManager().getAdapter(location, ITargetLocationEditor.class); |
328 |
ITargetLocationEditor editor = Platform.getAdapterManager().getAdapter(location, ITargetLocationEditor.class); |
| 328 |
if (editor != null) { |
329 |
if (editor != null) { |
| 329 |
if (editor.canEdit(fTarget, location)) { |
330 |
if (editor.canEdit(fTarget, location)) { |
| 330 |
IWizard editWizard = editor.getEditWizard(fTarget, location); |
331 |
IWizard editWizard = editor.getEditWizard(fTarget, location); |
|
Lines 510-516
Link Here
|
| 510 |
canRemove = true; |
511 |
canRemove = true; |
| 511 |
if (!canEdit) { |
512 |
if (!canEdit) { |
| 512 |
ITargetLocation location = (ITargetLocation) currentSelection; |
513 |
ITargetLocation location = (ITargetLocation) currentSelection; |
| 513 |
ITargetLocationEditor editor = (ITargetLocationEditor) Platform.getAdapterManager().getAdapter(location, ITargetLocationEditor.class); |
514 |
ITargetLocationEditor editor = Platform.getAdapterManager().getAdapter(location, ITargetLocationEditor.class); |
| 514 |
if (editor != null) { |
515 |
if (editor != null) { |
| 515 |
canEdit = editor.canEdit(fTarget, location); |
516 |
canEdit = editor.canEdit(fTarget, location); |
| 516 |
} |
517 |
} |
|
Lines 521-527
Link Here
|
| 521 |
} |
522 |
} |
| 522 |
if (!canUpdate) { |
523 |
if (!canUpdate) { |
| 523 |
ITargetLocation location = (ITargetLocation) currentSelection; |
524 |
ITargetLocation location = (ITargetLocation) currentSelection; |
| 524 |
ITargetLocationUpdater updater = (ITargetLocationUpdater) Platform.getAdapterManager().getAdapter(location, ITargetLocationUpdater.class); |
525 |
ITargetLocationUpdater updater = Platform.getAdapterManager().getAdapter(location, ITargetLocationUpdater.class); |
| 525 |
if (updater != null) { |
526 |
if (updater != null) { |
| 526 |
canUpdate = updater.canUpdate(fTarget, location); |
527 |
canUpdate = updater.canUpdate(fTarget, location); |
| 527 |
} |
528 |
} |
|
Lines 539-545
Link Here
|
| 539 |
|
540 |
|
| 540 |
} |
541 |
} |
| 541 |
fRemoveButton.setEnabled(canRemove); |
542 |
fRemoveButton.setEnabled(canRemove); |
| 542 |
fEditButton.setEnabled(canEdit); |
543 |
fEditButton.setEnabled(canEdit && !isTargetResolving()); |
| 543 |
fUpdateButton.setEnabled(canUpdate); |
544 |
fUpdateButton.setEnabled(canUpdate); |
| 544 |
|
545 |
|
| 545 |
// TODO Some code to find the parent location of items in the tree |
546 |
// TODO Some code to find the parent location of items in the tree |
|
Lines 589-592
Link Here
|
| 589 |
} |
590 |
} |
| 590 |
} |
591 |
} |
| 591 |
|
592 |
|
|
|
593 |
public boolean isTargetResolving() { |
| 594 |
return isTargetResolving; |
| 595 |
} |
| 596 |
|
| 597 |
public void setTargetResolving(boolean isTargetResolving) { |
| 598 |
this.isTargetResolving = isTargetResolving; |
| 599 |
} |
| 600 |
|
| 592 |
} |
601 |
} |