本文整理汇总了Java中org.eclipse.ui.IWorkbenchPartSite.getWorkbenchWindow方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchPartSite.getWorkbenchWindow方法的具体用法?Java IWorkbenchPartSite.getWorkbenchWindow怎么用?Java IWorkbenchPartSite.getWorkbenchWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkbenchPartSite
的用法示例。
在下文中一共展示了IWorkbenchPartSite.getWorkbenchWindow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TemplatePlanViewAddAction
import org.eclipse.ui.IWorkbenchPartSite; //导入方法依赖的package包/类
public TemplatePlanViewAddAction(String text, int style, TemplatePlanView templatePlanView) {
super(text, style);
this.templatePlanView = templatePlanView;
addButtonImageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(EditorPlugin.ID, "icons/add.png");
this.setEnabled(false);
IWorkbenchPartSite site = templatePlanView.getSite();
if(partListener == null) {
partListener = new PartListener();
}
if(site != null) {
IWorkbenchWindow workbenchWindow = site.getWorkbenchWindow();
if(workbenchWindow != null) {
IPartService partService = workbenchWindow.getPartService();
if(partService != null) {
partService.addPartListener(partListener);
}
}
}
}
示例2: uninstall
import org.eclipse.ui.IWorkbenchPartSite; //导入方法依赖的package包/类
@Override
public void uninstall() {
IWorkbenchPartSite site= fTextEditor.getSite();
IWorkbenchWindow window= site.getWorkbenchWindow();
window.getPartService().removePartListener(fPartListener);
fPartListener= null;
Shell shell= window.getShell();
if (shell != null && !shell.isDisposed())
shell.removeShellListener(fActivationListener);
fActivationListener= null;
JavaCore.removeElementChangedListener(fJavaElementChangedListener);
fJavaElementChangedListener= null;
IWorkspace workspace= JavaPlugin.getWorkspace();
workspace.removeResourceChangeListener(fResourceChangeListener);
fResourceChangeListener= null;
JavaPlugin.getDefault().getCombinedPreferenceStore().removePropertyChangeListener(fPropertyChangeListener);
fPropertyChangeListener= null;
super.uninstall();
}
示例3: dispose
import org.eclipse.ui.IWorkbenchPartSite; //导入方法依赖的package包/类
public void dispose() {
IWorkbenchPartSite site = templatePlanView.getSite();
if(partListener != null) {
if(site != null) {
IWorkbenchWindow workbenchWindow = site.getWorkbenchWindow();
if(workbenchWindow != null) {
IPartService partService = workbenchWindow.getPartService();
partService.removePartListener(partListener);
}
}
}
addButtonImageDescriptor = null;
}
示例4: install
import org.eclipse.ui.IWorkbenchPartSite; //导入方法依赖的package包/类
@Override
public void install(ITextViewer textViewer) {
super.install(textViewer);
fPartListener= new PartListener();
IWorkbenchPartSite site= fTextEditor.getSite();
IWorkbenchWindow window= site.getWorkbenchWindow();
window.getPartService().addPartListener(fPartListener);
fActivationListener= new ActivationListener(textViewer.getTextWidget());
Shell shell= window.getShell();
shell.addShellListener(fActivationListener);
fJavaElementChangedListener= new ElementChangedListener();
JavaCore.addElementChangedListener(fJavaElementChangedListener);
fResourceChangeListener= new ResourceChangeListener();
IWorkspace workspace= JavaPlugin.getWorkspace();
workspace.addResourceChangeListener(fResourceChangeListener);
fPropertyChangeListener= new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty()))
forceReconciling();
}
};
JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener);
fReconciledElement= EditorUtility.getEditorInputJavaElement(fTextEditor, false);
}
示例5: getWindow
import org.eclipse.ui.IWorkbenchPartSite; //导入方法依赖的package包/类
protected static IWorkbenchWindow getWindow(IWorkbenchPart part) {
IWorkbenchWindow window;
IWorkbenchPartSite currentSite = part != null ? part.getSite() : null;
if (currentSite != null) {
window = currentSite.getWorkbenchWindow();
} else {
window = FindbugsPlugin.getActiveWorkbenchWindow();
}
return window;
}