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


Java InputOutput.select方法代码示例

本文整理汇总了Java中org.openide.windows.InputOutput.select方法的典型用法代码示例。如果您正苦于以下问题:Java InputOutput.select方法的具体用法?Java InputOutput.select怎么用?Java InputOutput.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.windows.InputOutput的用法示例。


在下文中一共展示了InputOutput.select方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

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

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

示例3: exercise

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
private void exercise(InputOutput xio, OutputWriter ow, final int nlines) {

	IOPosition.Position positions[] = new IOPosition.Position[nlines];

	for (int lx = 0; lx < nlines; lx++) {
	    ow.println("Line " + lx + "\r");
	    try {
		IOColorLines.println(xio, "Colored line\r", Color.blue);
		positions[lx] = IOPosition.currentPosition(io);
	    } catch (IOException ex) {
		Exceptions.printStackTrace(ex);
	    }
	}

	sleep(1);
	xio.select();
	for (int lx = 0; lx < nlines; lx+=2) {
	    positions[lx].scrollTo();
	    sleep(1);
	}
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:T5_MTStress_Test.java

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

示例5: prepareOutput

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
/**
 */
void prepareOutput() {
    String tabName = NbBundle.getMessage(ResultView.class,
                                         "TITLE_SEARCH_RESULTS");   //NOI18N
    InputOutput searchIO = IOProvider.getDefault().getIO(tabName, false);
    ow = searchIO.getOut();
    owRef = new WeakReference<OutputWriter>(ow);
    
    searchIO.select();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:SearchDisplayer.java

示例6: focusTerminal

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
private static void focusTerminal(InputOutput io) {
    io.select();
    if (IOTerm.isSupported(io)) {
        // XXX is there a better way ?
         IOTerm.requestFocus(io);            
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:OutputUtils.java

示例7: testMultiWriter

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
/**
    * Create one IO and many writers write to it in parallel.
    */
   public void testMultiWriter() {
System.out.printf("testMultiWriter()\n");

final InputOutput iot = ioProvider.getIO("test2", null, ioContainer);
iot.select();
sleep(1);

Thread threads[] = new Thread[NWRITERS];
for (int tx = 0; tx < NWRITERS; tx++) {
    final int tn = tx;
    Thread t = new Thread(new Runnable() {
	@Override
	public void run() {
	    OutputWriter ow = iot.getOut();
	    exercise(iot, ow, 50);
	}
    });
    threads[tx] = t;
    t.start();
}

for (int tx = 0; tx < NWRITERS; tx++) {
    try {
	threads[tx].join();
    } catch (InterruptedException ex) {
	Exceptions.printStackTrace(ex);
    }
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:T5_MTStress_Test.java

示例8: testFirstTab

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
public void testFirstTab() {
System.out.printf("testFirstTab()\n");

io.select();
sleep(1);	// give select time to take effect

setAttrs();
sleep(1);	// give them 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
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:T4_Attribute_Test.java

示例9: testSecondTab

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
public void testSecondTab() {
System.out.printf("testSecondTab()\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

setAttrs();
sleep(1);	// give them time to take effect
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:T4_Attribute_Test.java

示例10: 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

示例11: showIO

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
@Override
public void showIO(InputOutput io,
        Set<ShowOperation> operations) {
    if (operations.contains(ShowOperation.OPEN)
            && operations.contains(ShowOperation.MAKE_VISIBLE)
            && operations.size() == 2) {
        io.select();
    } else {
        IOSelect.select(io, showOperationsToIoSelect(operations));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:BridgingInputOutputProvider.java

示例12: _dumpDocument

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
private void _dumpDocument( Document doc, String title ) {
    if( null == title || title.isEmpty() ) {
        title = NbBundle.getMessage(WebBrowserImpl.class, "Lbl_GenericDomDumpTitle");
    }
    InputOutput io = IOProvider.getDefault().getIO( title, true );
    io.select();
    try {
        DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
        DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation( "XML 3.0 LS 3.0" ); //NOI18N
        if( null == impl ) {
            io.getErr().println( NbBundle.getMessage(WebBrowserImpl.class, "Err_DOMImplNotFound") );
            return;
        }


        LSSerializer serializer = impl.createLSSerializer();
        if( serializer.getDomConfig().canSetParameter( "format-pretty-print", Boolean.TRUE ) ) { //NOI18N
            serializer.getDomConfig().setParameter( "format-pretty-print", Boolean.TRUE ); //NOI18N
        }
        LSOutput output = impl.createLSOutput();
        output.setEncoding("UTF-8"); //NOI18N
        output.setCharacterStream( io.getOut() );
        serializer.write(doc, output);
        io.getOut().println();

    } catch( Exception ex ) {
        ex.printStackTrace( io.getErr() );
    } finally {
        if( null != io ) {
            io.getOut().close();
            io.getErr().close();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:WebBrowserImpl.java

示例13: showIO

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
@Override
public void showIO(InputOutput io, Set<ShowOperation> operations) {
      if (operations.contains(ShowOperation.OPEN)
            && operations.contains(ShowOperation.MAKE_VISIBLE)
            && operations.size() == 2) {
        io.select();
    } else {
        IOSelect.select(io, showOperationsToIoSelect(operations));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:NbIOProvider.java

示例14: startEmbeddedServer

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
/**
 * Starts process of UCC server.
 */
public void startEmbeddedServer() throws UCCStartException {
    if (uccWrapper == null) {
        // set intitalization
        UCCWrapperConf conf = new UCCWrapperConf();

        conf.setLogger(log = Logger.getAnonymousLogger());
        
        // prepare output window
        final InputOutput io = IOProvider.getDefault().getIO("UCC " + getServerName(), false);

        io.select();
        //io.getOut().println(cmdline); //XXX
        //io.getOut().println(); //XXXd

        // redirect log to the output
        log.addHandler(new Handler() {

            @Override
            public void publish(LogRecord record) {
                io.getOut().println(record.getMessage());
            }

            @Override
            public void flush() {
                io.getOut().flush();
            }

            @Override
            public void close() throws SecurityException {
                io.closeInputOutput();
            }
        });

        // start the server
        uccWrapper = new UCCWrapper(conf);
    } else {
        // TODO server already set
    }
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:43,代码来源:EmbeddedUTServerDefinition.java

示例15: testStreamClose

import org.openide.windows.InputOutput; //导入方法依赖的package包/类
public void testStreamClose() {
// getIO(String, boolean newIO=false) reuses an IO
// that is not stream-open (i.e. streams never started
// or all closed.
System.out.printf("testStreamClose()\n");

InputOutput io1 = ioProvider.getIO("io1", null, ioContainer);

InputOutput io2;
InputOutput io3;

// until we open any streams reusing getIO should find it
io2 = ioProvider.getIO("io1", false, null , ioContainer);
assertTrue("reusing getIO() didn't find unopened IO", io2 == io1);

// after opening an io stream reusing getIO should create a new one.
io1.select();		// so we can check the output
io1.getOut().println("Hello to io1\r");
sleep(4);
io2 = ioProvider.getIO("io1", false, null, ioContainer);
if (defaultProvider) {
    // doesn't work as advertised
    // the following will appear in "io1".
    io2.getOut().println("Hello to io2\r");
} else {
    assertFalse("reusing getIO() found opened IO", io2 == io1);
    // This used to appear in a separate window, IOContainer.default(),
    // per BZ #182538, but it's fixed now.
    io2.select();
    io2.getOut().println("Hello to io2\r");
}
sleep(2);

// after closing io stream reusing getIO should find it
io1.getOut().close();
io3 = ioProvider.getIO("io1", false);
assertTrue("reusing getIO() didn't find stream closed IO", io3 == io1);

// at this point io1 and io3 point to the same io.

// but we can't write to it because we've closed it
io1.select();		// so we can check the output
io1.getOut().println("Should not appear\r");
sleep(3);

// until we reset it
try {
    io1.getOut().reset();
} catch (IOException ex) {
    Exceptions.printStackTrace(ex);
    fail("reset() failed");
}
io1.select();		// so we can check the output
io1.getOut().println("Hello to io1 after reset\r");
sleep(4);
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:57,代码来源:T1_Close_Test.java


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