當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。