本文整理汇总了Java中org.eclipse.ui.application.IWorkbenchWindowConfigurer.getWindow方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchWindowConfigurer.getWindow方法的具体用法?Java IWorkbenchWindowConfigurer.getWindow怎么用?Java IWorkbenchWindowConfigurer.getWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.application.IWorkbenchWindowConfigurer
的用法示例。
在下文中一共展示了IWorkbenchWindowConfigurer.getWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preWindowOpen
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; //导入方法依赖的package包/类
public void preWindowOpen()
{
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(800, 600));
configurer.setShowFastViewBars(true);
configurer.setShowStatusLine(true);
configurer.setShowProgressIndicator(true);
configurer.setShowCoolBar(false);
// A DropTargetAdapter is need for editor DND support
final DropTargetListener dtl = new EditorAreaDropAdapter(
configurer.getWindow());
configurer.configureEditorAreaDropListener(dtl);
}
示例2: updateTitle
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; //导入方法依赖的package包/类
/**
* Updates the window title. Format will be:
* <p>
* [pageInput -] [currentPerspective -] [editorInput -] [workspaceLocation -] productName
*/
private void updateTitle() {
final IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
final IWorkbenchWindow window = configurer.getWindow();
IWorkbenchPart activePart = null;
final IWorkbenchPage currentPage = window.getActivePage();
IPerspectiveDescriptor persp = null;
if (currentPage != null) {
persp = currentPage.getPerspective();
activePart = currentPage.getActivePart();
}
// Nothing to do if the part hasn't changed
if ((activePart == _lastActivePart) && (currentPage == _lastActivePage) && (persp == _lastPerspective)) {
return;
}
if (_lastActivePart != null) {
_lastActivePart.removePropertyListener(_partPropertyListener);
}
_lastActivePart = activePart;
_lastActivePage = currentPage;
_lastPerspective = persp;
if (activePart != null) {
activePart.addPropertyListener(_partPropertyListener);
}
recomputeTitle();
}
示例3: updateTitle
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; //导入方法依赖的package包/类
/**
* Updates the window title. Format will be: [pageInput -] [currentPerspective -] [editorInput -]
* [workspaceLocation -] productName
*
* @param editorHidden
* TODO
*/
private void updateTitle(boolean editorHidden)
{
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
IWorkbenchWindow window = configurer.getWindow();
IEditorPart activeEditor = null;
IWorkbenchPage currentPage = window.getActivePage();
IPerspectiveDescriptor persp = null;
IAdaptable input = null;
if (currentPage != null)
{
activeEditor = currentPage.getActiveEditor();
persp = currentPage.getPerspective();
input = currentPage.getInput();
}
if (editorHidden)
{
activeEditor = null;
}
// Nothing to do if the editor hasn't changed
if (activeEditor == lastActiveEditor && currentPage == lastActivePage
&& persp == lastPerspective && input == lastInput)
{
return;
}
if (lastActiveEditor != null)
{
lastActiveEditor.removePropertyListener(editorPropertyListener);
}
lastActiveEditor = activeEditor;
lastActivePage = currentPage;
lastPerspective = persp;
lastInput = input;
if (activeEditor != null)
{
activeEditor.addPropertyListener(editorPropertyListener);
}
recomputeTitle();
}
示例4: postWindowRestore
import org.eclipse.ui.application.IWorkbenchWindowConfigurer; //导入方法依赖的package包/类
public void postWindowRestore() throws WorkbenchException
{
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
IWorkbenchWindow window = configurer.getWindow();
int index = getWorkbench().getWorkbenchWindowCount() - 1;
AboutInfo[] welcomePerspectiveInfos =
wbAdvisor.getWelcomePerspectiveInfos();
if (index >= 0 && welcomePerspectiveInfos != null
&& index < welcomePerspectiveInfos.length)
{
// find a page that exist in the window
IWorkbenchPage page = window.getActivePage();
if (page == null)
{
IWorkbenchPage[] pages = window.getPages();
if (pages != null && pages.length > 0)
{
page = pages[0];
}
}
// if the window does not contain a page, create one
String perspectiveId =
welcomePerspectiveInfos[index].getWelcomePerspectiveId();
if (page == null)
{
IAdaptable root = wbAdvisor.getDefaultPageInput();
page = window.openPage(perspectiveId, root);
}
else
{
IPerspectiveRegistry reg = getWorkbench().getPerspectiveRegistry();
IPerspectiveDescriptor desc = reg.findPerspectiveWithId(perspectiveId);
if (desc != null)
{
page.setPerspective(desc);
}
}
// set the active page and open the welcome editor
window.setActivePage(page);
page.openEditor(new WelcomeEditorInput(welcomePerspectiveInfos[index]),
WELCOME_EDITOR_ID, true);
}
cleanUpEditorArea();
}