mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
Bug 312706: Update the enablement of the buttons after they are created.
This commit is contained in:
parent
3eced97e4d
commit
25085b92c5
2 changed files with 4 additions and 7 deletions
|
@ -73,7 +73,6 @@ public class GlobalActionsList extends Composite {
|
||||||
summaryTableColumn.setText(Messages.getString("GlobalActionsList.2")); //$NON-NLS-1$
|
summaryTableColumn.setText(Messages.getString("GlobalActionsList.2")); //$NON-NLS-1$
|
||||||
|
|
||||||
ArrayList actions = CDebugCorePlugin.getDefault().getBreakpointActionManager().getBreakpointActions();
|
ArrayList actions = CDebugCorePlugin.getDefault().getBreakpointActionManager().getBreakpointActions();
|
||||||
boolean hasActions = actions.size() > 0;
|
|
||||||
|
|
||||||
for (Iterator iter = CDebugCorePlugin.getDefault().getBreakpointActionManager().getBreakpointActions().iterator(); iter.hasNext();) {
|
for (Iterator iter = CDebugCorePlugin.getDefault().getBreakpointActionManager().getBreakpointActions().iterator(); iter.hasNext();) {
|
||||||
IBreakpointAction element = (IBreakpointAction) iter.next();
|
IBreakpointAction element = (IBreakpointAction) iter.next();
|
||||||
|
@ -114,13 +113,12 @@ public class GlobalActionsList extends Composite {
|
||||||
});
|
});
|
||||||
if (!useAttachButton)
|
if (!useAttachButton)
|
||||||
editButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + GridData.HORIZONTAL_ALIGN_END));
|
editButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + GridData.HORIZONTAL_ALIGN_END));
|
||||||
editButton.setEnabled(hasActions);
|
|
||||||
|
|
||||||
deleteButton = new Button(this, SWT.NONE);
|
deleteButton = new Button(this, SWT.NONE);
|
||||||
deleteButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
|
deleteButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
|
||||||
deleteButton.setText(Messages.getString("GlobalActionsList.6")); //$NON-NLS-1$
|
deleteButton.setText(Messages.getString("GlobalActionsList.6")); //$NON-NLS-1$
|
||||||
deleteButton.setEnabled(hasActions);
|
|
||||||
//
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Button getAttachButton() {
|
public Button getAttachButton() {
|
||||||
|
|
|
@ -79,7 +79,6 @@ public class TracepointGlobalActionsList extends Composite {
|
||||||
summaryTableColumn.setText(MessagesForTracepointActions.TracepointActions_Summary);
|
summaryTableColumn.setText(MessagesForTracepointActions.TracepointActions_Summary);
|
||||||
|
|
||||||
ArrayList<ITracepointAction> actions = TracepointActionManager.getInstance().getActions();
|
ArrayList<ITracepointAction> actions = TracepointActionManager.getInstance().getActions();
|
||||||
boolean hasActions = actions.size() > 0;
|
|
||||||
|
|
||||||
for (ITracepointAction element : actions) {
|
for (ITracepointAction element : actions) {
|
||||||
if (isSubAction && element instanceof WhileSteppingAction) continue;
|
if (isSubAction && element instanceof WhileSteppingAction) continue;
|
||||||
|
@ -120,12 +119,12 @@ public class TracepointGlobalActionsList extends Composite {
|
||||||
});
|
});
|
||||||
if (!useAttachButton)
|
if (!useAttachButton)
|
||||||
editButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + GridData.HORIZONTAL_ALIGN_END));
|
editButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL + GridData.HORIZONTAL_ALIGN_END));
|
||||||
editButton.setEnabled(hasActions);
|
|
||||||
|
|
||||||
deleteButton = new Button(this, SWT.NONE);
|
deleteButton = new Button(this, SWT.NONE);
|
||||||
deleteButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
|
deleteButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
|
||||||
deleteButton.setText(MessagesForTracepointActions.TracepointActions_Delete);
|
deleteButton.setText(MessagesForTracepointActions.TracepointActions_Delete);
|
||||||
deleteButton.setEnabled(hasActions);
|
|
||||||
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Button getAttachButton() {
|
public Button getAttachButton() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue