1 19 package org.openharmonise.him.actions.rules; 20 21 import java.util.Iterator ; 22 23 import org.openharmonise.vfs.*; 24 25 26 34 public class NoPublishedChildrenRule implements EnableRule { 35 36 39 public NoPublishedChildrenRule() { 40 super(); 41 } 42 43 46 public boolean isEnabled(VirtualFile vfFile) { 47 boolean bFound = false; 48 49 if(vfFile.isDirectory()) { 50 Iterator itor = vfFile.getChildren().iterator(); 51 while (itor.hasNext()) { 52 String sPath = (String ) itor.next(); 53 VirtualFile vfChild = vfFile.getVFS().getVirtualFile(sPath).getResource(); 54 if(vfChild.getState()==VirtualFile.STATE_LIVE) { 55 bFound = true; 56 break; 57 } 58 } 59 } 60 61 return !bFound; 62 } 63 64 67 public void setResultComparator(boolean bComparator) { 68 70 } 71 72 } 73 | Popular Tags |