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


Java IConsole類代碼示例

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


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

示例1: showConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
public static PluginDependenciesConsole showConsole() {
    IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    boolean exists = false;
    if (console != null) {
        IConsole[] existing = manager.getConsoles();
        for (int i = 0; i < existing.length; i++) {
            if (console == existing[i]) {
                exists = true;
            }
        }
    } else {
        console = new PluginDependenciesConsole("Plug-in Dependencies", null, true);
    }
    if (!exists) {
        manager.addConsoles(new IConsole[] { console });
    }
    ITheme theme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    theme.addPropertyChangeListener(console);
    console.setConsoleFont();
    manager.showConsoleView(console);
    return console;
}
 
開發者ID:iloveeclipse,項目名稱:plugindependencies,代碼行數:23,代碼來源:PluginDependenciesConsole.java

示例2: getOutputStream

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
@Override
public OutputStream getOutputStream(final OutputStreamType type, OutputRedirection redirect) {
	if (!PlatformUI.isWorkbenchRunning()) {
		return DEFAULT.getOutputStream(type, redirect);
	}
	final MessageConsole console = consoleSupplier.get();
	boolean silent = redirect == OutputRedirection.SUPPRESS;
	if (!silent) {
		console.activate();
	}
	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
	final MessageConsoleStream stream = console.newMessageStream();
	getDisplay().asyncExec(() -> {
		stream.setColor(toColor(type));
		showConsoleView(silent);
	});
	return stream;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:19,代碼來源:ConsoleOutputStreamProvider.java

示例3: execute

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
@Override
public Object execute ( final ExecutionEvent event ) throws ExecutionException
{
    final List<IConsole> consoles = new ArrayList<IConsole> ();

    for ( final Item item : SelectionHelper.iterable ( getSelection (), Item.class ) )
    {
        final IConsole console = createConsole ( item ).getConsole ();
        if ( console != null )
        {
            consoles.add ( console );
        }
    }

    final IConsoleManager cm = ConsolePlugin.getDefault ().getConsoleManager ();
    if ( !consoles.isEmpty () )
    {
        cm.addConsoles ( consoles.toArray ( new IConsole[consoles.size ()] ) );
        cm.showConsoleView ( consoles.get ( 0 ) );
    }

    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:StartItemTrace.java

示例4: getConsoleIO

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
/**
  * retrieve or create a ConsoleIO with the given UId
  * the name is used only if the console is created
  * @param name
  * @return
  */
 public EclipseConsoleIO getConsoleIO(String uid, String name){    	
 	
 	EclipseConsoleIO consoleIo=consoleIOMap.get(uid);    	
 	if(consoleIo == null){
 		// create the eclipse console
 		IOConsole ioConsole = new IOConsole(name, null);
  	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ ioConsole });
// ConsolePlugin.getDefault().getConsoleManager().showConsoleView(ioConsole);
// ioConsole.activate(); // console will be displayed on first use
 		// create the IO with this console
consoleIo = new EclipseConsoleIO(ioConsole);
  	consoleIOMap.put(uid, consoleIo);
 	}
 	return consoleIo;
 }
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:22,代碼來源:EclipseConsoleIOFactory.java

示例5: partOpened

import org.eclipse.ui.console.IConsole; //導入依賴的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

示例6: init

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
@Override
public void init(IPageBookViewPage page, IConsole console) {
  Preconditions.checkArgument(console instanceof DeployConsole,
                              "console should be instance of %s",
                              DeployConsole.class.getName());
  this.console = (DeployConsole) console;

  console.addPropertyChangeListener(new IPropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent event) {
      if (event.getProperty().equals(DeployConsole.PROPERTY_JOB)) {
        // keep the order of adding a listener and then calling update() to ensure update
        // is called regardless of when the job finishes
        addJobChangeListener();
        update();
      }
    }
  });
  IActionBars actionBars = page.getSite().getActionBars();
  configureToolBar(actionBars.getToolBarManager());
  // keep the order of adding a listener and then calling update() to ensure update
  // is called regardless of when the job finishes
  addJobChangeListener();
  update();
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:26,代碼來源:DeployConsolePageParticipant.java

示例7: AndroidConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
public AndroidConsole() {
	console = new MessageConsole("Android", null);
	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
	out = console.newMessageStream();
	err = console.newMessageStream();

	// set the colors
	final Display display = Display.getDefault();
	display.syncExec(new Runnable() {
		@Override
		public void run() {
			out.setColor(display.getSystemColor(SWT.COLOR_BLACK));
			err.setColor(display.getSystemColor(SWT.COLOR_RED));
		}
	});
}
 
開發者ID:dschaefer,項目名稱:andmore2,代碼行數:17,代碼來源:AndroidConsole.java

示例8: getConsole

import org.eclipse.ui.console.IConsole; //導入依賴的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

示例9: openConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
@Override
public void openConsole() {
    console = getConsole();
    if (console != null) {
        IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
        IConsole[] existing = manager.getConsoles();
        boolean exists = false;
        for (int i = 0; i < existing.length; i++) {
            if(console == existing[i])
                exists = true;
        }
        if(!exists)
            manager.addConsoles(new IConsole[] {console});
        manager.showConsoleView(console);
    }
}
 
開發者ID:Ericsson,項目名稱:CodeCheckerEclipsePlugin,代碼行數:17,代碼來源:ConsoleFactory.java

示例10: findConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
/**
 * Fins the console with a given name
 * @param name, name of the console
 * @return
 */
private static MessageConsole findConsole(String name)
{
    if (name == null)
    {
        throw new IllegalArgumentException("Console name must be not null");
    }
    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();

    IConsole[] existing = consoleManager.getConsoles();
    // try to find existing
    for (int i = 0; i < existing.length; i++)
    {
        if (name.equals(existing[i].getName()))
        {
            return (MessageConsole) existing[i];
        }
    }

    // no console found, create a new one
    MessageConsole myConsole = new MessageConsole(name, null);
    consoleManager.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:29,代碼來源:ConsoleFactory.java

示例11: findConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
/**
 * Finds the console with a given name.
 * 
 * @param name, name of the console
 * @return
 */
private static MessageConsole findConsole(String name)
{
    if (name == null)
    {
        throw new IllegalArgumentException("Console name must be not null");
    }
    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();

    IConsole[] existing = consoleManager.getConsoles();
    // try to find existing
    for (int i = 0; i < existing.length; i++)
    {
        if (name.equals(existing[i].getName()))
        {
            return (MessageConsole) existing[i];
        }
    }

    // no console found, create a new one
    MessageConsole myConsole = new MessageConsole(name, null);
    consoleManager.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
 
開發者ID:tlaplus,項目名稱:tlaplus,代碼行數:30,代碼來源:TLAPMConsoleFactory.java

示例12: showConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
public static void showConsole(IConsole console) {
	if (console != null) {
		IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
		IConsole[] existing = manager.getConsoles();
		boolean exists = false;
		for (int i = 0; i < existing.length; i++) {
			if (console == existing[i]) {
				exists = true;
			}
		}
		if (!exists) {
			manager.addConsoles(new IConsole[] { console });
		}
		manager.showConsoleView(console);
	}
}
 
開發者ID:angelozerr,項目名稱:typescript.java,代碼行數:17,代碼來源:TypeScriptConsoleHelper.java

示例13: findConsole

import org.eclipse.ui.console.IConsole; //導入依賴的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

示例14: isCloudFoundryConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
protected boolean isCloudFoundryConsole(IConsole console) {
	if (console instanceof MessageConsole) {
		MessageConsole messageConsole = (MessageConsole) console;
		Object cfServerObj = messageConsole.getAttribute(ApplicationLogConsole.ATTRIBUTE_SERVER);
		Object cfAppModuleObj = messageConsole.getAttribute(ApplicationLogConsole.ATTRIBUTE_APP);
		if (cfServerObj instanceof CloudFoundryServer && cfAppModuleObj instanceof CloudFoundryApplicationModule) {
			CloudFoundryServer cfServer = (CloudFoundryServer) cfServerObj;
			CloudFoundryApplicationModule appModule = (CloudFoundryApplicationModule) cfAppModuleObj;

			CloudConsoleManager manager = ConsoleManagerRegistry.getConsoleManager(cfServer.getServer());
			if (manager != null) {
				MessageConsole existingConsole = manager.findCloudFoundryConsole(cfServer.getServer(), appModule);
				return messageConsole == existingConsole;
			}
		}
	}
	return false;
}
 
開發者ID:eclipse,項目名稱:cft,代碼行數:19,代碼來源:CloudFoundryConsolePageParticipant.java

示例15: getConsole

import org.eclipse.ui.console.IConsole; //導入依賴的package包/類
public static IConsole getConsole(IWorkbenchPart part) {
      if(!(part instanceof IViewPart)){
          return null;
      }

      IViewPart vp =(IViewPart) part;
      if (vp instanceof PageBookView) {
          IPage page = ((PageBookView) vp).getCurrentPage();
          ITextViewer viewer = getViewer(page);
          if (viewer == null || viewer.getDocument() == null)
          	return null;
      }

      IConsole con = null;
  	try {
  		con = ((IConsoleView)part).getConsole();
  	} catch (Exception e) {

}

return con;
  }
 
開發者ID:anb0s,項目名稱:LogViewer,代碼行數:23,代碼來源:ResourceUtils.java


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