当前位置: 首页>>代码示例>>Java>>正文


Java WorkbenchAdvisor类代码示例

本文整理汇总了Java中org.eclipse.ui.application.WorkbenchAdvisor的典型用法代码示例。如果您正苦于以下问题:Java WorkbenchAdvisor类的具体用法?Java WorkbenchAdvisor怎么用?Java WorkbenchAdvisor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WorkbenchAdvisor类属于org.eclipse.ui.application包,在下文中一共展示了WorkbenchAdvisor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext) <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
@Override
public Object start(IApplicationContext context) throws Exception {
  WorkbenchAdvisor workbenchAdvisor = new TriquetrumEditorAdvisor();
  Display display = PlatformUI.createDisplay();
  try {
    int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
    if (returnCode == PlatformUI.RETURN_RESTART) {
      return IApplication.EXIT_RESTART;
    } else {
      return IApplication.EXIT_OK;
    }
  } finally {
    display.dispose();
  }
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:20,代码来源:TriquetrumEditorAdvisor.java

示例2: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Object start(IApplicationContext context) throws Exception {
	WorkbenchAdvisor workbenchAdvisor = new WTSpec4MEditorAdvisor();
	Display display = PlatformUI.createDisplay();
	try {
		int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
		if (returnCode == PlatformUI.RETURN_RESTART) {
			return IApplication.EXIT_RESTART;
		}
		else {
			return IApplication.EXIT_OK;
		}
	}
	finally {
		display.dispose();
	}
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:23,代码来源:WTSpec4MEditorAdvisor.java

示例3: startWorkbench

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
private void startWorkbench() {
  PlatformUI.createAndRunWorkbench(PlatformUI.createDisplay(),
      new WorkbenchAdvisor() {
        @Override
        public String getInitialWindowPerspectiveId() {
          return null;
        }

        @Override
        public void postStartup() {
          // Kill it when it opens so that the thread is unstuck.
          Workbench.getInstance().close();
        }

      });
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:17,代码来源:GWTCodeFormatterApplication.java

示例4: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Object start(IApplicationContext context) throws Exception {
	WorkbenchAdvisor workbenchAdvisor = new DictionaryEditorAdvisor();
	Display display = PlatformUI.createDisplay();
	try {
		int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
		if (returnCode == PlatformUI.RETURN_RESTART) {
			return IApplication.EXIT_RESTART;
		}
		else {
			return IApplication.EXIT_OK;
		}
	}
	finally {
		display.dispose();
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:DictionaryEditorAdvisor.java

示例5: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Object start(IApplicationContext context) throws Exception {
	WorkbenchAdvisor workbenchAdvisor = new DbchangelogEditorAdvisor();
	Display display = PlatformUI.createDisplay();
	try {
		int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
		if (returnCode == PlatformUI.RETURN_RESTART) {
			return IApplication.EXIT_RESTART;
		}
		else {
			return IApplication.EXIT_OK;
		}
	}
	finally {
		display.dispose();
	}
}
 
开发者ID:dzonekl,项目名称:LiquibaseEditor,代码行数:23,代码来源:DbchangelogEditorAdvisor.java

示例6: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Object start(IApplicationContext context) throws Exception {
	WorkbenchAdvisor workbenchAdvisor = new OverviewEditorAdvisor();
	Display display = PlatformUI.createDisplay();
	try {
		int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
		if (returnCode == PlatformUI.RETURN_RESTART) {
			return IApplication.EXIT_RESTART;
		}
		else {
			return IApplication.EXIT_OK;
		}
	}
	finally {
		display.dispose();
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:23,代码来源:OverviewEditorAdvisor.java

示例7: createUI

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
public int createUI() {
   final Display display = PlatformUI.createDisplay();
   
   UICallBack.activate(String.valueOf(display.hashCode()));
   RWT.getSessionStore().addSessionStoreListener(new SessionStoreListener() {
	
	public void beforeDestroy(SessionStoreEvent event) {
		UICallBack.deactivate(String.valueOf(display.hashCode()));
	}
});
   
   WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
   return PlatformUI.createAndRunWorkbench( display, advisor );
 }
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:15,代码来源:Application.java

示例8: start

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
@Override
	public Object start(IApplicationContext context) throws Exception {
		//
		// Comment out check until the missing
//		if (!checkWorkspaceLock(new Shell(PlatformUI.createDisplay(), SWT.ON_TOP))) {
//			Platform.endSplash();
//			return IApplication.EXIT_OK;
//		}

		String productName = "Ensemble";
		if (Platform.getProduct() != null)
			productName = Platform.getProduct().getName();
		Display.setAppName(productName);

		Authenticator login = AuthenticationUtil.getAuthenticator();
		boolean isAuthenticated = false;

		if (login != null) {
			// may need these credentials later
			credentials = login.getCredentials();
			isAuthenticated = login.isAuthenticated();
		} else {
			// Setup the authenticator that gets us through the password check on the website
			java.net.Authenticator.setDefault(new java.net.Authenticator() {
				@Override
				protected PasswordAuthentication getPasswordAuthentication() {
					Properties properties = CommonPlugin.getDefault().getEnsembleProperties();
					String user = properties.getProperty(APACHE_SERVER_USER_PROPERTY, "");
					String pass = properties.getProperty(APACHE_SERVER_PASS_PROPERTY, "");
					return new PasswordAuthentication(user, pass.toCharArray());
				}
			});

			isAuthenticated = true;
		}
		Display display = null;
		String sleakEnabled = EnsembleProperties.getProperty("sleak.enabled");
		if (sleakEnabled != null && Boolean.valueOf(sleakEnabled)){
			DeviceData data = new DeviceData();
		    data.tracking = true;
		    display = new Display(data);
		    Sleak sleak = new Sleak();
		    sleak.open();
		} else {
			display = Display.getDefault();
		}
		PlatformUI.createDisplay();
		try {
			if (isAuthenticated) {
				WorkbenchAdvisor workbenchAdvisor;
				try {
					workbenchAdvisor = MissionExtender.construct(EnsembleWorkbenchAdvisor.class);
				} catch (ConstructionException e) {
					trace.warn("couldn't instantiate mission-specific EnsembleWorkbenchAdvisor");
					workbenchAdvisor = new EnsembleWorkbenchAdvisor() {
						@Override
						public String getInitialWindowPerspectiveId() {
							return null;
						}
					};
				}
				DynamicExtensionUtils.removeIgnoredExtensions();
				int returnCode = PlatformUI.createAndRunWorkbench(display, workbenchAdvisor);
				if (returnCode == PlatformUI.RETURN_RESTART) {
					return IApplication.EXIT_RESTART;
				}
				return IApplication.EXIT_OK;
			}
			// authentication failed
			context.applicationRunning();
			return IApplication.EXIT_OK;

		} finally {
			display.dispose();
		}
	}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:77,代码来源:EnsembleApplication.java

示例9: createUI

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
@Override
public int createUI() {
	Display display = PlatformUI.createDisplay();
	WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
	return PlatformUI.createAndRunWorkbench(display, advisor);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:7,代码来源:Application.java

示例10: createWorkbenchAdvisor

import org.eclipse.ui.application.WorkbenchAdvisor; //导入依赖的package包/类
/**
 * Creates a workbench advisor to be used by the created workbench.
 *
 * @param parameters
 *            the parameters that may give hints on how to create the advisor
 * @return a new advisor instance
 */
protected WorkbenchAdvisor createWorkbenchAdvisor(final Map<String, Object> parameters) {
    OpenDocumentEventProcessor openDocProcessor =
            (OpenDocumentEventProcessor) parameters.get(OpenDocumentEventProcessor.OPEN_DOC_PROCESSOR);
    return new YamcsStudioWorkbenchAdvisor(openDocProcessor);
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:13,代码来源:Workbench.java


注:本文中的org.eclipse.ui.application.WorkbenchAdvisor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。