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

x33g5p2x  于2022-02-03 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(171)

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

WeakSet.add介绍

暂无

代码示例

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

/** Set whether the action will survive a change in focus.
* If <code>false</code>, then the action will be automatically
* disabled (using {@link #setActionPerformer}) when the window
* focus changes.
*
* @param b <code>true</code> to survive focus changes, <code>false</code> to be sensitive to them
*/
public void setSurviveFocusChange(boolean b) {
  synchronized (notSurviving) {
    if (b) {
      notSurviving.remove(getClass());
      surviving.add(getClass());
    } else {
      notSurviving.add(getClass());
      surviving.remove(getClass());
    }
  }
}

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

/** If the name is not empty creates new instance of
 * DelegatingErrorManager. Adds it to createdByMe.
 */
public ErrorManager getInstance(String name) {
  if ((name == null) || ("".equals(name))) { // NOI18N
    return this;
  }
  DelegatingErrorManager dem = new DelegatingErrorManager(name);
  synchronized (this) {
    attachNewDelegates(dem, name);
    createdByMe.add(dem);
  }
  return dem;
}

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

@Override
public boolean add(ContextAction e) {
  assert e != null;
  return super.add(e);
}

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

/** Set whether the action will survive a change in focus.
* If <code>false</code>, then the action will be automatically
* disabled (using {@link #setActionPerformer}) when the window
* focus changes.
*
* @param b <code>true</code> to survive focus changes, <code>false</code> to be sensitive to them
*/
public void setSurviveFocusChange(boolean b) {
  synchronized (notSurviving) {
    if (b) {
      notSurviving.remove(getClass());
      surviving.add(getClass());
    } else {
      notSurviving.add(getClass());
      surviving.remove(getClass());
    }
  }
}

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

/** If the name is not empty creates new instance of
 * DelegatingErrorManager. Adds it to createdByMe.
 */
public ErrorManager getInstance(String name) {
  if ((name == null) || ("".equals(name))) { // NOI18N
    return this;
  }
  DelegatingErrorManager dem = new DelegatingErrorManager(name);
  synchronized (this) {
    attachNewDelegates(dem, name);
    createdByMe.add(dem);
  }
  return dem;
}

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

public AbstractButton getToolbarPresenter() {
  if(toolbarItems == null) {
    toolbarItems = new WeakSet<AbstractButton>(4);
  }
  AbstractButton b = new DefaultIconToggleButton();
  toolbarItems.add(b);
  b.setSelected(isPreferencesSelected());
  Actions.connect(b, this);
  return b;
}

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

/**
 * Registers an listener.
 * @param listener the listener
 */
public void addActiveViewListener (Listener listener) {
  synchronized (listeners) {
    listeners.add (listener);
  }
}

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

/**
 * Registers an active-document listener.
 * @param listener the listener
 */
public void addActiveDocumentListener (Listener listener) {
  synchronized (listeners) {
    listeners.add (listener);
  }
}

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

private void readObject(ObjectInputStream obtis) throws IOException,
  ClassNotFoundException {
  obtis.defaultReadObject();
  Object[] arr = (Object[]) obtis.readObject();
  entries = new Entry[(int) (size * 1.5)];
  refq = new ReferenceQueue();
  for (int i = 0; i < arr.length; i++) {
    add(arr[i]);
  }
}

代码示例来源:origin: in.jlibs/org-openide-util

@SuppressWarnings("unchecked")
private void readObject(ObjectInputStream obtis) throws IOException, ClassNotFoundException {
  obtis.defaultReadObject();
  Object[] arr = (Object[]) obtis.readObject();
  entries = new Entry[(int) (size * 1.5)];
  refq = new ReferenceQueue<E>();
  for (int i = 0; i < arr.length; i++) {
    add((E)arr[i]);
  }
}

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

private void readObject(ObjectInputStream obtis) throws IOException,
  ClassNotFoundException {
  obtis.defaultReadObject();
  Object[] arr = (Object[]) obtis.readObject();
  entries = new Entry[(int) (size * 1.5)];
  refq = new ReferenceQueue();
  for (int i = 0; i < arr.length; i++) {
    add(arr[i]);
  }
}

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

void addFutureDropTarget (JScrollPane view) {
    if (setOfTargets == null)
      setOfTargets = new WeakSet ();
    setOfTargets.add (view);
  }
}

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

private void addPropertySupport(DesignComponent component, DefaultPropertySupport propertySupport) {
  WeakSet<DefaultPropertySupport> propertySupports = propertySupportMap.get(component);
  if (propertySupports == null) {
    propertySupports = new WeakSet<DefaultPropertySupport>();
    propertySupportMap.put(component, propertySupports);
  }
  propertySupports.add(propertySupport);
}

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

void addFutureDropTarget (JScrollPane view) {
    if (setOfTargets == null)
      setOfTargets = new WeakSet ();
    setOfTargets.add (view);
  }
}

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

public void run () {
    listeners.add (listener);
    listener.descriptorRegistryUpdated ();
  }
});

代码示例来源:origin: uk.gov.nationalarchives.thirdparty.netbeans/org-openide-util

/** If the name is not empty creates new instance of
 * DelegatingErrorManager. Adds it to createdByMe.
 */
public ErrorManager getInstance(String name) {
  if ((name == null) || ("".equals(name))) { // NOI18N
    return this;
  }
  DelegatingErrorManager dem = new DelegatingErrorManager(name);
  synchronized (this) {
    attachNewDelegates(dem, name);
    createdByMe.add(dem);
  }
  return dem;
}

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

/** If the name is not empty creates new instance of
 * DelegatingErrorManager. Adds it to createdByMe.
 */
public ErrorManager getInstance(String name) { 
  if ((name == null) || ("".equals(name))) { // NOI18N
    return this;
  }
  DelegatingErrorManager dem = new DelegatingErrorManager(name);
  synchronized (this) {
    attachNewDelegates(dem, name);
    createdByMe.add(dem);
  }
  return dem;
}

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

public Result lookup(Template template) {
  ProxyResult p = new ProxyResult (template);
  synchronized (this) {
    if (results == null) {
      results = new org.openide.util.WeakSet ();
    }
    results.add (p);
  }
  return p;
}

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

public Result lookup(Template template) {
  ProxyResult p = new ProxyResult (template);
  synchronized (this) {
    if (results == null) {
      results = new org.openide.util.WeakSet ();
    }
    results.add (p);
  }
  return p;
}

代码示例来源:origin: in.jlibs/org-openide-util

/** If the name is not empty creates new instance of
 * DelegatingErrorManager. Adds it to createdByMe.
 */
public ErrorManager getInstance(String name) {
  if ((name == null) || ("".equals(name))) { // NOI18N
    return this;
  }
  DelegatingErrorManager dem = new DelegatingErrorManager(name);
  synchronized (this) {
    attachNewDelegates(dem, name);
    createdByMe.add(dem);
  }
  return dem;
}

相关文章