本文整理汇总了Java中org.openide.loaders.DataObject.isTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java DataObject.isTemplate方法的具体用法?Java DataObject.isTemplate怎么用?Java DataObject.isTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.loaders.DataObject
的用法示例。
在下文中一共展示了DataObject.isTemplate方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNodes
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
@Override
protected Node[] createNodes(Node key) {
Node [] orig = super.createNodes (key);
Node [] filtered = new Node [orig.length];
for (int i = 0; i < orig.length; i++) {
FileObject fo = orig[i].getLookup ().lookup(FileObject.class);
boolean isTemplate;
if (fo != null) {
isTemplate = isTemplate(fo);
} else {
DataObject dobj = getDOFromNode (orig [i]);
isTemplate = dobj.isTemplate();
}
if (isTemplate) {
filtered [i] = new TemplateNode (orig [i], Children.LEAF);
} else {
filtered [i] = new TemplateNode (orig [i]);
}
}
return filtered;
}
示例2: createNodes
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
@Override
protected Node[] createNodes(DataObject dobj) {
if (dobj.isTemplate()) {
Node templateNode = new FilterNode(dobj.getNodeDelegate(), Children.LEAF);
if( null == filterText || templateNode.getDisplayName().toLowerCase().contains( filterText.toLowerCase() ) )
return new Node[] { templateNode };
}
return new Node[0];
}
示例3: isTemplate
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
private static boolean isTemplate (DataObject dobj) {
if (dobj.isTemplate())
return true;
if (dobj instanceof DataShadow) {
return ((DataShadow)dobj).getOriginal().isTemplate();
}
return false;
}
示例4: acceptTemplate
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
private boolean acceptTemplate(DataObject d) {
if (d.isTemplate() || d instanceof DataFolder) {
Object o = d.getPrimaryFile().getAttribute("simple"); // NOI18N
return o == null || Boolean.TRUE.equals(o);
} else {
return false;
}
}
示例5: JavaNode
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
/** Create a node for the Java data object using the default children.
* @param jdo the data object to represent
*/
public JavaNode (final DataObject jdo, boolean isJavaSource) {
super (jdo, Children.LEAF);
this.isJavaSource = isJavaSource;
this.isCompiled = new AtomicReference<>();
this.isExecutable = new AtomicReference<>();
this.computedIcon = new AtomicReference<>();
this.computedIconListener = new AtomicReference<>();
this.setIconBaseWithExtension(isJavaSource ? JAVA_ICON_BASE : CLASS_ICON_BASE);
Logger.getLogger("TIMER").log(Level.FINE, "JavaNode", new Object[] {jdo.getPrimaryFile(), this});
if (!jdo.isTemplate()) {
WORKER.post(IconTask.create(this));
if (isJavaSource) {
WORKER.post(new BuildStatusTask(this));
WORKER.post(new ExecutableTask(this));
jdo.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (DataObject.PROP_PRIMARY_FILE.equals(evt.getPropertyName())) {
Logger.getLogger("TIMER").log(Level.FINE, "JavaNode", new Object[]{jdo.getPrimaryFile(), this});
WORKER.post(new Runnable() {
public void run() {
computedIconListener.set(null);
synchronized (JavaNode.this) {
status = null;
executableListener = null;
WORKER.post(new BuildStatusTask(JavaNode.this));
WORKER.post(new ExecutableTask(JavaNode.this));
}
}
});
}
}
});
}
}
}
示例6: create
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
@Override
public FileObject create(FileObject template, FileObject folder, String name) throws IOException {
DataObject templateDobj = DataObject.find(template);
if (templateDobj == null || !templateDobj.isTemplate()) {
return FileUtil.createData(folder, name);
}
DataFolder target = DataFolder.findFolder(folder);
String simpleName = FileObjects.stripExtension(name);
DataObject newDobj = templateDobj.createFromTemplate(target, simpleName);
return newDobj.getPrimaryFile();
}
示例7: enable
import org.openide.loaders.DataObject; //导入方法依赖的package包/类
protected boolean enable (Node[] activatedNodes) {
if (activatedNodes.length != 1) return false;
DataObject obj = activatedNodes[0].getCookie(DataObject.class);
return obj != null && obj.isTemplate ();
}