當前位置: 首頁>>代碼示例>>Java>>正文


Java ConsolePlugin.getDefault方法代碼示例

本文整理匯總了Java中org.eclipse.ui.console.ConsolePlugin.getDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java ConsolePlugin.getDefault方法的具體用法?Java ConsolePlugin.getDefault怎麽用?Java ConsolePlugin.getDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.console.ConsolePlugin的用法示例。


在下文中一共展示了ConsolePlugin.getDefault方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: partOpened

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
@Override
	public void partOpened(IWorkbenchPart part) {
		super.partOpened(part);

		if (getComponentCanvas() != null) {
			ConsolePlugin plugin = ConsolePlugin.getDefault();
			IConsoleManager conMan = plugin.getConsoleManager();

			String consoleName = getComponentCanvas().getActiveProject() + "." + getComponentCanvas().getJobName();

			IConsole consoleToShow = getConsole(consoleName, conMan);

			if (consoleToShow != null) {
//				Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J)
//				conMan.showConsoleView(consoleToShow);
			} else {
				addDummyConsole();
			}
		}
	}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:21,代碼來源:HydrographConsole.java

示例2: getConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
/**
 * Get the console with the given name. If the console does not exist, then
 * a new one is created.
 * 
 * @param name
 * @return
 */
public static MessageConsole getConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	IConsole[] existing = conMan.getConsoles();
	for (int i = 0; i < existing.length; i++) {
		if (name.equals(existing[i].getName())) {
			return (MessageConsole) existing[i];
		}
	}

	// no console found, so create a new one
	MessageConsole console = new MessageConsole(name, null);
	conMan.addConsoles(new IConsole[] { console });

	// create a new logger handler
	Logger.addHandler(new EclipseConsoleHandler(console));

	return console;
}
 
開發者ID:turnus,項目名稱:turnus,代碼行數:27,代碼來源:EclipseUtils.java

示例3: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private MessageConsole findConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	
	// search existing consoles
	IConsole[] existing = conMan.getConsoles();
	for (int i = 0; i < existing.length; i++) {
		if (name.equals(existing[i].getName())){
			return (MessageConsole) existing[i];
		}
	}
	
	// no console found, so create a new one
	MessageConsole myConsole = new MessageConsole(name, null);
	conMan.addConsoles(new IConsole[]{myConsole});
	conMan.showConsoleView(myConsole);
	return myConsole;
}
 
開發者ID:alexander-bergmayr,項目名稱:caml2tosca,代碼行數:19,代碼來源:C2TRunHandler.java

示例4: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

		if (ConsolePlugin.getDefault() == null)
			return null;
		ConsolePlugin plugin = ConsolePlugin.getDefault();
		IConsoleManager YangConsole = plugin.getConsoleManager();
		IConsole[] existing = YangConsole.getConsoles();
		for (int i = 0; i < existing.length; i++)
			if (name.equals(existing[i].getName())) {
				YangConsole.showConsoleView(existing[i]);
				return (MessageConsole) existing[i];
			}
		MessageConsole myConsole = new MessageConsole(name, null);
		YangConsole.addConsoles(new IConsole[] { myConsole });
		return myConsole;
	}
 
開發者ID:att,項目名稱:yang-design-studio,代碼行數:17,代碼來源:YangToPNG.java

示例5: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

   if (ConsolePlugin.getDefault() == null)
    	return null;
   ConsolePlugin plugin = ConsolePlugin.getDefault();
   IConsoleManager YangConsole = plugin.getConsoleManager();
   IConsole[] existing = YangConsole.getConsoles();
   for (int i = 0; i < existing.length; i++)
      if (name.equals(existing[i].getName())) {
      	YangConsole.showConsoleView(existing[i]);
      	return (MessageConsole) existing[i];
      }
   MessageConsole myConsole = new MessageConsole(name, null);
   YangConsole.addConsoles(new IConsole[] { myConsole });
   return myConsole;
}
 
開發者ID:att,項目名稱:yang-design-studio,代碼行數:17,代碼來源:YangToSkelxml.java

示例6: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

   if (ConsolePlugin.getDefault() == null)
    	return null;
   ConsolePlugin plugin = ConsolePlugin.getDefault();
   IConsoleManager YangConsole = plugin.getConsoleManager();
   IConsole[] existing = YangConsole.getConsoles();
   for (int i = 0; i < existing.length; i++)
      if (name.equals(existing[i].getName())) {
      	YangConsole.showConsoleView(existing[i]);
      	return (MessageConsole) existing[i];
      }
   // no console found, so create a new one
   MessageConsole myConsole = new MessageConsole(name, null);
   YangConsole.addConsoles(new IConsole[] { myConsole });
   return myConsole;
}
 
開發者ID:att,項目名稱:yang-design-studio,代碼行數:18,代碼來源:YangToDsdl.java

示例7: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

          			if (ConsolePlugin.getDefault() == null)
          				return null;
          			ConsolePlugin plugin = ConsolePlugin.getDefault();
          			IConsoleManager YangConsole = plugin.getConsoleManager();
          			IConsole[] existing = YangConsole.getConsoles();
          			for (int i = 0; i < existing.length; i++)
          				if (name.equals(existing[i].getName())) {
          					YangConsole.showConsoleView(existing[i]);
          					return (MessageConsole) existing[i];
          				}
          			MessageConsole myConsole = new MessageConsole(name, null);
          			YangConsole.addConsoles(new IConsole[] { myConsole });
          			return myConsole;
          		}
 
開發者ID:att,項目名稱:yang-design-studio,代碼行數:17,代碼來源:YangToTree.java

示例8: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

            			if (ConsolePlugin.getDefault() == null)
            				return null;
            			ConsolePlugin plugin = ConsolePlugin.getDefault();
            			IConsoleManager YangConsole = plugin.getConsoleManager();
            			IConsole[] existing = YangConsole.getConsoles();
            			for (int i = 0; i < existing.length; i++)
            				if (name.equals(existing[i].getName())) {
            					YangConsole.showConsoleView(existing[i]);
            					return (MessageConsole) existing[i];
            				}
            			MessageConsole myConsole = new MessageConsole(name, null);
            			YangConsole.addConsoles(new IConsole[] { myConsole });
            			return myConsole;
            		}
 
開發者ID:att,項目名稱:yang-design-studio,代碼行數:17,代碼來源:YangToYin.java

示例9: createConsoles

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private void createConsoles() {
	ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
	IConsoleManager consoleManager = consolePlugin.getConsoleManager();
	
	stdoutConsole = new MessageConsole("Stdout", ImageDescriptor.createFromFile(getClass(), "/consoles/stdout.gif"));
	stdoutConsole.setTabWidth(TAB_WIDTH);
	stdoutConsoleStream = stdoutConsole.newMessageStream();
	stderrConsoleStream = stdoutConsole.newMessageStream();
	stderrConsoleStream.setColor(stderrConsoleStreamColor);
	
	engineConsole = new MessageConsole("Engine", ImageDescriptor.createFromFile(getClass(), "/consoles/engine.gif"));
	engineConsole.setTabWidth(TAB_WIDTH);
	engineConsoleStream = engineConsole.newMessageStream();

	consoleManager.addConsoles(new IConsole[] {
		engineConsole,
		stdoutConsole
	});
	
	consolePipes = new ConsolePipes();
	
	debugConsoleStream = new MessageConsoleStream(engineConsole) {

		@Override
		public void write(String str) throws IOException {
			if (str.endsWith("\n")) {
				str = str.substring(0, str.length() - 1);
			}
			Engine.logStudio.info("[debug] " + str);
		}
		
	};
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:34,代碼來源:ConvertigoPlugin.java

示例10: getConsoleManager

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
/**
 * 
 *  get default console manager
 * 
 * @return ConsoleManager
 */
private IConsoleManager getConsoleManager() {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	logger.debug("Retrieved Console plugin object");
	IConsoleManager conMan = plugin.getConsoleManager();
	logger.debug("Retrieved Console manager");
	return conMan;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:14,代碼來源:ConsoleLogger.java

示例11: addDummyConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private void addDummyConsole() {
		ConsolePlugin plugin = ConsolePlugin.getDefault();
		IConsoleManager conMan = plugin.getConsoleManager();

		IConsole consoleToShow = getConsole(DEFAULT_CONSOLE, conMan);

		if (consoleToShow == null) {
			consoleToShow = createNewMessageConsole(DEFAULT_CONSOLE, conMan);
		}
//		Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J)
//		conMan.showConsoleView(consoleToShow);
	}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:13,代碼來源:HydrographConsole.java

示例12: addDummyConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private void addDummyConsole(){
		ConsolePlugin plugin = ConsolePlugin.getDefault();
		IConsoleManager consoleManager = plugin.getConsoleManager();

		IConsole consoleToShow = getConsole(DEFAULT_CONSOLE, consoleManager);	

		if(consoleToShow == null){
			consoleToShow = createNewMessageConsole(DEFAULT_CONSOLE,consoleManager);
		}
//		Fix for : Console window is getting displayed if user maximize canvas window and then try to create new job (Ctrl+J) 
//		consoleManager.showConsoleView(consoleToShow);
	}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:13,代碼來源:ELTGraphicalEditor.java

示例13: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private MessageConsole findConsole(final String name) {
  final ConsolePlugin plugin = ConsolePlugin.getDefault();
  final IConsoleManager conMan = plugin.getConsoleManager();
  final IConsole[] existing = conMan.getConsoles();
  for (int i = 0; i < existing.length; i++) {
    if (name.equals(existing[i].getName())) {
      return (MessageConsole) existing[i];
    }
  }
  // no console found, so create a new one
  final MessageConsole myConsole = new MessageConsole(name, null);
  conMan.addConsoles(new IConsole[] {myConsole});
  return myConsole;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:15,代碼來源:LaunchModel.java

示例14: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private MessageConsole findConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	IConsole[] existing = conMan.getConsoles();
	for (int i = 0; i < existing.length; i++) {
		if (name.equals(existing[i].getName()))
			return (MessageConsole) existing[i];
	}
	//no console found, so create a new one
	MessageConsole myConsole = new MessageConsole(name, null);
	conMan.addConsoles(new IConsole[]{myConsole});
	return myConsole;
}
 
開發者ID:jason-lang,項目名稱:jason-eclipse-plugin,代碼行數:14,代碼來源:RunJasonFileEditor.java

示例15: findConsole

import org.eclipse.ui.console.ConsolePlugin; //導入方法依賴的package包/類
private EGradleSystemConsole findConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	IConsole[] existing = conMan.getConsoles();
	for (int i = 0; i < existing.length; i++) {
		if (name.equals(existing[i].getName())) {
			return (EGradleSystemConsole) existing[i];
		}

	}
	// no console found, so create a new one
	EGradleSystemConsole myConsole = createConsole(name, conMan);
	return myConsole;
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:15,代碼來源:EGradleSystemConsoleFactory.java


注:本文中的org.eclipse.ui.console.ConsolePlugin.getDefault方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。