org.openide.nodes.Sheet.findIndex()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(90)

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

Sheet.findIndex介绍

[英]Finds index for property set for given name.
[中]查找给定名称的属性集的索引。

代码示例

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

/** Find the property set with a given name.
* @param name name of the set
* @return the property set, or <code>null</code> if no such set exists
*/
public synchronized Set get(String name) {
  int indx = findIndex(name);
  return (indx == -1) ? null : sets.get(indx);
}

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

/** Remove a property set from the sheet.
* @param set name of set to remove
* @return removed set, or <code>null</code> if the set could not be found
*/
public synchronized Set remove(String set) {
  int indx = findIndex(set);
  if (indx != -1) {
    Set s = sets.remove(indx);
    s.removePropertyChangeListener(propL);
    refresh();
    return s;
  } else {
    return null;
  }
}

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

/** Add a property set. If the set does not yet exist in the sheet,
* inserts a new set with the implied name. Otherwise the old set is replaced
* by the new one.
*
* @param set to add
* @return the previous set with the same name, or <code>null</code> if this is a fresh insertion
*/
public synchronized Set put(Set set) {
  int indx = findIndex(set.getName());
  Set removed = null;
  if (indx == -1) {
    sets.add(set);
  } else {
    removed = sets.set(indx, set);
    removed.removePropertyChangeListener(propL);
  }
  set.addPropertyChangeListener(propL);
  refresh();
  return removed;
}

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

/** Find the property set with a given name.
* @param name name of the set
* @return the property set, or <code>null</code> if no such set exists
*/
public synchronized Set get (String name) {
  int indx = findIndex (name);
  return indx == -1 ? null : (Set)sets.get (indx);
}

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

/** Find the property set with a given name.
* @param name name of the set
* @return the property set, or <code>null</code> if no such set exists
*/
public synchronized Set get (String name) {
  int indx = findIndex (name);
  return indx == -1 ? null : (Set)sets.get (indx);
}

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

/** Remove a property set from the sheet.
* @param set name of set to remove
* @return removed set, or <code>null</code> if the set could not be found
*/
public synchronized Set remove (String set) {
  int indx = findIndex (set);
  if (indx != -1) {
    Set s = (Set)sets.remove (indx);
    s.removePropertyChangeListener (propL);
    refresh ();
    return s;
  } else {
    return null;
  }
}

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

/** Remove a property set from the sheet.
* @param set name of set to remove
* @return removed set, or <code>null</code> if the set could not be found
*/
public synchronized Set remove (String set) {
  int indx = findIndex (set);
  if (indx != -1) {
    Set s = (Set)sets.remove (indx);
    s.removePropertyChangeListener (propL);
    refresh ();
    return s;
  } else {
    return null;
  }
}

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

/** Add a property set. If the set does not yet exist in the sheet,
* inserts a new set with the implied name. Otherwise the old set is replaced
* by the new one.
*
* @param set to add
* @return the previous set with the same name, or <code>null</code> if this is a fresh insertion
*/
public synchronized Set put (Set set) {
  int indx = findIndex (set.getName ());
  Set removed;
  if (indx == -1) {
    sets.add (set);
    removed = null;
  } else {
    removed = (Set)sets.set (indx, set);
  }
  set.removePropertyChangeListener (propL);
  if (removed == null) {
    set.addPropertyChangeListener (propL);
  }
  refresh ();
  return removed;
}

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

/** Add a property set. If the set does not yet exist in the sheet,
* inserts a new set with the implied name. Otherwise the old set is replaced
* by the new one.
*
* @param set to add
* @return the previous set with the same name, or <code>null</code> if this is a fresh insertion
*/
public synchronized Set put (Set set) {
  int indx = findIndex (set.getName ());
  Set removed;
  if (indx == -1) {
    sets.add (set);
    removed = null;
  } else {
    removed = (Set)sets.set (indx, set);
  }
  set.removePropertyChangeListener (propL);
  if (removed == null) {
    set.addPropertyChangeListener (propL);
  }
  refresh ();
  return removed;
}

相关文章