1 11 12 package org.eclipse.ui.internal; 13 14 import org.eclipse.core.expressions.PropertyTester; 15 16 22 public class WorkbenchWindowPropertyTester extends PropertyTester { 23 24 private static final String PROPERTY_IS_COOLBAR_VISIBLE = "isCoolbarVisible"; private static final String PROPERTY_IS_PERSPECTIVEBAR_VISIBLE = "isPerspectiveBarVisible"; 27 33 public boolean test(Object receiver, String property, Object [] args, 34 Object expectedValue) { 35 36 if (args.length == 0 && receiver instanceof WorkbenchWindow) { 37 boolean defaultExpectedValue = true; 38 if (expectedValue != null) { 39 if (expectedValue instanceof Boolean ) 40 defaultExpectedValue = ((Boolean ) expectedValue).booleanValue(); 41 else 42 return false; } 44 final WorkbenchWindow window = (WorkbenchWindow) receiver; 45 if (PROPERTY_IS_COOLBAR_VISIBLE.equals(property)) { 46 return defaultExpectedValue == window.getCoolBarVisible(); 47 } else if (PROPERTY_IS_PERSPECTIVEBAR_VISIBLE.equals(property)) { 48 return defaultExpectedValue == window.getPerspectiveBarVisible(); 49 } 50 } 51 return false; 52 } 53 } 54 | Popular Tags |