use of org.eclipse.ui.IPartListener in project knime-core by knime.
the class AbstractRepositoryView method init.
/**
* {@inheritDoc}
*/
@Override
public void init(final IViewSite site) throws PartInitException {
super.init(site);
// Bug#5807 set the initial focus on the search field.
site.getPage().addPartListener(new IPartListener() {
@Override
public void partOpened(final IWorkbenchPart part) {
}
@Override
public void partDeactivated(final IWorkbenchPart part) {
}
@Override
public void partClosed(final IWorkbenchPart part) {
}
@Override
public void partBroughtToTop(final IWorkbenchPart part) {
}
@Override
public void partActivated(final IWorkbenchPart part) {
if (part == AbstractRepositoryView.this) {
m_toolbarSearchText.getText().setFocus();
}
}
});
}
use of org.eclipse.ui.IPartListener in project core by jcryptool.
the class ApplicationWorkbenchAdvisor method postStartup.
/**
* Performs arbitrary actions after the workbench windows have been opened (or restored), but before the main event
* loop is run.
*
* Specifically a part listener is added to the workbench page. The algorithm actions will be enabled if at least
* the text or hex editor is active. Otherwise the will be disabled.
*/
public void postStartup() {
super.postStartup();
if (OperationsPlugin.getDefault().getAlgorithmsManager() != null) {
IWorkbenchPage activePage = getWorkbenchConfigurer().getWorkbench().getActiveWorkbenchWindow().getActivePage();
activePage.addPartListener(new IPartListener() {
public void partActivated(IWorkbenchPart part) {
setAlgorithmActionStatus(part);
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
}
public void partDeactivated(IWorkbenchPart part) {
setAlgorithmActionStatus(part);
}
public void partOpened(IWorkbenchPart part) {
}
});
if (getWorkbenchConfigurer().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() != null) {
OperationsPlugin.getDefault().getAlgorithmsManager().setCommandsEnabled(true);
}
}
}
use of org.eclipse.ui.IPartListener in project tdq-studio-se by Talend.
the class TOPRepositoryService method addPartListener.
public void addPartListener() {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
// Calculate the extensions to register partListener.
IPartListener listener = PartListener.getPartListener();
if (listener != null) {
activePage.addPartListener(listener);
}
}
use of org.eclipse.ui.IPartListener in project cubrid-manager by CUBRID.
the class ERSchemaEditor method init.
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
String name = input.getName();
if (input instanceof SchemaEditorInput) {
name += "@" + ((SchemaEditorInput) input).getDatabase().getName();
}
this.setPartName(name);
// store site and input
setSite(site);
setInput(input);
getEditDomain().setPaletteRoot(getPaletteRoot());
setTitleImage(input.getImageDescriptor().createImage());
getCommandStack().addCommandStackListener(this);
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
createActions();
this.getSite().getPage().addPartListener(new IPartListener() {
public void partOpened(IWorkbenchPart part) {
if (part == ERSchemaEditor.this) {
CommonUITool.activeView(ERDThumbnailViewPart.ID);
}
}
public void partDeactivated(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
if (part == ERSchemaEditor.this) {
ERDThumbnailViewPart view = (ERDThumbnailViewPart) CommonUITool.findView(ERDThumbnailViewPart.ID);
if (view != null) {
view.redraw(null);
}
}
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partActivated(IWorkbenchPart part) {
if (part == ERSchemaEditor.this) {
ERDThumbnailViewPart view = (ERDThumbnailViewPart) CommonUITool.findView(ERDThumbnailViewPart.ID);
if (view != null) {
view.redraw(getRootEditPart());
}
}
}
});
if (database != null && !database.isVirtual()) {
CubridNodeManager.getInstance().addCubridNodeChangeListener(this);
}
}
use of org.eclipse.ui.IPartListener in project cubrid-manager by CUBRID.
the class QueryEditorPart method init.
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
currentEditorIndex = lastEditorIndex++;
this.setSite(site);
this.setInput(input);
this.setPartName(input.getName());
this.setTitleToolTip(input.getToolTipText());
if (input.getImageDescriptor() != null) {
this.setTitleImage(input.getImageDescriptor().createImage());
}
hookRetragetActions();
this.getSite().getPage().addPartListener(new IPartListener() {
public void partOpened(IWorkbenchPart part) {
}
public void partDeactivated(IWorkbenchPart part) {
InfoWindowManager.setVisible(false);
}
public void partClosed(IWorkbenchPart part) {
InfoWindowManager.setVisible(false);
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partActivated(IWorkbenchPart part) {
QueryEditorPart queryEditor = CommonUITool.getActiveQueryEditorPart();
InfoWindowManager.getInstance().updateContent(queryEditor);
}
});
}
Aggregations