Package org.apache.commons.collections

Examples of org.apache.commons.collections.Closure


        }

        if (dumpPendingAtClose) {
            if (frontier instanceof BdbFrontier) {

                Closure closure = new Closure() {
                    public void execute(Object curi) {
                        try {
                            innerProcess((CrawlURI) curi);
                            pendingDumpedCount++;
                        } catch (InterruptedException e) {
View Full Code Here


        }

        if (dumpPendingAtClose) {
            if (frontier instanceof BdbFrontier) {

                Closure closure = new Closure() {
                    public void execute(Object curi) {
                        try {
                            innerProcessResult((CrawlURI) curi);
                            pendingDumpedCount++;
                        } catch (InterruptedException e) {
View Full Code Here

        }
        if (predicatesAndClosures.size() == 0) {
            return NOPClosure.INSTANCE;
        }
        // convert to array like this to guarantee iterator() ordering
        Closure defaultClosure = (Closure) predicatesAndClosures.remove(null);
        int size = predicatesAndClosures.size();
        if (size == 0) {
            return (defaultClosure == null ? NOPClosure.INSTANCE : defaultClosure);
        }
        closures = new Closure[size];
View Full Code Here

      final Task _newParentTask = newParentTask;
      final Object eventSource = e.getSource();

      // recursively remove all dependencies between new parent and any children, grandchildren, etc.
      taskOutlines.getDefaultOutline().getHierarchy().visitAll(newParentNode, new Closure() {
        public void execute(Object arg) {
          Node node=(Node)arg;
          if (!(node.getImpl() instanceof Task)) return;
          Task task = (Task) node.getImpl();
          DependencyService.getInstance().removeAnyDependencies(task, _newParentTask,eventSource);
View Full Code Here

* When opening a project or just after saving, need to put all tasks back to their undirty state.
* This means the task is considered as being untouched since the last save.
*
*/
  public void setAllTasksAsUnchangedFromPersisted(boolean justSaved) {
    getTaskOutline().getHierarchy().visitAll(new Closure(){
      int id=1;
      public void execute(Object o) {
        Node node=(Node)o;
        if (node.getImpl() instanceof NormalTask){
          NormalTask task=(NormalTask)node.getImpl();
View Full Code Here

  public void showDependencyPropertiesDialog(final GraphicDependency dependency) {
      if (dependencyPropertiesDialog == null) {
        Frame parent=JOptionPane.getFrameForComponent(getGraph());
        dependencyPropertiesDialog = new XbsDependencyDialog(parent,dependency);
      }
      boolean didAction = XbsDependencyDialog.doDialog(dependencyPropertiesDialog,dependency,new Closure(){
        public void execute(Object arg0) {
          Node child=dependency.getSuccessor().getNode();
          int position=0;
          TreeNode[] path=((NodeBridge)child).getPath();
          if (path.length>1){
View Full Code Here

  }

  private ArrayList<ResourceInTeamFilter> resourcesInTeamFilters=new ArrayList<ResourceInTeamFilter>();

  public Closure addTransformerInitializationClosure(){
    return new Closure(){
      public void execute(Object arg) {
        ViewTransformer transformer=(ViewTransformer)arg;
            NodeFilter hiddenFilter=transformer.getHiddenFilter();
            if (hiddenFilter!=null&& hiddenFilter instanceof ResourceInTeamFilter){
              ResourceInTeamFilter rf=(ResourceInTeamFilter)hiddenFilter;
View Full Code Here

    }
    if (getUndoController() != null &&  getUndoController().getEditSupport() != null)
      getUndoController().getEditSupport().removeUndoableEditListener(this);
    if (coord != null)
      coord.removeTimeScaleListener(mainView);
      forAllViews(new Closure() {
      public void execute(Object v) {
        if (v != null)
          ((BaseView)v).cleanUp();
      }});
      resetViews();
View Full Code Here

        SessionFactory.getInstance().setCredentials(credentials);
        try {
          Session session = SessionFactory.getInstance().getSession(false);
        System.out.println("logging in");
          final GraphicManager gm = graphicManager;
          SessionFactory.callNoEx(session,"login",new Class[]{Closure.class},new Object[]{new Closure(){
            public void execute(Object arg0) {
              Map<String,String> env=(Map<String,String>)arg0;
              if (env!=null){
                String serverVersion=env.get("serverVersion");
                checkServerVersion(serverVersion);
View Full Code Here

          writable = Boolean.FALSE;
        else
          writable = verifyOpenWritable(projectId);
        if (writable == null)
          return;
        gm.loadDocument(projectId, true,!writable,new Closure(){
          public void execute(Object arg0) {
            Project project=(Project)arg0;
            DocumentFrame frame=gm.getCurrentFrame();
            if (frame!=null&&frame.getProject().getUniqueId() != projectId) {
              gm.switchToProject(projectId);
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.Closure

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.