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


Java Task.addTaskListener方法代码示例

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


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

示例1: ProxyTask

import org.openide.util.Task; //导入方法依赖的package包/类
public ProxyTask(Collection<? extends Task> waitFor) {
    super(null);
    this.cnt = waitFor.size();
    notifyRunning();
    for (Task t : waitFor) {
        t.addTaskListener(this);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProxyTask.java

示例2: HoldInstance

import org.openide.util.Task; //导入方法依赖的package包/类
public HoldInstance (DataObject source, InstanceCookie cookie) {
    this.cookie = cookie;
    this.source = source;

    if (cookie instanceof Task) {
        // for example FolderInstance ;-) attach itself for changes
        // in the cookie
        Task t = (Task)cookie;
        t.addTaskListener(WeakListeners.create(TaskListener.class, this, t));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:FolderInstance.java

示例3: shutdown

import org.openide.util.Task; //导入方法依赖的package包/类
/**
 * Must be called on JShell shutdown to clean up resources. Should
 * be called after all 
 */
public Task shutdown() throws IOException {
    Task t = shellSession.closeSession();
    t.addTaskListener((e) -> {
        postCloseCleanup();
    });
    return t;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:JShellEnvironment.java

示例4: reloadDocument

import org.openide.util.Task; //导入方法依赖的package包/类
@Override
protected Task reloadDocument(){
    Task tsk = super.reloadDocument();
    tsk.addTaskListener(new TaskListener(){
        public void taskFinished(Task task){
            myEntry.getHandler().autoParse();
        }
    });
    return tsk;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:PropertiesEditorSupport.java

示例5: redefineLayout

import org.openide.util.Task; //导入方法依赖的package包/类
public static void redefineLayout(Project p, JButton toEnable) {
    try {
        AtomicReference<FileObject> userDir = new AtomicReference<FileObject>();
        Task task = invokeDesignMode(p, userDir);
        if (task == null) {
            toEnable.setEnabled(true);
        }
        task.addTaskListener(new DesignSupport(p, toEnable, userDir));
    } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:DesignSupport.java

示例6: showDetail

import org.openide.util.Task; //导入方法依赖的package包/类
/**
 * Shows the search detail on the DataObject.
 * The document is opened in the editor, the caret is positioned on the
 * right line and column and searched string is marked.
 *
 * @param how indicates how to show detail. 
 * @see #DH_GOTO 
 * @see #DH_SHOW 
 * @see #DH_HIDE */
@NbBundle.Messages({
    "MSG_CannotShowTextDetai=The text match cannot be shown."
})
public void showDetail(final int how) {
    prepareLine();
    if (lineObj == null) {
        Toolkit.getDefaultToolkit().beep();
        EditCookie ed = dobj.getLookup().lookup(EditCookie.class);
        if (ed != null) {
            ed.edit();
            showAfterDataObjectUpdated = true; // show correct line later
        }
        return;
    }
    if (how == DH_HIDE) {
        return;
    }
    final EditorCookie edCookie = dobj.getLookup().lookup(EditorCookie.class);
    if (edCookie != null) {
        Task prepareTask = edCookie.prepareDocument();             //#227989
        prepareTask.addTaskListener(new TaskListener() {
            @Override
            public void taskFinished(Task task) {
                EventQueue.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        edCookie.open();
                        showLine(how);
                        highlightDetail(edCookie);
                    }
                });
            }
        });
    } else {
        showLine(how);
    }
    SearchHistory.getDefault().add(
            SearchPattern.create(
            searchPattern.getSearchExpression(),
            searchPattern.isWholeWords(), searchPattern.isMatchCase(),
            searchPattern.isRegExp()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:52,代码来源:TextDetail.java


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