本文整理匯總了Java中org.openide.util.RequestProcessor.getDefault方法的典型用法代碼示例。如果您正苦於以下問題:Java RequestProcessor.getDefault方法的具體用法?Java RequestProcessor.getDefault怎麽用?Java RequestProcessor.getDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.util.RequestProcessor
的用法示例。
在下文中一共展示了RequestProcessor.getDefault方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createMenu
import org.openide.util.RequestProcessor; //導入方法依賴的package包/類
private JMenu createMenu(BaseKit kit, int line, boolean backgroundInit){
final DelayedMenu pm = new DelayedMenu(NbBundle.getBundle(BaseKit.class).getString("generate-gutter-popup"));
final BaseKit fKit = kit;
final int fLine = line;
if (backgroundInit){
RequestProcessor rp = RequestProcessor.getDefault();
RequestProcessor.Task task = rp.create(new Runnable(){
public void run(){
initMenu(pm, fKit, fLine);
pm.clearTask(); // clear the finished task reference to avoid leaking
}
});
pm.setTask(task); // set before task execution so that always cleaned properly
task.schedule(0);
}else{
initMenu(pm, fKit, fLine);
}
return pm;
}
示例2: invokeAction
import org.openide.util.RequestProcessor; //導入方法依賴的package包/類
private void invokeAction() {
final boolean suspended = isThreadSupended;
RequestProcessor rp;
try {
Session s = dvThread.getDVSupport().getSession();
rp = s.lookupFirst(null, RequestProcessor.class);
} catch (Exception e) {
Exceptions.printStackTrace(e);
return ;
}
if (rp == null) {
// debugger finishing?
rp = RequestProcessor.getDefault();
}
rp.post(new Runnable() {
public void run() {
if (suspended) {
dvThread.resume();
} else {
dvThread.suspend();
}
}
});
isThreadSupended = !isThreadSupended;
}
示例3: createTask
import org.openide.util.RequestProcessor; //導入方法依賴的package包/類
private RequestProcessor.Task createTask() {
RequestProcessor rp = null;
try {
Session s = (Session) debugger.getClass().getMethod("getSession").invoke(debugger);
rp = s.lookupFirst(null, RequestProcessor.class);
} catch (Exception e) {
Exceptions.printStackTrace(e);
}
if (rp == null) {
rp = RequestProcessor.getDefault();
}
RequestProcessor.Task task = rp.create(new RefreshTree());
return task;
}
示例4: execution
import org.openide.util.RequestProcessor; //導入方法依賴的package包/類
@RandomlyFails // NB-Core-Build #8322: There shall be a warning about parallel execution(len=0): ''
public void testParallelExecutionOnDefaultRequestProcessorReported() {
final RequestProcessor rp = RequestProcessor.getDefault();
Para p = new Para(rp, 3);
CharSequence log = Log.enable("org.openide.util.RequestProcessor", Level.WARNING);
rp.post(p).waitFinished();
if (log.length() == 0) {
fail("There shall be a warning about parallel execution(len=" + log.length() + "):\n'" + log + "'");
}
}
示例5: getShortDescription
import org.openide.util.RequestProcessor; //導入方法依賴的package包/類
@Override
public String getShortDescription () {
// [TODO] hack for org.netbeans.modules.debugger.jpda.actions.MethodChooser that disables tooltips
if ("true".equals(System.getProperty("org.netbeans.modules.debugger.jpda.doNotShowTooltips"))) { // NOI18N
return null;
}
DebuggerEngine currentEngine = DebuggerManager.getDebuggerManager ().
getCurrentEngine ();
if (currentEngine == null) {
return null;
}
JPDADebugger d = currentEngine.lookupFirst(null, JPDADebugger.class);
if (d == null) {
return null;
}
Part lp = (Part) getAttachedAnnotatable();
if (lp == null) {
return null;
}
Line line = lp.getLine ();
DataObject dob = DataEditorSupport.findDataObject (line);
if (dob == null) {
return null;
}
EditorCookie ec = dob.getLookup().lookup(EditorCookie.class);
if (ec == null) {
return null;
// Only for editable dataobjects
}
this.lp = lp;
this.ec = ec;
RequestProcessor rp = currentEngine.lookupFirst(null, RequestProcessor.class);
if (rp == null) {
// Debugger is likely finishing...
rp = RequestProcessor.getDefault();
}
rp.post (this);
return null;
}