1 11 12 package org.eclipse.ui.internal.layout; 13 14 15 20 public class TrimDescriptor { 21 22 25 private IWindowTrim fTrim; 26 27 30 private SizeCache fCache; 31 32 35 private SizeCache fDockingHandle = null; 36 37 42 private int fAreaId; 43 44 52 public TrimDescriptor(IWindowTrim trim, int areaId) { 53 fTrim = trim; 54 fAreaId = areaId; 55 } 56 57 60 public SizeCache getCache() { 61 return fCache; 62 } 63 64 72 public void setCache(SizeCache c) { 73 fCache = c; 74 } 75 76 79 public IWindowTrim getTrim() { 80 return fTrim; 81 } 82 83 88 public SizeCache getDockingCache() { 89 return fDockingHandle; 90 } 91 92 97 public String getId() { 98 return fTrim.getId(); 99 } 100 101 106 public boolean isVisible() { 107 if (!fTrim.getControl().isDisposed()) { 108 return fTrim.getControl().isVisible(); 109 } 110 return false; 111 } 112 113 119 public void setDockingCache(SizeCache cache) { 120 fDockingHandle = cache; 121 } 122 123 129 public int getAreaId() { 130 return fAreaId; 131 } 132 133 140 public void setAreaId(int id) { 141 fAreaId = id; 142 } 143 144 147 public void flush() { 148 if (fCache != null) { 149 fCache.flush(); 150 } 151 if (fDockingHandle != null) { 152 fDockingHandle.flush(); 153 } 154 } 155 156 162 public void setVisible(boolean visible) { 163 if (fTrim.getControl() != null && !fTrim.getControl().isDisposed()) { 164 fTrim.getControl().setVisible(visible); 165 } 166 if (fDockingHandle != null && fDockingHandle.getControl() != null 167 && !fDockingHandle.getControl().isDisposed()) { 168 fDockingHandle.getControl().setVisible(visible); 169 } 170 } 171 } 172 | Popular Tags |