Java 类org.eclipse.ui.console.IConsole 实例源码

项目:plugindependencies    文件:PluginDependenciesConsole.java   
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;
}
项目:n4js    文件:ConsoleOutputStreamProvider.java   
@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;
}
项目:neoscada    文件:StartItemTrace.java   
@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;
}
项目:gemoc-studio    文件:EclipseConsoleIOFactory.java   
/**
  * 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;
 }
项目:Hydrograph    文件:HydrographConsole.java   
@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();
            }
        }
    }
项目:google-cloud-eclipse    文件:DeployConsolePageParticipant.java   
@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();
}
项目:andmore2    文件:AndroidConsole.java   
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));
        }
    });
}
项目:turnus    文件:EclipseUtils.java   
/**
 * 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;
}
项目:CodeCheckerEclipsePlugin    文件:ConsoleFactory.java   
@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);
    }
}
项目:tlaplus    文件:ConsoleFactory.java   
/**
 * 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;
}
项目:tlaplus    文件:TLAPMConsoleFactory.java   
/**
 * 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;
}
项目:typescript.java    文件:TypeScriptConsoleHelper.java   
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);
    }
}
项目:caml2tosca    文件:C2TRunHandler.java   
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;
}
项目:cft    文件:CloudFoundryConsolePageParticipant.java   
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;
}
项目:LogViewer    文件:ResourceUtils.java   
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;
  }
项目:LogViewer    文件:LogFileTypeDialog.java   
protected Control createDialogArea(Composite parent) {
    String fileTypeName = "File";
    // create composite
    Composite composite = (Composite) super.createDialogArea(parent);
    // create combo
    typeCombo = new Combo(composite,SWT.LEFT);
    GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
    typeCombo.setLayoutData(data);
    // fill
    IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
    typeCombo.add(fileTypeName);
    value = fileTypeName;       
    for (int i=0;i<consoles.length;i++) {
        typeCombo.add("Console: " + consoles[i].getName());
    }
    applyDialogFont(composite);
    return composite;
}
项目:LogViewer    文件:ConsoleOpenAction.java   
public boolean isEnabled()
{
    boolean enabled = false;
    if (currentSelection != null)
    {
        Object[] selectedObjects = currentSelection.toArray();
        if (selectedObjects.length >= 1)
        {
            resource = new IConsole[selectedObjects.length];
            for (int i=0;i<selectedObjects.length;i++) {
                resource[i] = (IConsole)selectedObjects[i];
                if (resource[i] != null)
                    enabled=true;
            }
        }
    }
    return enabled;
}
项目:VariantSync    文件:ConsoleFactory.java   
private void showConsole() {
    ChangeOutPutConsole console = VariantSyncPlugin.getDefault().getConsole();
    if (console != null) {
        IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
        IConsole[] existing = manager.getConsoles();
        boolean exist = false;
        for (int i = 0; i < existing.length; i++) {
            if (console == existing[i]) {
                exist = true;
            }
        }
        if (!exist) {
            manager.addConsoles(new IConsole[] { console });
        }
        manager.showConsoleView(console);
    }

}
项目:eclox    文件:Console.java   
/**
 * Shows a console for the given job.
 *
 * @param   job a build that needs a console to be shown
 */
static public void show(BuildJob job) {
    // Retrieves the active workbench window and console manager.
    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
    Console console = null;

    if (consoles.containsKey(job)) {
        console = (Console) consoles.get(job);
    } else {
        console = new Console(job);
        consoleManager.addConsoles(new IConsole[] { console });
    }

    // anb0s: refresh the name
    console.setName(job.getName());

    // Shows the console view.
    console.activate();
}
项目:gwt-eclipse-plugin    文件:MessageConsoleUtilities.java   
/**
 * Returns a {@link CustomMessageConsole} with the given
 * <code>consoleName</code>. If no console by that name exists then one is
 * created. The returned console is cleared; callers of this method can decide
 * when to activate it.
 *
 * @param consoleName name of the console
 * @param imageDescriptor image descriptor to use
 * @return {@link CustomMessageConsole} with the given
 *         <code>consoleName</code>
 */
public static CustomMessageConsole getMessageConsole(String consoleName,
    ImageDescriptor imageDescriptor) {
  CustomMessageConsole messageConsole = null;
  IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
  for (IConsole console : consoleManager.getConsoles()) {
    if (console.getName().equals(consoleName)
        && console instanceof CustomMessageConsole) {
      messageConsole = (CustomMessageConsole) console;
      break;
    }
  }

  if (messageConsole == null) {
    messageConsole = new CustomMessageConsole(consoleName, imageDescriptor);
    consoleManager.addConsoles(new IConsole[] {messageConsole});
  } else {
    messageConsole.clearConsole();
  }

  return messageConsole;
}
项目:gwt-eclipse-plugin    文件:MessageConsoleUtilities.java   
public static CustomMessageConsole getMessageConsoleKeepLog(String consoleName,
    ImageDescriptor imageDescriptor) {
  CustomMessageConsole messageConsole = null;
  IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
  for (IConsole console : consoleManager.getConsoles()) {
    if (console.getName().equals(consoleName)
        && console instanceof CustomMessageConsole) {
      messageConsole = (CustomMessageConsole) console;
      break;
    }
  }

  if (messageConsole == null) {
    messageConsole = new CustomMessageConsole(consoleName, imageDescriptor);
    consoleManager.addConsoles(new IConsole[] {messageConsole});
  } else {
    //messageConsole.clearConsole();
  }

  return messageConsole;
}
项目:jdepend4eclipse    文件:JDependConsole.java   
public static JDependConsole 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 JDependConsole("JDepend", null, true);
    }
    if (!exists) {
        manager.addConsoles(new IConsole[] { console });
    }
    manager.showConsoleView(console);
    return console;
}
项目:HMM    文件:AbstractConsole.java   
protected void createConsole() {
    Display.getDefault().syncExec(new Runnable() {
    public void run() {
        IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
        console = new MessageConsole(consoleName, null);
        manager.addConsoles(new IConsole[] { console });
        try {
            Font font = new Font(Display.getCurrent(), "simsun", 9, SWT.NORMAL);
            console.setFont(font);
        } catch (SWTError error) {
            error.printStackTrace();
        }
        mcs = console.newMessageStream();
        black = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
        red = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
        mcs.setColor(black);
        manager.showConsoleView(console);
    }
});
  }
项目:HMM    文件:ConsolePageParticipant.java   
@Override
public void init(IPageBookViewPage page, IConsole console) {
    IPageSite pageSite = page.getSite();
    IWorkbenchPage workbenchPage = pageSite.getPage();
    IViewPart viewPart = workbenchPage.findView(IConsoleConstants.ID_CONSOLE_VIEW);
    IViewSite viewSite = viewPart.getViewSite();
    IActionBars actionBars = viewSite.getActionBars();
    IToolBarManager toolBarManager = actionBars.getToolBarManager();
    IContributionItem[] items = toolBarManager.getItems();
    for(int i = 0; i < items.length; ++i) {
        IContributionItem item = items[i];
        if(item instanceof ActionContributionItem) {
            IAction action = ((ActionContributionItem) item).getAction();
            String text = action.getText();
            if(text.equals("Pi&n Console") || text.equals("Open Console"))
                toolBarManager.remove(item);
        }
    }
}
项目:yang-design-studio    文件:YangToPNG.java   
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;
    }
项目:yang-design-studio    文件:YangToSkelxml.java   
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;
}
项目:yang-design-studio    文件:YangToDsdl.java   
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;
}
项目:yang-design-studio    文件:YangToTree.java   
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;
                }
项目:yang-design-studio    文件:YangToXSD.java   
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;
}
项目:yang-design-studio    文件:YangToXslt.java   
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;
}
项目:yang-design-studio    文件:YangToJSTREE.java   
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;
}
项目:yang-design-studio    文件:YangToUML.java   
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;
                }
项目:yang-design-studio    文件:YangToYin.java   
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;
                    }
项目:sadlos2    文件:SadlConsole.java   
/**
 * Show the application console. If the given console is null, attempt
 * to find an existing console and use it. If the given console is null
 * and no existing consoles exist, exit without doing anything.
 * 
 * @param myConsole An existing console.
 */
public static void displayConsole (IConsole myConsole) {

    // try to grab any old console and display it if given null
    if (myConsole == null) {
        final ConsolePlugin plugin = ConsolePlugin.getDefault();
        final IConsoleManager conMan = plugin.getConsoleManager();
        final IConsole[] existing = conMan.getConsoles();

        if (existing.length == 0)
            return;

        for (final IConsole element : existing)
            myConsole = element;
    }

    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {myConsole});
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
}
项目:sadlos2    文件:SadlConsole.java   
/**
 * Show the application console. If the given console is null, attempt
 * to find an existing console and use it. If the given console is null
 * and no existing consoles exist, exit without doing anything.
 * 
 * @param myConsole An existing console.
 */
public static void displayConsole (IConsole myConsole) {

    // try to grab any old console and display it if given null
    if (myConsole == null) {
        final ConsolePlugin plugin = ConsolePlugin.getDefault();
        final IConsoleManager conMan = plugin.getConsoleManager();
        final IConsole[] existing = conMan.getConsoles();

        if (existing.length == 0)
            return;

        for (final IConsole element : existing)
            myConsole = element;
    }

    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {myConsole});
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
}
项目:ant-ivyde    文件:IvyConsoleFactory.java   
public static void showConsole() {
    IvyConsole console = IvyPlugin.getDefault().getConsole();
    if (console != null) {
        IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
        boolean exists = false;
        for (IConsole existing : manager.getConsoles()) {
            if (console == existing) {
                exists = true;
            }
        }
        if (!exists) {
            manager.addConsoles(new IConsole[] {console});
        }
        manager.showConsoleView(console);
    }
}
项目:checker-framework    文件:CheckerPlugin.java   
/**
 * Get the MessageConsole for the plugin
 * 
 * @return a MessageConsole (will create if it doesn't exist)
 */
public static MessageConsole findConsole()
{
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (IConsole element : existing)
    {
        if (consoleName.equals(element.getName()))
        {
            return (MessageConsole) element;
        }
    }
    // no console found, so create a new one
    MessageConsole myConsole = new MessageConsole(consoleName, null);
    conMan.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
项目:CppStyle    文件:CppStyle.java   
public static CppStyleMessageConsole buildConsole() {
    CppStyleMessageConsole console = null;
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();

    for (int i = 0; i < existing.length; i++) {
        if (CppStyleConstants.CONSOLE_NAME.equals(existing[i].getName())) {
            console = (CppStyleMessageConsole) existing[i];
        }
    }

    if (console == null) {
        // no console found, so create a new one
        CppStyleConsolePatternMatchListener listener = new CppStyleConsolePatternMatchListener();
        console = new CppStyleMessageConsole(listener);
        conMan.addConsoles(new IConsole[] { console });
    }

    console.clear();
    return console;
}
项目:FindBug-for-Domino-Designer    文件:FindBugsConsole.java   
public static FindBugsConsole 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 FindBugsConsole("FindBugs", 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;
}
项目:vdt-plugin    文件:RunningBuilds.java   
private void removeMonListener(IConsole parserConsole){
    MonListener monListener;
    synchronized (parserListeners){
        monListener=parserListeners.remove(parserConsole);
    }
    if (monListener!=null){
        if (VerilogPlugin.getPreferenceBoolean(PreferenceStrings.DEBUG_LAUNCHING)) {
            System.out.println("--- Removing listener from the terminated parser console "+parserConsole.getName());
        }
        try {
            monListener.finalize();
        } catch (Throwable e) {
            System.out.println("Failed to finalize monListener for console "+parserConsole.getName());
            e.printStackTrace();
        }
    }
}