public InputOutput createIO(IOContainer ioContainer) { inOut = IOProvider.getDefault().getIO("test-results", null, ioContainer); //NOI18N return inOut; }
@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())); } };
/** * Gets IOProvider of selected name or delegates to getDefault() if none was found. * @param name ID of provider * @return the instance corresponding to provided name or default instance if not found * @since 1.15 */ public static IOProvider get(String name) { Collection<? extends IOProvider> res = Lookup.getDefault().lookupAll(IOProvider.class); for (IOProvider iop : res) { if (iop.getName().equals(name)) { return iop; } } return getDefault(); }
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)); } }
/** *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 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); }
/** * Gets a named instance of {@link InputOutput}. Corresponding IO tab will be placed * in parent container corresponding to provided {@link IOContainer}. * @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. * @param ioContainer parent container accessor * @return an <code>InputOutput</code> instance for accessing the new tab * <br>Note: Please remember that {@link InputOutput} objects need to be * properly closed. Ensure that {@link InputOutput#closeInputOutput()} is * called when returned object is no longer needed, otherwise allocated * memory and other resources will not be freed. * @see InputOutput * @since 1.15 * <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, actions)</code> method, ignoring the ioContainer passed. */ public InputOutput getIO(String name, Action[] actions, IOContainer ioContainer) { return getIO(name, actions); }
private static InputOutput getInputOutput() { return IOProvider.getDefault().getIO(NbBundle.getMessage(Util.class, "LBL_Output"), false); } private static OutputWriter getOutputWriter() {
/** * Gets a named instance of {@link InputOutput}. Corresponding IO tab will be placed * in parent container corresponding to provided {@link IOContainer}. * @param name A localized display name for the tab * @param newIO if <tt>true</tt>, a new <code>InputOutput</code> is returned, else an existing <code>InputOutput</code> of the same name may be returned * @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. * @param ioContainer parent container accessor * @return an <code>InputOutput</code> instance for accessing the new tab * <br>Note: Please remember that {@link InputOutput} objects need to be * properly closed. Ensure that {@link InputOutput#closeInputOutput()} is * called when returned object is no longer needed, otherwise allocated * memory and other resources will not be freed. * @see InputOutput * @since 1.33 * <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, actions)</code> method, ignoring the ioContainer and newIO passed. */ public @NonNull InputOutput getIO(@NonNull String name, boolean newIO, @NonNull Action[] actions, @NullAllowed IOContainer ioContainer) { return getIO(name, 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())); } };
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); } }
public OutputHandler() { io = IOProvider.getDefault().getIO("Log", true); outputWriter = io.getOut(); formatter = new MsgFormatter(); }
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(); } }
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; }
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; }
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); } }); }
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(); }
@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; } }