use of org.eclipse.ui.IPageListener in project core by jcryptool.
the class EditorsManager method addListenerToPage.
private void addListenerToPage(IWorkbenchWindow window) {
if (window.getPages().length > 0) {
IWorkbenchPage page = window.getActivePage();
if (page == null)
page = window.getPages()[0];
addPartListener(page);
return;
}
window.addPageListener(new IPageListener() {
public void pageOpened(IWorkbenchPage page) {
addPartListener(page);
}
public void pageActivated(IWorkbenchPage page) {
}
public void pageClosed(IWorkbenchPage page) {
}
});
}
use of org.eclipse.ui.IPageListener in project yamcs-studio by yamcs.
the class RunOPIAction method createRuntimePage.
private IWorkbenchPage createRuntimePage() throws Exception {
IWorkbenchPage page = RunModeService.createNewWorkbenchPage(Optional.empty());
page.getWorkbenchWindow().addPageListener(new IPageListener() {
@Override
public void pageClosed(IWorkbenchPage page) {
if (page == runtime_page) {
runtime_page = null;
}
}
@Override
public void pageActivated(IWorkbenchPage page) {
// NOP
}
@Override
public void pageOpened(IWorkbenchPage page) {
// NOP
}
});
return page;
}
use of org.eclipse.ui.IPageListener in project xtext-eclipse by eclipse.
the class DefaultMergeViewer method setActionsActivated.
@Override
protected void setActionsActivated(SourceViewer sourceViewer, boolean state) {
DefaultMergeEditor mergeEditor = getEditor(sourceViewer);
if (mergeEditor != null) {
mergeEditor.setActionsActivated(state);
IAction saveAction = mergeEditor.getAction(ITextEditorActionConstants.SAVE);
if (saveAction instanceof IPageListener) {
PartEventAction partEventAction = (PartEventAction) saveAction;
IWorkbenchPart compareEditorPart = getCompareConfiguration().getContainer().getWorkbenchPart();
if (state) {
partEventAction.partActivated(compareEditorPart);
} else {
partEventAction.partDeactivated(compareEditorPart);
}
}
}
}
Aggregations