本文整理汇总了Java中org.openide.explorer.propertysheet.ExPropertyEditor类的典型用法代码示例。如果您正苦于以下问题:Java ExPropertyEditor类的具体用法?Java ExPropertyEditor怎么用?Java ExPropertyEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExPropertyEditor类属于org.openide.explorer.propertysheet包,在下文中一共展示了ExPropertyEditor类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: commitChanges
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
/**
* Used by PropertyAction to mimic property sheet behavior - trying to invoke
* PropertyEnv listener of the current property editor (we can't create our
* own PropertyEnv instance).
*
* @return current value
* @throws java.beans.PropertyVetoException if someone vetoes this change.
*/
public Object commitChanges() throws PropertyVetoException {
int currentIndex = editorsCombo.getSelectedIndex();
PropertyEditor currentEditor = currentIndex > -1 ? allEditors[currentIndex] : null;
if (currentEditor instanceof ExPropertyEditor) {
// we can only guess - according to the typical pattern the propetry
// editor itself or the custom editor usually implement the listener
// registered in PropertyEnv
PropertyChangeEvent evt = new PropertyChangeEvent(
this, PropertyEnv.PROP_STATE, null, PropertyEnv.STATE_VALID);
if (currentEditor instanceof VetoableChangeListener) {
((VetoableChangeListener)currentEditor).vetoableChange(evt);
}
Component currentCustEd = currentIndex > -1 ? allCustomEditors[currentIndex] : null;
if (currentCustEd instanceof VetoableChangeListener) {
((VetoableChangeListener)currentCustEd).vetoableChange(evt);
}
if (currentEditor instanceof PropertyChangeListener) {
((PropertyChangeListener)currentEditor).propertyChange(evt);
}
if (currentCustEd instanceof PropertyChangeListener) {
((PropertyChangeListener)currentCustEd).propertyChange(evt);
}
}
return commitChanges0();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:FormCustomEditor.java
示例2: setValueWithMirror
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
boolean setValueWithMirror(Object value, Object valueMirror) {
this.currentValue = value;
Class clazz = valueMirror.getClass();
PropertyEditor propertyEditor = findPropertyEditor(clazz);
propertyEditor = testPropertyEditorOnValue(propertyEditor, valueMirror);
if (propertyEditor == null) {
return false;
}
boolean doAttach = false;
mirrorClass = clazz;
delegatePropertyEditor = propertyEditor;
if (env != null && propertyEditor instanceof ExPropertyEditor) {
doAttach = true;
}
delegateValue = valueMirror;
delegatePropertyEditor.setValue(valueMirror);
if (doAttach) {
((ExPropertyEditor) delegatePropertyEditor).attachEnv(env);
}
return doAttach;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ValuePropertyEditor.java
示例3: attachEnv
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
@Override
public void attachEnv(PropertyEnv env) {
if (property != null) {
env.removeVetoableChangeListener(this);
env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
env.addVetoableChangeListener(this);
}
if (delegateEditor instanceof ExPropertyEditor)
((ExPropertyEditor)delegateEditor).attachEnv(env);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ResourceWrapperEditor.java
示例4: attachEnv
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
/**
* This method is called by the IDE to pass
* the environment to the property editor.
*
* @param env environment.
*/
@Override
public void attachEnv(PropertyEnv env) {
propertyEnv = new WeakReference<PropertyEnv>(env);
PropertyEditor prEd = property.getCurrentEditor();
if (prEd instanceof ExPropertyEditor)
((ExPropertyEditor)prEd).attachEnv(env);
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:FormPropertyEditor.java
示例5: attachEnv
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
@Override
public void attachEnv(PropertyEnv env) {
//System.out.println("ValuePropertyEditor.attachEnv("+env+"), feature descriptor = "+env.getFeatureDescriptor());
env.setState(PropertyEnv.STATE_NEEDS_VALIDATION);
env.addVetoableChangeListener(validate);
if (delegatePropertyEditor instanceof ExPropertyEditor) {
//System.out.println(" attaches to "+delegatePropertyEditor);
if (delegateValue instanceof String) {
ShortenedStrings.StringInfo shortenedInfo = ShortenedStrings.getShortenedInfo((String) delegateValue);
if (shortenedInfo != null) {
// The value is too large, do not allow editing!
FeatureDescriptor desc = env.getFeatureDescriptor();
if (desc instanceof Node.Property){
Node.Property prop = (Node.Property)desc;
// Need to make it uneditable
try {
Method forceNotEditableMethod = prop.getClass().getDeclaredMethod("forceNotEditable");
forceNotEditableMethod.setAccessible(true);
forceNotEditableMethod.invoke(prop);
} catch (Exception ex){}
//editable = prop.canWrite();
}
}
}
((ExPropertyEditor) delegatePropertyEditor).attachEnv(env);
this.env = env;
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ValuePropertyEditor.java
示例6: attachEnv
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
public void attachEnv(PropertyEnv env) {
//Delegate if the primitive editor is an ExPropertyEditor -
//boolean and int editors will be
if (pe instanceof ExPropertyEditor) {
((ExPropertyEditor) pe).attachEnv (env);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:WrappersEditor.java
示例7: checkPropertyEnv
import org.openide.explorer.propertysheet.ExPropertyEditor; //导入依赖的package包/类
void checkPropertyEnv() {
if (env != null && delegatePropertyEditor instanceof ExPropertyEditor) {
((ExPropertyEditor) delegatePropertyEditor).attachEnv(env);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ValuePropertyEditor.java
注:本文中的org.openide.explorer.propertysheet.ExPropertyEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论