org.openide.util.Mutex.writeAccess()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.openide.util.Mutex.writeAccess()方法的一些代码示例,展示了Mutex.writeAccess()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mutex.writeAccess()方法的具体详情如下:
包路径:org.openide.util.Mutex
类名称:Mutex
方法名:writeAccess

Mutex.writeAccess介绍

[英]Run an action with write access and return no result. It may be run asynchronously.
[中]使用写访问权限运行操作,但不返回任何结果。它可以异步运行。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

/** Setter for lists items.
 * @param content Array of list items.
 */
public void setContent(final String[] content) {
  final JList list = contentList;
  if (list == null) {
    return;
  }
  // #18055: Ensure it runs in AWT thread.
  // Remove this when component handling will be assured
  // by other means that runs always in AWT.
  Mutex.EVENT.writeAccess(
    new Runnable() {
    @Override
      public void run() {
        list.setListData(content);
        list.revalidate();
        list.repaint();
        contentLabelPanel.setVisible(content.length > 0);
      }
    }
  );
}

代码示例来源:origin: org.netbeans.api/org-openide-nodes

nonNullNodes.toArray(nodes2);
Mutex.EVENT.writeAccess(
  new Runnable() {
    public void run() {

代码示例来源:origin: org.netbeans.api/org-openide-text

private static void doShow(final Line l, final int column, final Line.ShowOpenType openType, final Line.ShowVisibilityType visibilityType) {
  Mutex.EVENT.writeAccess(new Runnable() {
    @Override
    public void run() {
      l.show(openType, visibilityType, column);
    }
  });
}

代码示例来源:origin: org.netbeans.api/org-openide-text

private static void doOpen(final Openable oc) {
  Mutex.EVENT.writeAccess(new Runnable() {
    @Override
    public void run() {
      oc.open();
    }
  });
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-model

void reload () {
  // TODO - method call assertion
  mutex.writeAccess (new Runnable () {
    public void run () {
      reloadCore ();
    }
  });
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-model

public void run () {
    mutex.writeAccess (new Runnable () {
      public void run () {
        writeAccessCore (runnable);
        eventID[0] = listenerManager.getEventID ();
      }
    });
  }
});

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public void stateChanged(final ChangeEvent evt) {
    Mutex.EVENT.writeAccess(new Runnable() {
      public void run() {
        setEnabled(((java.util.Set)evt.getSource()).size() > 0);
      }
    });
  }
} // end of ModifiedListL inner class

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-model

public void run () {
    mutex.writeAccess (runnable);
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-project

@Override
public void setActiveBrowser(final WebBrowser browser) throws IllegalArgumentException, IOException {
  ProjectManager.mutex().writeAccess(new Runnable() {
    public void run() {
  AntProjectHelper helper = project.getAntProjectHelper();
  EditableProperties privateProps = helper.getProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH);
      privateProps.put(WebProjectProperties.SELECTED_BROWSER, browser.getId());
  helper.putProperties(AntProjectHelper.PRIVATE_PROPERTIES_PATH, privateProps);
    }
  });
  pcs.firePropertyChange(PROP_BROWSER_ACTIVE, null, null);
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public void clipboardChanged(ClipboardEvent ev) {
  final ExplorerManager em = manager;
  if (!ev.isConsumed() && em != null) {
    Mutex.EVENT.writeAccess (new Runnable () {
      public void run () {
        updatePasteAction(em.getSelectedNodes());
      }
    });
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-project

public void run() throws IOException {
    ProjectManager.mutex().writeAccess(new Runnable() {
      public void run()  {
        updateProject();
      }
    });
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project

public void upgrade() {
  ProjectManager.mutex().writeAccess(new Runnable() {
    @Override
    public void run() {
      upgradeProjectProperties();
    }
  });
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-clientproject

public void run() throws IOException {
    ProjectManager.mutex().writeAccess(new Runnable() {
      public void run() {
        updateProject();
      }
    });
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-ejbjarproject

public void run() throws IOException {
    ProjectManager.mutex().writeAccess(new Runnable() {
      public void run() {
        updateProject();
      }
    });
  }
});

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public void clipboardChanged(ClipboardEvent ev) {
  final ExplorerManager em = manager;
  if (!ev.isConsumed() && em != null) {
    Mutex.EVENT.writeAccess (new Runnable () {
      public void run () {
        updatePasteAction(em.getSelectedNodes());
      }
    });
  }
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-cnd-gizmo

private void doSave(final String name, final String value) {
  ProjectManager.mutex().writeAccess(new Runnable() {
    @Override
    public void run() {
      Element configurationFragment = getConfigurationFragment();
      if (configurationFragment != null) {
        Element el = getNode(configurationFragment, name);
        el.setTextContent(value);
        aux.putConfigurationFragment(configurationFragment, shared);
      }
    }
  });
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-projectapi-nb

@Override
public void writeAccess(Runnable runnable) {
  owner.MUTEX.writeAccess(wrap(runnable));
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-projectapi-nb

@Override
public <T> T writeAccess(ExceptionAction<T> action) throws MutexException {
  return owner.MUTEX.writeAccess(wrap(action));
}

代码示例来源:origin: org.netbeans.api/org-netbeans-modules-vmd-model

void writeAccess (final Runnable runnable) {
  assert Debug.isFriend (DescriptorRegistry.class, "removeComponentDescriptor")  ||  Debug.isFriend (ComponentSerializationSupport.class, "runUnderDescriptorRegistryWriteAccess"); // NOI18N
  mutex.writeAccess (runnable);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-navigation

public void setEmpty() {
  menuAvaliable.set(false);
  updateButtons();
  final Children children = root.getChildren();
  if (!Children.MUTEX.isReadAccess()){
    Children.MUTEX.writeAccess(new Runnable(){
      @Override
      public void run() {
        children.remove(children.getNodes());
      }
    });
  }
}

相关文章