static boolean affectsOrder(FileAttributeEvent event) { String name = event.getName(); if (name == null) { // Unknown attrs changed. Conservatively assume it might affect order. return true; } return name.equals(ATTR_POSITION) || (event.getFile().isFolder() && name.indexOf('/') != -1); }
public void fileAttributeChanged(FileAttributeEvent fe) { FileObject thisFo = this.get(); if (thisFo != null && FileUtil.isParentOf(thisFo, fe.getFile())) { fcl.fileAttributeChanged(fe); } }
/** Fires event */ protected final void fileAttributeChanged0(FileAttributeEvent fileattributeevent) { super.fireFileAttributeChangedEvent(listeners(), fileattributeevent); if (fileattributeevent.getFile().equals(this) && (parent != null)) { FileAttributeEvent ev = new FileAttributeEvent( parent, fileattributeevent.getFile(), fileattributeevent.getName(), fileattributeevent.getOldValue(), fileattributeevent.getNewValue(), fileattributeevent.isExpected() ); try { ev.inheritPostNotify(fileattributeevent); parent.fileAttributeChanged0(ev); } finally { ev.setPostNotify(null); } } }
@Override public void fileAttributeChanged(FileAttributeEvent fe) { if (DataObject.PROP_TEMPLATE.equals(fe.getName())) { fireTemplateChanged(fe.getFile()); } }
public void fileAttributeChanged(FileAttributeEvent fe) { changeResourcePath(fe.getFile()); reload(); }
void notifyAttributeChanged(FileAttributeEvent fae) { if (! EA_ASSIGNED_LOADER.equals(fae.getName())) { // We are interested only in assigned loader return; } FileObject f = fae.getFile(); if (f != null) { String attrFromFO = (String)f.getAttribute(EA_ASSIGNED_LOADER); if (attrFromFO == null || (! attrFromFO.equals(getLoader().getClass().getName()))) { java.util.HashSet single = new java.util.HashSet(); single.add(f); if (!DataObjectPool.getPOOL().revalidate(single).isEmpty()) { ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, "It was not possible to invalidate data object: " + this); // NOI18N } else { // we need to refresh parent folder if it is there // this should be covered by DataLoaderPoolTest.testChangeIsAlsoReflectedInNodes FolderList.changedDataSystem (f.getParent()); } } } } }
/** Fires event */ protected final void fileAttributeChanged0 (FileAttributeEvent fileattributeevent) { super.fireFileAttributeChangedEvent(listeners (), fileattributeevent); if(fileattributeevent.getFile().equals(this) && parent != null) { FileAttributeEvent ev = new FileAttributeEvent( parent, fileattributeevent.getFile(), fileattributeevent.getName(), fileattributeevent.getOldValue(), fileattributeevent.getNewValue(), fileattributeevent.isExpected () ); parent.fileAttributeChanged0 (ev); } }
/** Fires event */ protected final void fileAttributeChanged0 (FileAttributeEvent fileattributeevent) { super.fireFileAttributeChangedEvent(listeners (), fileattributeevent); if(fileattributeevent.getFile().equals(this) && parent != null) { FileAttributeEvent ev = new FileAttributeEvent( parent, fileattributeevent.getFile(), fileattributeevent.getName(), fileattributeevent.getOldValue(), fileattributeevent.getNewValue(), fileattributeevent.isExpected () ); parent.fileAttributeChanged0 (ev); } }
/** Fired when a file attribute has been changed. * * @param fe the event describing context where action has taken place */ public void fileAttributeChanged(FileAttributeEvent fe) { final boolean LOG = err.isLoggable(ErrorManager.INFORMATIONAL); if (LOG) err.log("fileAttributeChanged: " + fe); // update list when attrs defining order were changed if (fe.getFile() == folder) { /** Means one of attributes were changed*/ if (fe.getName() == null) { changeComparator(); return; } if (DataFolder.EA_ORDER.equals(fe.getName()) || DataFolder.EA_SORT_MODE.equals(fe.getName()) || -1 != fe.getName().indexOf("/")) { changeComparator(); } } }
/** Fired when a file attribute is changed. * @param fe the event describing context where action has taken place, * the name of attribute and the old and new values. */ public void fileAttributeChanged(FileAttributeEvent fe) { // [PENDING] this is not at all sufficient to notify every change in attributes. // One, parent dirs of front filesystems can now hold attributes for missing // files. Two, non-leader files can have attributes too which are merged in. // In principle all files/folders whose path is a prefix of this path on all // contained filesystems should be listened to for attribute change events. if (!hasAtLeastOneListeners () || leader == null) return; /** If change is not fired from leader then leader may mask this attribute * and then event should not be fired */ if (!fe.getFile().equals(leader) && fe.getName() != null && leader.getAttribute (fe.getName()) != null) return; /** If change is not fired from leader then another delegate may mask this attribute * and then event should not be fired. */ if (!fe.getFile().equals(leader) && fe.getNewValue() != null && fe.getName() != null && !fe.getNewValue().equals (getAttribute (fe.getName()))) return; fileAttributeChanged0 (new FileAttributeEvent ( this, fe.getName(), fe.getOldValue(), fe.getNewValue())); }
/** Fired when a file attribute is changed. * @param fe the event describing context where action has taken place, * the name of attribute and the old and new values. */ public void fileAttributeChanged(FileAttributeEvent fe) { // [PENDING] this is not at all sufficient to notify every change in attributes. // One, parent dirs of front filesystems can now hold attributes for missing // files. Two, non-leader files can have attributes too which are merged in. // In principle all files/folders whose path is a prefix of this path on all // contained filesystems should be listened to for attribute change events. if (!hasAtLeastOneListeners () || leader == null) return; /** If change is not fired from leader then leader may mask this attribute * and then event should not be fired */ if (!fe.getFile().equals(leader) && fe.getName() != null && leader.getAttribute (fe.getName()) != null) return; /** If change is not fired from leader then another delegate may mask this attribute * and then event should not be fired. */ if (!fe.getFile().equals(leader) && fe.getNewValue() != null && fe.getName() != null && !fe.getNewValue().equals (getAttribute (fe.getName()))) return; fileAttributeChanged0 (new FileAttributeEvent ( this, fe.getName(), fe.getOldValue(), fe.getNewValue())); }