本文整理汇总了Java中org.openide.windows.InputOutput.closeInputOutput方法的典型用法代码示例。如果您正苦于以下问题:Java InputOutput.closeInputOutput方法的具体用法?Java InputOutput.closeInputOutput怎么用?Java InputOutput.closeInputOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.windows.InputOutput
的用法示例。
在下文中一共展示了InputOutput.closeInputOutput方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: execute
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
/** Should prepare environment for Executor and start it. Is called from
* Executor.execute method.
*
* @param executor to start
* @param info about class to start
*/
public ExecutorTask execute(String name, Runnable run, final InputOutput inout) {
TaskThreadGroup g = new TaskThreadGroup(base, "exec_" + name + "_" + number); // NOI18N
g.setDaemon(true);
ExecutorTaskImpl task = new ExecutorTaskImpl();
synchronized (task.lock) {
try {
new RunClassThread(g, name, number++, inout, this, task, run);
task.lock.wait();
} catch (InterruptedException e) { // #171795
inout.closeInputOutput();
return new ExecutorTask(null) {
public @Override void stop() {}
public @Override int result() {return 2;}
public @Override InputOutput getInputOutput() {return inout;}
};
}
}
return task;
}
示例3: createInputOutput
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
protected final InputOutput createInputOutput() {
if (MavenSettings.getDefault().isReuseOutputTabs()) {
synchronized (freeTabs) {
for (Map.Entry<InputOutput,AllContext<?>> entry : freeTabs.entrySet()) {
InputOutput free = entry.getKey();
AllContext<?> allContext = entry.getValue();
if (io == null && allContext.name.equals(name) && allContext.tabContextType == tabContextType()) {
// Reuse it.
io = free;
reassignAdditionalContext(tabContextType().cast(allContext.tabContext));
try {
io.getOut().reset();
} catch (IOException ex) {
ex.printStackTrace();
}
// useless: io.flushReader();
} else {
// Discard it.
free.closeInputOutput();
}
}
freeTabs.clear();
}
}
// }
if (io == null) {
io = IOProvider.getDefault().getIO(name, createNewTabActions());
io.setInputVisible(true);
}
return io;
}
示例4: testTitle
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
public void testTitle() {
testTitleHelp(io);
InputOutput io1 = ioProvider.getIO("io1", null, ioContainer);
io1.select();
testTitleHelp(io1);
io1.closeInputOutput();
}
示例5: testGetIO_4args
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
@Test
public void testGetIO_4args() {
IOContainer def = IOContainer.getDefault();
IOContainer cus = IOContainer.create(new MyContainerProvider());
InputOutput ioDef1 = IOProvider.getDefault().getIO("test1", true, null, def);
InputOutput ioCus1 = IOProvider.getDefault().getIO("test1", true, null, cus);
InputOutput ioDef2 = IOProvider.getDefault().getIO("test2", true, null, def);
InputOutput ioCus2 = IOProvider.getDefault().getIO("test2", true, null, cus);
assertNotSame(ioDef1, ioCus1);
assertNotSame(ioDef2, ioCus2);
assertNotSame(ioDef1, ioDef2);
assertNotSame(ioCus1, ioCus2);
InputOutput ioDef1b = IOProvider.getDefault().getIO("test1", false, null, def);
InputOutput ioCus1b = IOProvider.getDefault().getIO("test1", false, null, cus);
assertSame(ioDef1, ioDef1b);
assertSame(ioCus1, ioCus1b);
ioDef1.closeInputOutput();
ioDef2.closeInputOutput();
ioCus1.closeInputOutput();
ioCus2.closeInputOutput();
}
示例6: closeIO
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
@Override
public void closeIO(InputOutput io) {
io.closeInputOutput();
}
示例7: closeInputOuptut
import org.openide.windows.InputOutput; //导入方法依赖的package包/类
private void closeInputOuptut(ExecutionContext context) {
InputOutput ioput = context.getInputOutput();
if (ioput != null) {
ioput.closeInputOutput();
}
}