@Override
public IContributionItem create(final IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
CommandContributionItemParameter parameter = new CommandContributionItemParameter(
window,
COMMAND_ID,
COMMAND_ID,
null,
WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR),
WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR_DISABLED),
null, null, null, WorkbenchMessages.PinEditorAction_toolTip,
CommandContributionItem.STYLE_CHECK, null, false);
final CommandContributionItem action = new CommandContributionItem(parameter);
action.setVisible(WorkbenchPlugin.getDefault().getPreferenceStore()
.getBoolean(IPreferenceConstants.REUSE_EDITORS_BOOLEAN));
return action;
}
};