public static IDecorationContext getContext() { if (fgContext == null) { DecorationContext context= new DecorationContext(); context.putProperty(SynchronizationStateTester.PROP_TESTER, new HierarchicalSynchronizationStateTester()); fgContext= context; } return fgContext; }
/** * Tells the label decorator if the view presents packages flat or hierarchical. * @param enable If set, packages are presented in flat mode. */ public void setFlatPackageMode(boolean enable) { if (enable) { setDecorationContext(DecorationContext.DEFAULT_CONTEXT); } else { setDecorationContext(HierarchicalDecorationContext.getContext()); } }
/** Try to force a DecorationContext to accept the REPLACE decoration method */ private static void allowReplace(IDecorationContext context) { DecorationContext dcontext = (DecorationContext) context; Object propertyValue = dcontext.getProperty(IDecoration.ENABLE_REPLACE); boolean add = (propertyValue==null); if(!add) if(propertyValue instanceof Boolean) add = (!(Boolean)propertyValue); if(add) dcontext.putProperty(IDecoration.ENABLE_REPLACE, Boolean.TRUE); }
public TapestryDecoratingLabelProvider() { super(new LabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), DecorationContext.DEFAULT_CONTEXT); }
/** * Decorating label provider for Java. Combines a JavaUILabelProvider * (if enabled with problem indicator) with the workbench * decorator (label decorator extension point). * @param labelProvider the label provider to decorate * @param errorTick show error ticks * @param flatPackageMode configure flat package mode */ public DecoratingJavaLabelProvider(JavaUILabelProvider labelProvider, boolean errorTick, boolean flatPackageMode) { super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), DecorationContext.DEFAULT_CONTEXT); if (errorTick) { labelProvider.addLabelDecorator(new ProblemsLabelDecorator(null)); } setFlatPackageMode(flatPackageMode); }