1 11 12 package org.eclipse.ui.internal.intro.impl.model; 13 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.osgi.framework.Bundle; 16 import org.w3c.dom.Element ; 17 18 19 31 public abstract class AbstractBaseIntroElement extends AbstractIntroIdElement { 32 33 protected static final String ATT_STYLE_ID = "style-id"; protected static final String ATT_FILTERED_FROM = "filteredFrom"; 36 protected String style_id; 37 protected String filteredFrom; 38 private boolean isFiltered; 39 40 AbstractBaseIntroElement(IConfigurationElement element) { 41 super(element); 42 style_id = element.getAttribute(ATT_STYLE_ID); 43 filteredFrom = element.getAttribute(ATT_FILTERED_FROM); 44 } 45 46 AbstractBaseIntroElement(Element element, Bundle bundle) { 47 super(element, bundle); 48 style_id = getAttribute(element, ATT_STYLE_ID); 49 filteredFrom = getAttribute(element, ATT_FILTERED_FROM); 50 } 51 52 56 private boolean checkFilterState() { 57 if (this.isOfType(AbstractIntroElement.MODEL_ROOT)) 58 return false; 60 IntroModelRoot root = (IntroModelRoot) getParentPage().getParent(); 61 return root.getPresentation().getImplementationKind().equals( 62 filteredFrom) ? true : false; 63 } 64 65 66 69 public String getStyleId() { 70 return style_id; 71 } 72 73 protected void loadFromParent() { 74 style_id = getAttribute(getElement(), ATT_STYLE_ID); 75 filteredFrom = getAttribute(getElement(), ATT_FILTERED_FROM); 76 } 77 78 81 public String getFilteredFrom() { 82 return filteredFrom; 83 } 84 85 93 public boolean isFiltered() { 94 return checkFilterState() || isFiltered; 95 } 96 97 public void setFilterState(boolean state) { 98 isFiltered = state; 99 } 100 101 102 103 } 104 | Popular Tags |