1 19 package org.openharmonise.him.actions.rules; 20 21 import org.openharmonise.vfs.*; 22 23 31 public class TabRule implements EnableRule { 32 33 boolean m_bComparator = true; 34 35 38 private String m_sTabName = null; 39 40 45 public TabRule(String sTabName) { 46 super(); 47 this.m_sTabName = sTabName; 48 } 49 50 53 public boolean isEnabled(VirtualFile vfFile) { 54 boolean bEnabled = false; 55 56 if(vfFile!=null && vfFile.getFullPath().startsWith(this.m_sTabName)) { 57 bEnabled = true; 58 } 59 60 return this.m_bComparator==bEnabled; 61 } 62 63 70 public boolean isEnabled(String sTabName) { 71 boolean bEnabled = false; 72 73 if(sTabName.equals(this.m_sTabName)) { 74 bEnabled = true; 75 } 76 77 return this.m_bComparator==bEnabled; 78 } 79 80 83 public void setResultComparator(boolean bComparator) { 84 this.m_bComparator = bComparator; 85 } 86 87 } 88 | Popular Tags |