1 19 20 package org.netbeans.modules.looks; 21 22 import org.netbeans.spi.looks.Look; 23 import org.netbeans.spi.looks.ProxyLook; 24 import org.netbeans.spi.looks.Selectors; 25 import org.openide.util.NbBundle; 26 27 41 public class FilterLook extends ProxyLook { 42 43 private long mask; 44 45 46 private Look delegate; 47 48 51 public FilterLook ( String name, Look delegate) { 52 this (name, delegate, ALL_METHODS); 53 } 54 55 59 public FilterLook ( String name, Look delegate, long mask) { 60 super( name, Selectors.singleton( delegate ) ); 61 this.delegate = delegate; 62 this.mask = mask; 63 } 64 65 67 public String getDisplayName () { 68 return NbBundle.getMessage (FilterLook.class, "LAB_Filter", delegate.getDisplayName ()); 69 } 70 71 87 protected final boolean delegateTo (long method, Look look, Object representedObject) { 88 return ( mask & method ) != 0; 89 } 90 91 93 97 protected final void setLookMask( long mask ) { 98 this.mask = mask; 99 } 100 101 104 protected final long getLookMask( ) { 105 return mask; 106 } 107 108 113 protected final long lookMask( long methods ) { 114 mask |= methods; 115 return mask; 116 } 117 118 123 protected final long lookUnmask( long methods ) { 124 mask &= ~methods; 125 return mask; 126 } 127 128 129 } 130 | Popular Tags |