use of org.eclipse.ui.texteditor.IUpdate in project eclipse.platform.text by eclipse.
the class TextEditor method handlePreferenceStoreChanged.
@Override
protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
if (event.getProperty().equals(SpellingService.PREFERENCE_SPELLING_ENABLED)) {
ISourceViewer viewer = getSourceViewer();
if (!(viewer instanceof ISourceViewerExtension2))
// cannot unconfigure - do nothing
return;
// XXX: this is pretty heavy-weight
((ISourceViewerExtension2) viewer).unconfigure();
viewer.configure(getSourceViewerConfiguration());
if (Boolean.FALSE.equals(event.getNewValue()))
SpellingProblem.removeAll(getSourceViewer(), null);
IAction quickAssistAction = getAction(ITextEditorActionConstants.QUICK_ASSIST);
if (quickAssistAction instanceof IUpdate)
((IUpdate) quickAssistAction).update();
return;
}
super.handlePreferenceStoreChanged(event);
}
use of org.eclipse.ui.texteditor.IUpdate in project eclipse.platform.text by eclipse.
the class CompositeRevertAction method update.
@Override
public void update() {
for (int i = 0; i < fActions.length; i++) {
if (fActions[i] instanceof IUpdate)
((IUpdate) fActions[i]).update();
}
IAction action = getEnabledAction();
setEnabled(getEnabledAction() != null);
if (action == null)
return;
setText(action.getText());
setToolTipText(action.getToolTipText());
}
use of org.eclipse.ui.texteditor.IUpdate in project eclipse.platform.text by eclipse.
the class EncodingActionGroup method update.
/**
* Updates all actions of this action group.
*/
public void update() {
if (fTextEditor == null)
return;
IAction a = fTextEditor.getAction(IEncodingActionsConstants.SYSTEM);
if (a instanceof IUpdate)
((IUpdate) a).update();
for (int i = 0; i < ENCODINGS.length; i++) {
a = fTextEditor.getAction(ENCODINGS[i][0]);
if (a instanceof IUpdate)
((IUpdate) a).update();
}
a = fTextEditor.getAction(IEncodingActionsConstants.CUSTOM);
if (a instanceof IUpdate)
((IUpdate) a).update();
}
Aggregations