private boolean acquireWidgetToken(int type) {
switch (type) {
case CONTEXT_SELECTOR:
case PROPOSAL_SELECTOR:
if (fContentAssistSubjectControl instanceof IWidgetTokenOwnerExtension) {
IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
return extension.requestWidgetToken(this, WIDGET_PRIORITY);
} else if (fContentAssistSubjectControl instanceof IWidgetTokenOwner) {
IWidgetTokenOwner owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
return owner.requestWidgetToken(this);
} else if (fViewer instanceof IWidgetTokenOwnerExtension) {
IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fViewer;
return extension.requestWidgetToken(this, WIDGET_PRIORITY);
} else if (fViewer instanceof IWidgetTokenOwner) {
IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
return owner.requestWidgetToken(this);
}
}