本文整理汇总了Java中org.openide.nodes.Node.PropertySet类的典型用法代码示例。如果您正苦于以下问题:Java PropertySet类的具体用法?Java PropertySet怎么用?Java PropertySet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertySet类属于org.openide.nodes.Node包,在下文中一共展示了PropertySet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProxyProperty
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
/** Finds properties in original with specified
* name in all tabs and constructs a ProxyProperty instance.
*/
private ProxyProperty createProxyProperty(Node[] copy, String propName, String setName) {
Node.Property[] arr = new Node.Property[copy.length];
for (int i = 0; i < copy.length; i++) {
Node.PropertySet[] p = getOriginalPropertySets(copy).get(i);
for (int j = 0; j < p.length; j++) {
if (Utilities.compareObjects(setName, p[j].getName())) {
Node.Property[] np = p[j].getProperties();
for (int k = 0; k < np.length; k++) {
if (np[k].getName().equals(propName)) {
arr[i] = np[k];
}
}
}
}
}
return new ProxyProperty(arr);
}
示例2: nodePropertyChange
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
private void nodePropertyChange(PropertyChangeEvent pce) {
String nm = pce.getPropertyName();
if (PROP_COOKIE.equals(nm)) {
fireCookieChange();
} else if (PROP_DISPLAY_NAME.equals(nm)) {
displayName = null;
fireDisplayNameChange((String) pce.getOldValue(), getDisplayName());
} else if (PROP_ICON.equals(nm)) {
fireIconChange();
} else if (PROP_OPENED_ICON.equals(nm)) {
fireOpenedIconChange();
} else if (PROP_NAME.equals(nm)) {
fireNameChange((String) pce.getOldValue(), getName());
} else if (PROP_PROPERTY_SETS.equals(nm)) {
PropertySet[] old = getPropertySets();
setSheet(createSheet());
firePropertySetsChange(old, getPropertySets());
} else if (PROP_SHORT_DESCRIPTION.equals(nm)) {
fireShortDescriptionChange((String) pce.getOldValue(), getShortDescription());
} else if (PROP_LEAF.equals(nm)) {
//Not interesting to property sheet
} else if (PROP_PARENT_NODE.equals(nm)) {
//Not interesting to property sheet
}
}
示例3: realPropertyChange
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
private void realPropertyChange(PropertyChangeEvent pce) {
String nm = pce.getPropertyName();
Node.PropertySet[] pss = getPropertySets();
boolean exists = false;
for (int i = 0; i < pss.length && !exists; i++) {
Node.Property[] ps = pss[i].getProperties();
for (int j = 0; j < ps.length && !exists; j++) {
if (ps[j].getName().equals(nm)) {
exists = true;
}
}
}
if( exists ) {
firePropertyChange(pce.getPropertyName(), pce.getOldValue(), pce.getNewValue());
}
}
示例4: setPropertySets
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
public void setPropertySets(PropertySet[] sets) {
setCount = (sets == null) ? 0 : sets.length;
if (sets == null) {
sets = new PropertySet[0];
}
if ((setCount == 0) && !SwingUtilities.isEventDispatchThread()) {
//Allow thread safe access for node destroyed events to
this.sets = new PropertySet[0];
resetArray(sets);
fds.clear();
SwingUtilities.invokeLater(this);
return;
}
firePendingChange(false);
this.sets = sets;
resetArray(sets);
init();
run();
}
示例5: isCellEditable
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
@Override
public boolean isCellEditable(int rowIndex, int columnIndex) {
//if column is 0, it's the property name - can't edit that
if (columnIndex == 0) {
return false;
}
if (columnIndex == 1) {
FeatureDescriptor fd = model.getFeatureDescriptor(rowIndex);
//no worries, editCellAt() will expand it and return before
//this method is called
if (fd instanceof PropertySet) {
return false;
}
return ((Property) fd).canWrite();
}
throw new IllegalArgumentException(
"Illegal row/column: " + Integer.toString(rowIndex) + Integer.toString(columnIndex)
); //NOI18N
}
示例6: hasNext
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
public boolean hasNext() {
if (!ready) {
if (first || (++propIndex == properties.length)) {
if (first) {
propSets = comp.getProperties();
first = false;
}
while (++propSetIndex != propSets.length) {
Node.PropertySet propSet;
if (isFormPropSet(propSet = propSets[propSetIndex])
&& ((properties = propSet.getProperties()).length != 0)) {
propIndex = 0;
break;
}
}
if (propSetIndex == propSets.length) {
exhausted = true;
}
}
ready = true;
}
return !exhausted;
}
示例7: cloneSheet
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
/** Clones the property sheet of original node.
*/
private Sheet cloneSheet () {
PropertySet[] sets = super.getPropertySets ();
Sheet s = new Sheet ();
for (int i = 0; i < sets.length; i++) {
Sheet.Set ss = new Sheet.Set ();
ss.put (sets[i].getProperties ());
ss.setName (sets[i].getName ());
ss.setDisplayName (sets[i].getDisplayName ());
ss.setShortDescription (sets[i].getShortDescription ());
// modifies the set if it contains name of object property
modifySheetSet (ss);
s.put (ss);
}
return s;
}
示例8: findProperty
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
private static Node.Property findProperty (Node n, String name) {
Node.PropertySet[] arr = n.getPropertySets ();
StringBuffer names = new StringBuffer ();
String prefix = "";
for (int i = 0; i < arr.length; i++) {
Node.PropertySet set = arr[i];
Node.Property[] properties = set.getProperties ();
for (int j = 0; j < properties.length; j++) {
Node.Property p = properties[j];
if (name.equals (p.getName ())) {
return p;
}
names.append (prefix);
names.append (p.getName ());
prefix = ", ";
}
}
fail ("Cannot find property \"" + name + "\" in node " + n + " it has only " + names + " propeties.");
return null;
}
示例9: testEnableOnNotNullProperties
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
public void testEnableOnNotNullProperties () throws Exception {
PropertySet [] s = new PropertySet [] { new PropertySet () {
public Property[] getProperties () {
Property p = new Property<String>(String.class) {
public boolean canRead () {
return true;
}
public boolean canWrite () {
return true;
}
public String getValue() {
return null;
}
public void setValue(String val) {}
};
return new Property [] { p };
}
} };
testEnable (s);
}
示例10: getPropertySets
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
@Override
public PropertySet[] getPropertySets() {
final Sheet.Set set = Sheet.createPropertiesSet();
set.put(new PropertySupport.ReadOnly<Boolean>(
"PROP_DebugBridgeConnected",
Boolean.class,
NbBundle.getMessage(DevicesNode.class, "PROP_DebugBridgeConnected"),
NbBundle.getMessage(DevicesNode.class, "DESC_DebugBridgeConnected")) {
@Override
public Boolean getValue() throws IllegalAccessException, InvocationTargetException {
final AndroidDebugBridge jp = AndroidSdkProvider.getAdb();
return jp == null ? Boolean.FALSE : jp.isConnected();
}
});
return new PropertySet[]{
set
};
}
示例11: getPropertySets
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
@Messages({
"PROP_name=Name",
"HINT_name=Package Name",
"PROP_rootpath=Source Root",
"HINT_rootpath=Source Root"
})
@Override public PropertySet[] getPropertySets() {
final PropertySet[] properties = getDataFolderNodeDelegate().getPropertySets();
final PropertySet[] newProperties = Arrays.copyOf(properties, properties.length);
for (int i=0; i< newProperties.length; i++) {
if (Sheet.PROPERTIES.equals(newProperties[i].getName())) {
//Replace the Sheet.PROPERTIES by the new one
//having the ro name property and ro path property
newProperties[i] = Sheet.createPropertiesSet();
((Sheet.Set)newProperties[i]).put(new PropertySupport.ReadOnly<String>(DataObject.PROP_NAME, String.class,
PROP_name(), HINT_name()) {
@Override
public String getValue() {
return PackageRootNode.this.getDisplayName();
}
});
((Sheet.Set)newProperties[i]).put(new PropertySupport.ReadOnly<String>("ROOT_PATH", String.class, //NOI18N
PROP_rootpath(), HINT_rootpath()) {
@Override
public String getValue() {
return FileUtil.getFileDisplayName(PackageRootNode.this.file);
}
});
}
}
return newProperties;
}
示例12: getPropertySets
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
@Override
public PropertySet[] getPropertySets () {
if (properties == null) {
Node.Property[] props = nodeBorder.getProperties();
Sheet.Set propSet = Sheet.createPropertiesSet();
propSet.put(props);
for (int i=0; i < props.length; i++)
if (props[i] instanceof FormProperty)
((FormProperty)props[i]).addPropertyChangeListener(this);
properties = new PropertySet[] { propSet };
}
return properties;
}
示例13: addProperties
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
private void addProperties() {
addPropertySet(new PropertySet("main", NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropMain"),
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropMainDescr")) {
@Override
public Property<?>[] getProperties() {
return new Property[] {
new ReadOnly("name", String.class,
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropName"),
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropNameDescr")) {
@Override
public Object getValue() throws IllegalAccessException, InvocationTargetException {
return JavaComponentInfo.this.getName();
}
},
new ReadOnly("type", String.class,
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropType"),
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropTypeDescr")) {
@Override
public Object getValue() throws IllegalAccessException, InvocationTargetException {
return JavaComponentInfo.this.getType();
}
},
new ReadOnly("bounds", String.class,
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropBounds"),
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropBoundsDescr")) {
@Override
public Object getValue() throws IllegalAccessException, InvocationTargetException {
Rectangle r = JavaComponentInfo.this.getWindowBounds();
return "[x=" + r.x + ",y=" + r.y + ",width=" + r.width + ",height=" + r.height + "]";
}
},
};
}
});
final LazyProperties lazyProperties = new LazyProperties();
addPropertySet(
new PropertySet("Properties",
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentProps"),
NbBundle.getMessage(JavaComponentInfo.class, "MSG_ComponentPropsDescr")) {
@Override
public Property<?>[] getProperties() {
//System.err.println("JavaComponentInfo.Properties PropertySet.getProperties()");
// To fix https://netbeans.org/bugzilla/show_bug.cgi?id=243065
// https://netbeans.org/bugzilla/show_bug.cgi?id=241154
// Do not compute properties above, compute them on demand in a separate thread now.
// When done, fire Node.PROP_PROPERTY_SETS, null, null.
Property<?>[] props = lazyProperties.getProperties();
//System.err.println("\nprops = "+props.length+"\n");
return props;
}
});
try {
Method getTextMethod = ClassTypeWrapper.concreteMethodByName(
(ClassType) ObjectReferenceWrapper.referenceType(component), "getText", "()Ljava/lang/String;");
//Method getTextMethod = methodsByName.get("getText"); // NOI18N
if (getTextMethod != null) {
try {
Value theText = ObjectReferenceWrapper.invokeMethod(component, getThread().getThreadReference(), getTextMethod, Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
if (theText instanceof StringReference) {
setComponentText(StringReferenceWrapper.value((StringReference) theText));
}
} catch (VMDisconnectedExceptionWrapper vmdex) {
return;
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
}
}
} catch (ClassNotPreparedExceptionWrapper | InternalExceptionWrapper |
ObjectCollectedExceptionWrapper | VMDisconnectedExceptionWrapper cnpe) {
}
}
示例14: getOriginalPropertySets
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
private ArrayList<Node.PropertySet[]> getOriginalPropertySets(Node[] forWhat) {
if( null == originalPropertySets ) {
ArrayList<PropertySet[]> arr = new ArrayList<Node.PropertySet[]>( forWhat.length );
for( int i=0; i<forWhat.length; i++) {
Node.PropertySet[] p = forWhat[i].getPropertySets();
arr.add( p );
}
if (original == forWhat) {
originalPropertySets = arr;
}
return arr;
}
return originalPropertySets;
}
示例15: PropertySetModelImpl
import org.openide.nodes.Node.PropertySet; //导入依赖的package包/类
public PropertySetModelImpl(PropertySet[] ps) {
if (ps == null) {
ps = new PropertySet[0];
}
setPropertySets(ps);
}