Skip to content

Commit

Permalink
TEIIDDES-1713 added preventitive constant so tab selection doesn't ge…
Browse files Browse the repository at this point in the history
…t into loop on internalSetFocus()
  • Loading branch information
blafond committed May 22, 2013
1 parent 15f66b5 commit 2a3373d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public abstract class MultiPageModelEditor extends EditorPart implements IGotoMa
// otherwise, the OperationObjectEditorPage gets focus when it shouldn't
// ----------------------------
private boolean ignoreInternalFocus = false;

private boolean tabFolderSelectionInProgress = false;

/**
* Creates an empty multi-page editor with no pages.
Expand Down Expand Up @@ -437,6 +439,7 @@ private void createContainer( Composite parent ) {

@Override
public void widgetSelected( final SelectionEvent e ) {
tabFolderSelectionInProgress = true;
// System.out.println("MultiPageModelEditor.createContainer()$SelectionAdapter.widgetSelected"); //$NON-NLS-1$
UiBusyIndicator.showWhile(Display.getCurrent(), new Runnable() {

Expand All @@ -452,6 +455,7 @@ public void run() {
int newPageIndex = tabFolder.indexOf(item);
pageChange(newPageIndex);
}
tabFolderSelectionInProgress = false;
}
});
}
Expand Down Expand Up @@ -901,7 +905,9 @@ void internalSetFocus() {
event.widget = getTabFolder();
event.item = item;
event.type = SWT.Selection;
getTabFolder().notifyListeners(SWT.Selection, event);
if( !tabFolderSelectionInProgress ) {
getTabFolder().notifyListeners(SWT.Selection, event);
}
break;
}
}
Expand Down

0 comments on commit 2a3373d

Please sign in to comment.