Refine search
/** * Creates and starts a new instance of Hk2Logger * * @param uri the uri of the server */ private Hk2Logger(String uri) { io = UISupport.getServerIO(uri); if (io == null) { return; // finish, it looks like this server instance has been unregistered } // clear the old output try { io.getOut().reset(); } catch (IOException ioe) { // no op } io.select(); }
@Override protected void fail(Throwable cause) { if(cause instanceof SourcesNotFoundException) { String message = org.openide.util.NbBundle.getMessage(SonarRunnerTask.class, "SourcesNotFound"); DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE)); }else if(cause instanceof SonarRunnerCancelledException){ io.getOut().println(org.openide.util.NbBundle.getMessage(SonarRunnerTask.class, "SonarRunner.cancelled")); }else{ io.getErr().println(org.openide.util.NbBundle.getMessage(SonarRunnerTask.class, "SonarRunner.error")); Exceptions.printStackTrace(cause); } }
public void bringDown() { // Mainly used when session goes away. io.closeInputOutput(); }
@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"); }
_tab.closeInputOutput(); // Close it... final InputOutput inputOutput = IOProvider.getDefault().getIO(tabName, true); // Create a new ... try { inputOutput.getOut().reset(); } catch (IOException ioe) { RemoteSyncWorker syncWorker = RemoteSyncSupport.createSyncWorker(project, inputOutput.getOut(), inputOutput.getErr()); if (syncWorker != null) { if (!syncWorker.startup(envMap)) {
inOut.getOut().reset(); inOut.select(); writer = inOut.getOut(); errorWriter = inOut.getErr(); isStarted = true; while (!stop && !inOut.isClosed()) { Process process = tomcatManager.getTomcatProcess(); try { writer.flush(); errorWriter.flush(); if (takeFocus) { inOut.select(); if (!stop && !inOut.isClosed()) { wait(100);
_tab.closeInputOutput(); // Close it... final InputOutput tab = IOProvider.getDefault().getIO(tabName, true); // Create a new ... try { tab.getOut().reset(); } catch (IOException ioe) { RemoteSyncWorker syncWorker = RemoteSyncSupport.createSyncWorker(project, inputOutput.getOut(), inputOutput.getErr()); if (syncWorker != null) { if (!syncWorker.startup(envMap)) { npb.setExecutable(compilerPath); npb.setArguments(list.toArray(new String[list.size()])); inputOutput.getOut().println(compilerPath+" "+argsFlat.toString()); // NOI18N inputOutput.getOut().flush();
@Override public void log(int level, String message) { assert io != null; OutputWriter writer = null; if (level <= com.jcraft.jsch.Logger.INFO) { writer = io.getOut(); } else { writer = io.getErr(); } writer.println(message.trim()); writer.flush(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Command listener: {0}", message.trim()); } }
@Override public void run() { try { _execute(io, listener); } catch (Throwable th) { try { io.getErr().println("Internal error occured. Please report a bug.", null, true); // NOI18N } catch (IOException ex) { } io.getOut().close(); listener.executionFinished(-1); throw new RuntimeException(th); } } };
/** * display the log viewer dialog * @param forced reset view if true, otherwise refresh * @return The output window * @throws java.io.IOException encountered issue while doing a reset on the stdout */ public InputOutput showLogViewer(boolean forced) throws IOException{ io = UISupport.getServerIO(url); working = true; if (forced &&(io.isClosed())){ initRingerDone=false; io.getOut().reset(); } io.select(); return io; }
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 void run() { final int MAX_LINES = 10000; String line; shouldStop = io.isClosed(); if (!shouldStop) { try { if (lines >= MAX_LINES) { io.getOut().reset(); lines = ring.output(); } // end of if (lines >= MAX_LINES) while ((line = ins.readLine()) != null) { if ((line = ring.add(line)) != null) { io.getOut().println(line); lines++; } // end of if ((line = ring.add(line)) != null) } }catch (IOException e) { Logger.getLogger(LogViewerSupport.class.getName()).log(Level.INFO, null, e); } task.schedule(10000); } else { ///System.out.println("end of infinite loop for log viewer\n\n\n\n"); stopUpdatingLogViewer(); } } /* display the log viewer dialog
@Override public void actionPerformed(ActionEvent e) { io.select(); } });
void hyperlink(AntSession session, AntEvent event, FileObject source, int messageLevel, int sessionLevel, SessionData data) { if (messageLevel <= sessionLevel && !event.isConsumed()) { OutputListener hyperlink; try { hyperlink = session.createStandardHyperlink(source.getURL(), guessExceptionMessage(data), lineNumber, -1, -1, -1); } catch (FileStateInvalidException e) { assert false : e; return; } event.consume(); InputOutput io = session.getIO(); if (IOColorPrint.isSupported(io)) { try { OutputWriter out = messageLevel <= AntEvent.LOG_WARN ? io.getErr() : /* #174781 1/2 */io.getOut(); boolean important = prePart.contains(/* #174781 2/2 */"at ") && /* e.g. InstalledFileLocatorImpl.findCaller */!prePart.contains("WARNING"); // NOI18N out.print(prePart); IOColorPrint.print(io, midPart, hyperlink, important, null); out.println(endPart); return; } catch (IOException x) { Exceptions.printStackTrace(x); } } session.println(line, true, hyperlink); } } }