当前位置: 首页>>代码示例>>Java>>正文


Java InputOutput.closeInputOutput方法代码示例

本文整理汇总了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();
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:T3_HardClose_Test.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ExecutionEngine.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:OutputTabMaintainer.java

示例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();
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:T1_Close_Test.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:NbIOProviderTest.java

示例6: closeIO

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
@Override
public void closeIO(InputOutput io) {
    io.closeInputOutput();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:BridgingInputOutputProvider.java

示例7: closeInputOuptut

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
private void closeInputOuptut(ExecutionContext context) {
    InputOutput ioput = context.getInputOutput();
    if (ioput != null) {
        ioput.closeInputOutput();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:RunCheckerImpl.java


注:本文中的org.openide.windows.InputOutput.closeInputOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。