/** *Gets a named instance of InputOutput with actions displayed in the * toolbar. * Streams for reading/writing can be accessed via * getters on the returned instance. * * @param name A localized display name for the tab * @param actions array of actions that are added to the toolbar, Can be empty array, but not null. * The number of actions should not exceed 5 and each should have the <code>Action.SMALL_ICON</code> property defined. * @return an <code>InputOutput</code> instance for accessing the new tab * @see InputOutput * @since 1.6 <br> * Note: The method is non-abstract for backward compatibility reasons only. If you are * extending <code>IOProvider</code> and implementing its abstract classes, you are encouraged to override * this method as well. The default implementation falls back to the <code>getIO(name, newIO)</code> method, ignoring the actions passed. */ public InputOutput getIO(String name, Action[] actions) { return getIO(name, true); }
public InputOutput createIO(IOContainer ioContainer) { inOut = IOProvider.getDefault().getIO("test-results", null, ioContainer); //NOI18N return inOut; }
private static InputOutput getInputOutput() { return IOProvider.getDefault().getIO(NbBundle.getMessage(Util.class, "LBL_Output"), false); } private static OutputWriter getOutputWriter() {
private static CachedInputOutput createInputOutput(String originalDisplayName, List<Action> actions) { synchronized (InputOutputCache.class) { String displayName = getNonActiveDisplayName(originalDisplayName); InputOutput io; if (actions != null && !actions.isEmpty()) { io = IOProvider.getDefault().getIO(displayName, actions.toArray(new Action[actions.size()])); //rerunAction.setParent(io); } else { io = IOProvider.getDefault().getIO(displayName, true); } ACTIVE_DISPLAY_NAMES.add(displayName); return new CachedInputOutput(io, displayName, actions); } }
private static void createOutput() { if(io == null) { io = IOProvider.getDefault().getIO("Information", true); } io.select(); }
@Override public InputOutput createNewTab(final String tabName) { return IOProvider.getDefault().getIO(tabName, getActions(currentEvent.getActionName())); } };
public void showLogViewer() throws IOException{ shouldStop = false; io = IOProvider.getDefault().getIO(ioName, false); io.getOut().reset(); io.select(); filestream = new FileInputStream(fileName); ins = new BufferedReader(new InputStreamReader(filestream)); RP.post(new Runnable() { @Override public void run() { init(); task.schedule(0); } }); }
public RemoteIndexTransferListener(RepositoryInfo info) { this.info = info; if (debug) { io = IOProvider.getDefault().getIO(NbBundle.getMessage(RemoteIndexTransferListener.class, "LBL_Transfer_TAG")//NII18N + (info.getName()), true); writer = io.getOut(); } }
public static InputOutput getRemoteLog(String displayName, boolean select) { InputOutput io = IOProvider.getDefault().getIO(NbBundle.getMessage(Command.class, "LBL_RemoteLog", displayName), false); if (select) { io.select(); } try { io.getOut().reset(); } catch (IOException ex) { Exceptions.printStackTrace(ex); } return io; }
@Override public InputOutput createNewTab(final String tabName) { IOProvider ioProvider = IOProvider.get("Terminal"); // NOI18N if (ioProvider == null) { ioProvider = IOProvider.getDefault(); } return ioProvider.getIO(tabName, getActions(currentEvent.getActionName())); } };
public OutputHandler() { io = IOProvider.getDefault().getIO("Log", true); outputWriter = io.getOut(); formatter = new MsgFormatter(); }
@NbBundle.Messages({ "# {0} - container id", "LBL_LogInputOutput=Log {0}" }) private static LogConnect getLogInputOutput(DockerContainer container) { synchronized (LOGS) { LogConnect connect = LOGS.get(container); if (connect == null) { InputOutput io = IOProvider.getDefault().getIO( Bundle.LBL_LogInputOutput(container.getShortId()), true); connect = new LogConnect(io); LOGS.put(container, connect); } return connect; } }
private static InputOutput getTab(String name, boolean reuse) { InputOutput tab; if (reuse) { tab = IOProvider.getDefault().getIO(name, false); // This will (sometimes!) find an existing one. tab.closeInputOutput(); // Close it... } tab = IOProvider.getDefault().getIO(name, true); // Create a new ... try { tab.getOut().reset(); } catch (IOException ex) { } tab.select(); return tab; }
private OutputTraceWriter(Object parser) { super(parser); final CsmFile mainFile; if (parser instanceof CppParserActionImpl) { mainFile = ((CppParserActionImpl) parser).getMainFile(); } else { mainFile = null; } if (mainFile == null) { io = IOProvider.getDefault().getIO("Trace actions", false); // NOI18N } else { io = IOProvider.getDefault().getIO("Trace actions "+ CndPathUtilities.getBaseName(mainFile.getAbsolutePath().toString()), false); // NOI18N } io.select(); out = io.getOut(); //out.close(); }
private static Pair<InputOutput, Boolean> getTerminalInputOutput(DockerContainer container) { synchronized (TERMS) { InputOutput io = TERMS.get(container); if (io == null) { io = IOProvider.get("Terminal") // NOI18N .getIO(container.getShortId(), new Action[]{new TerminalOptionsAction()}); TERMS.put(container, io); return Pair.of(io, false); } return Pair.of(io, IOConnect.isSupported(io) && IOConnect.isConnected(io)); } }
public NewTermComponent(IOTopComponent owner, int flags) { this.owner = owner; this.flags = flags; TermComponentFactory.ckFlags(flags); IOProvider iop = IOProvider.get("Terminal"); // NOI18N if (iop == null) { throw new UnsupportedOperationException("Terminal IO's not available"); // NOI18N } String tabTitle = null; // Use TC title io = iop.getIO(tabTitle, null, owner.ioContainer()); if (IOTerm.isSupported(io)) { term = (ActiveTerm) IOTerm.term(io); } else { io.closeInputOutput(); throw new UnsupportedOperationException("Terminal IO doesn't provide a Term"); // NOI18N } if (IOVisibility.isSupported(io)) IOVisibility.setClosable(io, false); }
public RepositoryIndexerListener(NexusIndexer nexusIndexer, IndexingContext indexingContext, boolean createZip) { this.indexingContext = indexingContext; this.nexusIndexer = nexusIndexer; this.createZip = createZip; ri = RepositoryPreferences.getInstance().getRepositoryInfoById(indexingContext.getId()); if (debug) { io = IOProvider.getDefault().getIO("Indexing " +(ri!=null? ri.getName():indexingContext.getId()), true); writer = io.getOut(); } }
@Override protected void init() { SonarIssuesTopComponent sonarTopComponent = (SonarIssuesTopComponent) WindowManager.getDefault().findTopComponent("SonarIssuesTopComponent"); sonarTopComponent.setSummaryOptions(new SummaryOptions<>(Severity.getType(), Collections.emptyList())); sonarTopComponent.resetState(); stopAction.setEnabled(true); if(io == null) { io = IOProvider.getDefault().getIO("Sonar-runner", true, new Action[]{stopAction}, IOContainer.getDefault()); } try { io.getOut().reset(); io.getErr().reset(); } catch (IOException ex) { Exceptions.printStackTrace(ex); } io.select(); io.getOut().println("Starting sonar-runner"); }
private ExecutionDescriptor getDescriptor(Runnable postTask) { return new ExecutionDescriptor() .inputOutput(IOProvider.getDefault().getIO(Bundle.Sass_compile(), false)) .inputVisible(false) .frontWindow(false) .frontWindowOnError(CssPrepOptions.getInstance().getSassOutputOnError()) .noReset(true) .showProgress(true) .postExecution(postTask); }
private ExecutionDescriptor getDescriptor(Runnable postTask) { return new ExecutionDescriptor() .inputOutput(IOProvider.getDefault().getIO(Bundle.Less_compile(), false)) .inputVisible(false) .frontWindow(false) .frontWindowOnError(CssPrepOptions.getInstance().getLessOutputOnError()) .noReset(true) .showProgress(true) .postExecution(postTask); }