本文整理汇总了Java中org.openide.windows.IOProvider类的典型用法代码示例。如果您正苦于以下问题:Java IOProvider类的具体用法?Java IOProvider怎么用?Java IOProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IOProvider类属于org.openide.windows包,在下文中一共展示了IOProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLogInputOutput
import org.openide.windows.IOProvider; //导入依赖的package包/类
@NbBundle.Messages({
"# {0} - container id",
"LBL_LogInputOutput=Log {0}"
})
private static LogConnect getLogInputOutput(DockerContainer container) {
synchronized (LOGS) {
LogConnect connect = LOGS.get(container);
if (connect == null) {
InputOutput io = IOProvider.getDefault().getIO(
Bundle.LBL_LogInputOutput(container.getShortId()), true);
connect = new LogConnect(io);
LOGS.put(container, connect);
}
return connect;
}
}
示例2: createInputOutput
import org.openide.windows.IOProvider; //导入依赖的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);
}
}
示例3: getOPWindow
import org.openide.windows.IOProvider; //导入依赖的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;
}
示例4: getLog
import org.openide.windows.IOProvider; //导入依赖的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;
}
示例5: testGet
import org.openide.windows.IOProvider; //导入依赖的package包/类
public void testGet() {
InputOutput io = IOProvider.getDefault().getIO("test", true);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", null, null, null));
InputOutputManager.InputOutputData data = InputOutputManager.getInputOutput("test", false, null);
assertEquals("test", data.getDisplayName());
assertEquals(io, data.getInputOutput());
assertNull(data.getRerunAction());
assertNull(data.getStopAction());
data = InputOutputManager.getInputOutput("test", true, null);
assertNull(data);
data = InputOutputManager.getInputOutput("test", false, null);
assertNull(data);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", null, null, null));
data = InputOutputManager.getInputOutput("test", false, null);
assertNotNull(data);
}
示例6: testGetActions
import org.openide.windows.IOProvider; //导入依赖的package包/类
public void testGetActions() {
StopAction stopAction = new StopAction();
RerunAction rerunAction = new RerunAction();
InputOutput io = IOProvider.getDefault().getIO("test", new Action[] {rerunAction, stopAction});
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", stopAction, rerunAction, null));
InputOutputManager.InputOutputData data = InputOutputManager.getInputOutput("test", false, null);
assertNull(data);
data = InputOutputManager.getInputOutput("test", true, null);
assertEquals("test", data.getDisplayName());
assertEquals(io, data.getInputOutput());
assertEquals(rerunAction, data.getRerunAction());
assertEquals(stopAction, data.getStopAction());
data = InputOutputManager.getInputOutput("test", true, null);
assertNull(data);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", stopAction, rerunAction, null));
data = InputOutputManager.getInputOutput("test", true, null);
assertNotNull(data);
}
示例7: testGetRequired
import org.openide.windows.IOProvider; //导入依赖的package包/类
public void testGetRequired() {
InputOutput io = IOProvider.getDefault().getIO("test", true);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", null, null, null));
InputOutputManager.InputOutputData data = InputOutputManager.getInputOutput(io);
assertEquals("test", data.getDisplayName());
assertEquals(io, data.getInputOutput());
assertNull(data.getRerunAction());
assertNull(data.getStopAction());
data = InputOutputManager.getInputOutput(io);
assertNull(data);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(io, "test", null, null, null));
data = InputOutputManager.getInputOutput(io);
assertNotNull(data);
}
示例8: testOrder
import org.openide.windows.IOProvider; //导入依赖的package包/类
public void testOrder() {
InputOutput firstIO = IOProvider.getDefault().getIO("test", true);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(firstIO, "test", null, null, null));
InputOutput secondIO = IOProvider.getDefault().getIO("test #1", true);
InputOutputManager.addInputOutput(
new InputOutputManager.InputOutputData(secondIO, "test #1", null, null, null));
InputOutputManager.InputOutputData data = InputOutputManager.getInputOutput("test", false, null);
assertEquals("test", data.getDisplayName());
assertEquals(firstIO, data.getInputOutput());
data = InputOutputManager.getInputOutput("test", false, null);
assertEquals("test #1", data.getDisplayName());
assertEquals(secondIO, data.getInputOutput());
data = InputOutputManager.getInputOutput("test", false, null);
assertNull(data);
}
示例9: executeRichCommand
import org.openide.windows.IOProvider; //导入依赖的package包/类
public InputOutput executeRichCommand(IOProvider iop, IOContainer ioContainer) {
if (richExecutionSupport.isRunning())
throw new IllegalStateException("Process already running");
final String title = "Cmd: " + config.getCommand();
if (config.isRestartable()) {
Action stopAction = new StopAction(richExecutionSupport);
Action rerunAction = new RerunAction(richExecutionSupport);
richExecutionSupport.setRestartable(stopAction, rerunAction);
}
richExecutionSupport.setInternalIOShuttle(config.getIOShuttling() == Config.IOShuttling.INTERNAL);
InputOutput io = richExecutionSupport.setupIO(iop, ioContainer, title, config);
richExecutionSupport.execute(config.getCommand());
return io;
}
示例10: executeNativeCommand
import org.openide.windows.IOProvider; //导入依赖的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;
}
示例11: testUpdaterRemovesUnavailableTabs
import org.openide.windows.IOProvider; //导入依赖的package包/类
public void testUpdaterRemovesUnavailableTabs() throws InterruptedException,
InvocationTargetException {
Controller c = new Controller();
final Controller.CoalescedNameUpdater updater =
c.new CoalescedNameUpdater();
final NbIO io = (NbIO) IOProvider.getDefault().getIO(
"test", true); //NOI18N
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
OutputTab ot = new OutputTab(io);
updater.add(ot);
assertTrue(updater.contains(ot));
updater.run();
assertFalse(updater.contains(ot));
}
});
}
示例12: createServerOutput
import org.openide.windows.IOProvider; //导入依赖的package包/类
protected void createServerOutput() {
// create the window
if (serverIO == null) {
serverIO = IOProvider.getDefault().getIO("Server " + getDisplayName() + " console", true);
}
// start thread that will write to the window
new Thread(new Runnable() {
@Override
public void run() {
try {
int ch;
while ((ch = getServerConsoleOutput().read()) != -1) {
serverIO.getOut().write(ch);
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
}).start();
}
示例13: performAction
import org.openide.windows.IOProvider; //导入依赖的package包/类
@Override
protected void performAction(Node[] activatedNodes) {
Runnable runnable = new Runnable() {
@Override
public void run() {
for (Node activatedNode : activatedNodes) {
DevicesNode.MobileDeviceHolder holder = activatedNode.getLookup().lookup(DevicesNode.MobileDeviceHolder.class);
final TerminalContainerTopComponent instance = TerminalContainerTopComponent.findInstance();
instance.open();
instance.requestActive();
final IOContainer ioContainer = instance.getIOContainer();
final IOProvider term = IOProvider.get("Terminal"); // NOI18N
if (term != null) {
final ExecutionEnvironment env = ExecutionEnvironmentFactory.getLocal();
if (env != null) {
openTerminalImpl(ioContainer, env, null, false, false, 0, holder);
}
}
}
}
};
WindowManager.getDefault().invokeWhenUIReady(runnable);
}
示例14: getTaskIO
import org.openide.windows.IOProvider; //导入依赖的package包/类
private InputOutput getTaskIO(BTraceTask task) {
synchronized(ioMap) {
String ioTitle = (task.getName() != null ? task.getName() : "<?>") + "@" + task.getPid();
InputOutput io = ioMap.get(task);
if (io == null) {
io = toClose.remove(ioTitle);
if (io != null) {
io.closeInputOutput();
}
io = IOProvider.getDefault().getIO(ioTitle, getTaskActions(task));
ioMap.put(task, io);
toClose.put(ioTitle, io);
io.select();
}
return io;
}
}
示例15: initLog
import org.openide.windows.IOProvider; //导入依赖的package包/类
private void initLog() {
TopComponent tc
= WindowManager.getDefault().findTopComponent("output"); // NOI18N
if (tc != null && isDisplayOutput()) // NOI18N
{
tc.open();
tc.requestActive();
tc.toFront();
}
inputOutput = IOProvider.getDefault().getIO(getTaskName(), false); // NOI18N
try {
inputOutput.getOut().reset();
out = inputOutput.getOut();
} catch (IOException e) {
// TODO: ignore
}
if (isDisplayOutput()) // NOI18N
{
inputOutput.select();
inputOutput.setOutputVisible(true);
}
}