Java Code Examples for org.openide.windows.InputOutput#getOut()

The following examples show how to use org.openide.windows.InputOutput#getOut() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DebuggerChecker.java    From netbeans with Apache License 2.0 6 votes vote down vote up
protected void doReload(final RunConfig config, final String cname) {
    DebuggerTabMaintainer otm = getOutputTabMaintainer(config.getExecutionName());
    
    InputOutput io = otm.getInputOutput();
    io.select();
    OutputWriter ow = io.getOut();
    try {
        ow.reset();
    } catch (IOException ex) { }
    
    try {
        reload(config.getProject(), ow, cname);
    } finally {
        io.getOut().close();
        otm.markTab();
    }
}
 
Example 2
Source File: SearchDisplayer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 */
void prepareOutput() {
    String tabName = NbBundle.getMessage(ResultView.class,
                                         "TITLE_SEARCH_RESULTS");   //NOI18N
    InputOutput searchIO = IOProvider.getDefault().getIO(tabName, false);
    ow = searchIO.getOut();
    owRef = new WeakReference<OutputWriter>(ow);
    
    searchIO.select();
}
 
Example 3
Source File: ServerLogManager.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public synchronized void openLog() {
    InputOutput io = UISupport.getServerIO(dm.getUri());
    if (io != null) {
        io.select();
    }
    if (task == null) {
        WebLogicRuntime runtime = WebLogicRuntime.getInstance(dm.getCommonConfiguration());
        final OutputWriter writer = io.getOut();
        if (dm.isRemote() || !runtime.isProcessRunning()) {
            try {
                writer.reset();
            } catch (IOException ex) {
                LOGGER.log(Level.FINE, null, ex);
            }
        }
        if (!runtime.isProcessRunning()) {
            task = runtime.createLogReaderTask(LineProcessors.printing(writer, new ErrorLineConvertor(), true), new Callable<String>() {

                @Override
                public String call() throws Exception {
                    return NonProxyHostsHelper.getNonProxyHosts();
                }
            });
            // FIXME processor
            RequestProcessor.getDefault().post(task);
        }
    }
}
 
Example 4
Source File: T5_MTStress_Test.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
    * Create one IO and many writers write to it in parallel.
    */
   public void testMultiWriter() {
System.out.printf("testMultiWriter()\n");

final InputOutput iot = ioProvider.getIO("test2", null, ioContainer);
iot.select();
sleep(1);

Thread threads[] = new Thread[NWRITERS];
for (int tx = 0; tx < NWRITERS; tx++) {
    final int tn = tx;
    Thread t = new Thread(new Runnable() {
	@Override
	public void run() {
	    OutputWriter ow = iot.getOut();
	    exercise(iot, ow, 50);
	}
    });
    threads[tx] = t;
    t.start();
}

for (int tx = 0; tx < NWRITERS; tx++) {
    try {
	threads[tx].join();
    } catch (InterruptedException ex) {
	Exceptions.printStackTrace(ex);
    }
}
   }
 
Example 5
Source File: BridgingInputOutputProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public OutputWriter getOut(InputOutput io) {
    return io.getOut();
}
 
Example 6
Source File: NbIOProvider.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public OutputWriter getOut(InputOutput io) {
    return io.getOut();
}
 
Example 7
Source File: IOTabsController.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private OutputWriter getOutputWriter() {
    InputOutput io = inputOutputRef.get();
    return (io == null) ? null : io.getOut();
}
 
Example 8
Source File: ShowChanges.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void run() {
    String name = NbBundle.getMessage(ShowChanges.class, "ShowChanges.title", build.getDisplayName());
    InputOutput io = IOProvider.getDefault().getIO(name, new Action[0]);
    io.select();
    OutputWriter out = io.getOut();
    OutputWriter err = io.getErr();
    Collection<? extends HudsonJobChangeItem> changes = build.getChanges();
    boolean first = true;
    for (HudsonJobChangeItem item : changes) {
        if (first) {
            first = false;
        } else {
            out.println();
        }
        out.println(item.getUser() + ": " + item.getMessage());
        for (HudsonJobChangeFile file : item.getFiles()) {
            // XXX hyperlink to diff viewer
            switch (file.getEditType()) {
            case edit:
                out.print('±');
                break;
            case add:
                out.print('+');
                break;
            case delete:
                out.print('-');
            }
            out.print(' ');
            OutputListener hyperlink = file.hyperlink();
            if (hyperlink != null) {
                try {
                    out.println(file.getName(), hyperlink);
                } catch (IOException x) {
                    LOG.log(Level.INFO, null, x);
                }
            } else {
                out.println(file.getName());
            }
        }
    }
    if (first) {
        out.println(NbBundle.getMessage(ShowChanges.class, "ShowChanges.no_changes"));
    }
    out.close();
    err.close();
}