本文整理汇总了Java中org.openide.windows.InputOutput类的典型用法代码示例。如果您正苦于以下问题:Java InputOutput类的具体用法?Java InputOutput怎么用?Java InputOutput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InputOutput类属于org.openide.windows包,在下文中一共展示了InputOutput类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NbBuildLogger
import org.openide.windows.InputOutput; //导入依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
NbBuildLogger(File origScript, OutputWriter out, OutputWriter err, int verbosity, String displayName, Map<String,String> properties,
Set<? extends String> concealedProperties, Runnable interestingOutputCallback, ProgressHandle handle, InputOutput io) {
thisSession = LoggerTrampoline.ANT_SESSION_CREATOR.makeAntSession(this);
this.origScript = origScript;
this.out = out;
this.err = err;
this.io = io;
this.verbosity = verbosity;
this.properties = properties;
this.concealedProperties = concealedProperties;
this.displayName = displayName;
this.interestingOutputCallback = interestingOutputCallback;
this.handle = handle;
LOG.log(Level.FINE, "---- Initializing build of {0} \"{1}\" at verbosity {2} ----", new Object[] {origScript, displayName, verbosity});
enterProtectedMode(isCompileOnSave(properties));
}
示例2: output
import org.openide.windows.InputOutput; //导入依赖的package包/类
public void output (final String msg, final OutputListener list) {
if(msg == null) return;
rp.post(new Runnable() {
@Override
public void run() {
InputOutput out = getLog();
if (writable) {
if (IOColorPrint.isSupported(out) && IOColors.isSupported(out)) {
Color c;
if (list == null) {
c = IOColors.getColor(out, IOColors.OutputType.OUTPUT);
} else {
c = IOColors.getColor(out, IOColors.OutputType.HYPERLINK);
}
try {
IOColorPrint.print(log, msg, list, false, c);
} catch (IOException ex) {
out.getOut().print(msg);
}
} else {
out.getOut().print(msg);
}
}
}
});
}
示例3: testClosedTab
import org.openide.windows.InputOutput; //导入依赖的package包/类
public void testClosedTab() {
System.out.printf("testClosedTab()\n");
io.select();
sleep(1); // give select time to take effect
InputOutput io2 = ioProvider.getIO("test2", null, ioContainer);
assertNotNull ("Could not get InputOutput", io2);
io2.select();
sleep(1); // give select time to take effect
IOVisibility.setVisible(io, false);
sleep(1); // wait til it's closed
setAttrs();
sleep(1); // give them time to take effect
io.select();
sleep(1); // give select time to take effect
}
示例4: outputColorToAwtColor
import org.openide.windows.InputOutput; //导入依赖的package包/类
private static Color outputColorToAwtColor(InputOutput io,
OutputColor color) {
if (color == null) {
return null;
}
OutputColorType type = OutputColors.getType(color);
if (type == OutputColorType.RGB) {
return new Color(OutputColors.getRGB(color));
} else {
switch (type) {
case DEBUG:
return IOColors.getColor(io, IOColors.OutputType.LOG_DEBUG);
case FAILURE:
return IOColors.getColor(io, IOColors.OutputType.LOG_FAILURE);
case WARNING:
return IOColors.getColor(io, IOColors.OutputType.LOG_WARNING);
case SUCCESS:
return IOColors.getColor(io, IOColors.OutputType.LOG_SUCCESS);
default:
return null;
}
}
}
示例5: createInputOutput
import org.openide.windows.InputOutput; //导入依赖的package包/类
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);
}
}
示例6: doReload
import org.openide.windows.InputOutput; //导入依赖的package包/类
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();
}
}
示例7: print
import org.openide.windows.InputOutput; //导入依赖的package包/类
@Override
public void print(InputOutput io, OutputWriter writer, String text,
Hyperlink link, OutputColor outputColor, boolean printLineEnd) {
Color awtColor = outputColorToAwtColor(io, outputColor);
OutputListener listener = hyperlinkToOutputListener(link);
boolean listenerImportant = link != null && Hyperlinks.isImportant(link);
if (io instanceof NbIO) {
OutWriter out = ((NbIO) io).out();
if (out != null) {
out.print(text, listener, listenerImportant, awtColor, null,
OutputKind.OUT, printLineEnd);
}
} else {
throw new IllegalArgumentException();
}
}
示例8: testNotReusable
import org.openide.windows.InputOutput; //导入依赖的package包/类
public void testNotReusable() {
System.out.printf("testNotReusabele()\r");
InputOutput ioRef = io;
io.closeInputOutput();
// because closeInputOutput() gets posted to run on the EDT
// it effect isn't immediate.
// W/o this sleep() both terminal and default IO will end up
// reusing because the close operation hasn't gone through.
sleep(1);
boolean reuse = true;
InputOutput uniqueIO = ioProvider.getIO("test", !reuse);
assertTrue("hard closed io got reused", ioRef != uniqueIO);
// cleanup
uniqueIO.closeInputOutput();
}
示例9: processInitialMessage
import org.openide.windows.InputOutput; //导入依赖的package包/类
protected final void processInitialMessage() {
Iterator<String> it1 = messages.iterator();
Iterator<OutputListener> it2 = listeners.iterator();
InputOutput ioput = getInputOutput();
try {
while (it1.hasNext()) {
OutputListener ol = it2.next();
if (ol != null) {
ioput.getErr().println(it1.next(), ol, true);
} else {
ioput.getErr().println(it1.next());
}
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
示例10: getTab
import org.openide.windows.InputOutput; //导入依赖的package包/类
public InputOutputTab getTab(final String tabName, final IOTabFactory factory) {
String name = seqID == 1 ? tabName : tabName.concat(" #" + seqID); // NOI18N
synchronized (tabs) {
for (InputOutputTab tab : tabs) {
if (tab.name.equals(name)) {
return tab;
}
}
final InputOutput inputOutput = factory.createNewTab(name);
// Latent bug! inputOutput is stored in weak reference.
// So caller should keep get and inputOutput in local variable just after getting tab.
InputOutputTab newTab = new InputOutputTab(name, inputOutput);
tabs.add(newTab);
return newTab;
}
}
示例11: getOPWindow
import org.openide.windows.InputOutput; //导入依赖的package包/类
private InputOutput getOPWindow(){
if(iop == null){
iop = IOProvider.getDefault().getIO(opTabTitle, false);
iop.setErrSeparated(true);
iop.setFocusTaken(false);
/*iop.select();
try {
iop.getOut().reset();
} catch (IOException ex) {
}*/
ioOut = iop.getOut();
DateFormat dtf = DateFormat.getDateTimeInstance();
ioOut.print("\n\n"+dtf.format(new Date(System.currentTimeMillis()))+" : ");
}
return iop;
}
示例12: getLog
import org.openide.windows.InputOutput; //导入依赖的package包/类
/**
* @return the log
*/
private InputOutput getLog() {
writable = true;
if(log == null) {
Subversion.LOG.log(Level.FINE, "Creating OutputLogger for {0}", repositoryRootString);
log = IOProvider.getDefault().getIO(repositoryRootString, false);
if (!openedWindows.contains(repositoryRootString)) {
// log window has been opened
writable = SvnModuleConfig.getDefault().getAutoOpenOutput();
openedWindows.add(repositoryRootString);
if (!writable) {
// close it again
log.closeInputOutput();
}
}
}
return log;
}
示例13: actionPerformed
import org.openide.windows.InputOutput; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
setEnabled(false); // discourage repeated clicking
ExecutionService actionService;
RerunCallback actionCallback;
InputOutput required;
synchronized (this) {
actionService = service;
actionCallback = callback;
required = parent;
}
if (actionService != null) {
Future<Integer> task = Accessor.getDefault().run(actionService, required);
if (actionCallback != null) {
actionCallback.performed(task);
}
}
}
示例14: configureInputOutput
import org.openide.windows.InputOutput; //导入依赖的package包/类
/**
* Configures the output window before usage.
*
* @param inputOutput output window to configure
*/
private void configureInputOutput(InputOutput inputOutput) {
if (inputOutput == InputOutput.NULL) {
return;
}
if (descriptor.getInputOutput() == null || !descriptor.noReset()) {
try {
inputOutput.getOut().reset();
} catch (IOException exc) {
LOGGER.log(Level.INFO, null, exc);
}
// Note - do this AFTER the reset() call above; if not, weird bugs occur
inputOutput.setErrSeparated(false);
}
// Open I/O window now. This should probably be configurable.
if (descriptor.isFrontWindow()) {
inputOutput.select();
}
inputOutput.setInputVisible(descriptor.isInputVisible());
}
示例15: executeNativeCommand
import org.openide.windows.InputOutput; //导入依赖的package包/类
public InputOutput executeNativeCommand(IOProvider iop, IOContainer ioContainer) {
if (nativeExecutionSupport.isRunning())
throw new IllegalStateException("Process already running");
final String title = "Cmd: " + config.getCommand();
if (config.isRestartable()) {
Action stopAction = new StopAction(nativeExecutionSupport);
Action rerunAction = new RerunAction(nativeExecutionSupport);
nativeExecutionSupport.setRestartable(stopAction, rerunAction);
}
nativeExecutionSupport.setInternalIOShuttle(config.getIOShuttling() == Config.IOShuttling.INTERNAL);
InputOutput io = nativeExecutionSupport.setupIO(iop, ioContainer, title, config);
nativeExecutionSupport.execute(config.getCommand());
return io;
}