本文整理汇总了Java中org.eclipse.ui.IWorkbenchPage.showView方法的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchPage.showView方法的具体用法?Java IWorkbenchPage.showView怎么用?Java IWorkbenchPage.showView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.IWorkbenchPage
的用法示例。
在下文中一共展示了IWorkbenchPage.showView方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openView
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
/**
* Opens the view with the given identifier.
*
* @param viewId
* The view to open; must not be <code>null</code>
* @throws PartInitException
* If the part could not be initialized.
*/
private final void openView ( final String viewId, final String secondaryId, final IWorkbenchWindow activeWorkbenchWindow ) throws PartInitException
{
final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage ();
if ( activePage == null )
{
return;
}
if ( secondaryId != null )
{
activePage.showView ( viewId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE );
}
else
{
activePage.showView ( viewId );
}
}
示例2: getInstance
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
/**
* Returns the instance of this view in the active workbench page. Will open the view if not open already. Returns
* <code>null</code> on error (e.g. not invoked from UI thread).
*
* @param activate
* if true, the view will be brought to the front.
*/
public static TestResultsView getInstance(boolean activate) {
try {
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
final TestResultsView view = (TestResultsView) page.showView(ID);
if (activate)
page.activate(view);
return view;
} catch (Exception e) {
return null;
}
}
示例3: execute
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Execute
public void execute() {
try {
// --- Show or hide the console view ----------
IWorkbenchPage wbPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart viewConsole = wbPage.findView(AppModelId.PART_ORG_AGENTGUI_CORE_PART_CONSOLE);
if (viewConsole==null) {
// --- Open console view ------------------
wbPage.showView(AppModelId.PART_ORG_AGENTGUI_CORE_PART_CONSOLE);
} else {
// --- Close console view -----------------
int currentState = wbPage.getPartState(wbPage.getReference(viewConsole));
if (currentState==IWorkbenchPage.STATE_MAXIMIZED) {
wbPage.activate(viewConsole);
wbPage.setPartState(wbPage.getReference(viewConsole), IWorkbenchPage.STATE_RESTORED);
// --- To be progressed! --------------
wbPage.resetPerspective();
}
wbPage.hideView(viewConsole);
}
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例4: performFinish
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Override
public boolean performFinish() {
ZooKeeperConnectionDescriptor connectionDescriptor = _Page1.getConnectionDescriptor();
List<AuthInfo> authInfos = _Page2.getAuthInfos();
if (authInfos != null && authInfos.size() > 0) {
connectionDescriptor.setAuthInfos(authInfos);
}
ZooKeeperActivator plugin = ZooKeeperActivator.getDefault();
DataModelManager<ZooKeeperConnectionModel, ZooKeeperConnectionDescriptor, ZooKeeperConnection> zooKeeperConnectionModelManager = plugin
.getZooKeeperConnectionModelManager();
zooKeeperConnectionModelManager.insertData(connectionDescriptor, null);
// Force the new model creation
zooKeeperConnectionModelManager.getModel(connectionDescriptor);
IWorkbenchPage page = plugin.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
page.showView(ZooKeeperExplorerView.ID);
}
catch (PartInitException e) {
ZooKeeperActivator.reportError(e);
}
return true;
}
示例5: performFinish
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Override
public boolean performFinish() {
String name = _Page1.getConnectionName();
JMXServiceURL serviceURL = _Page1.getServiceUrl();
String userName = _Page1.getUserName();
String password = (userName != null) ? _Page1.getPassword() : null;
JmxConnectionDescriptor connectionDescriptor = new JmxConnectionDescriptor(name, serviceURL, userName, password);
JmxActivator plugin = JmxActivator.getDefault();
DataModelManager<JmxConnectionModel, JmxConnectionDescriptor, JmxConnection> zooKeeperConnectionModelManager = plugin
.getJmxConnectionModelManager();
zooKeeperConnectionModelManager.insertData(connectionDescriptor, null);
// Force the new model creation
zooKeeperConnectionModelManager.getModel(connectionDescriptor);
IWorkbenchPage page = plugin.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
page.showView(JmxExplorerView.ID);
}
catch (PartInitException e) {
JmxActivator.reportError(e);
}
return true;
}
示例6: performRequest
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Override
public void performRequest(Request req) {
if (req.getType().equals(RequestConstants.REQ_OPEN)) {
try {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.showView(IPageLayout.ID_PROP_SHEET);
} catch (PartInitException e) {
e.printStackTrace();
}
}
}
示例7: showView
import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public static IViewPart showView(String viewId) {
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage != null) {
try {
return activePage.showView(viewId);
} catch (PartInitException e) {
e.printStackTrace();
}
}
}
return null;
}