本文整理匯總了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;
}