private void unhookCheckListener() { if (model.getType() != ItemType.CHECK) { return; } final Object obj = model.getTransientData().remove(DISPOSABLE_CHECK); if (obj == null) { return; } ((Runnable) obj).run(); }
private void unhookCheckListener() { if (getModel().getType() != ItemType.CHECK) { return; } final Object obj = getModel().getTransientData().remove(DISPOSABLE); if (obj == null) { return; } ((Runnable) obj).run(); }
private void handleWidgetSelection(Event event) { if (widget != null && !widget.isDisposed()) { if (dropdownEvent(event)) { return; } if (model.getType() == ItemType.CHECK || model.getType() == ItemType.RADIO) { boolean selection = false; if (widget instanceof MenuItem) { selection = ((MenuItem) widget).getSelection(); } else if (widget instanceof ToolItem) { selection = ((ToolItem) widget).getSelection(); } model.setSelected(selection); } if (canExecuteItem(event)) { executeItem(event); } } }
private void hookCheckListener() { if (model.getType() != ItemType.CHECK) { return; } Object obj = model.getTransientData().get(ItemType.CHECK.toString()); if (obj instanceof IContextFunction) { IEclipseContext context = getContext(model); IEclipseContext staticContext = getStaticContext(null); staticContext.set(MPart.class, context.get(MPart.class)); staticContext.set(WW_SUPPORT, context.get(WW_SUPPORT)); IContextFunction func = (IContextFunction) obj; obj = func.compute(staticContext, null); if (obj != null) { model.getTransientData().put(DISPOSABLE_CHECK, obj); } } }
private void hookCheckListener() { if (getModel().getType() != ItemType.CHECK) { return; } Object obj = getModel().getTransientData().get(ItemType.CHECK.toString()); if (obj instanceof IContextFunction) { IEclipseContext context = getContext(getModel()); IEclipseContext staticContext = getStaticContext(null); staticContext.set(MPart.class, context.get(MPart.class)); staticContext.set(WW_SUPPORT, context.get(WW_SUPPORT)); IContextFunction func = (IContextFunction) obj; obj = func.compute(staticContext, null); if (obj != null) { getModel().getTransientData().put(DISPOSABLE, obj); } } }