public boolean update(final IdeAction action, final Context context) { final Element doc = context.getElement(); final View view = context.getView(); // RelativeDirectoryContextFolder -> a package if (doc instanceof Project || doc instanceof JavaSourceNode || doc instanceof RelativeDirectoryContextFolder || view instanceof CodeEditor) { action.setEnabled(true); // TODO CPD // contextMenu.add(contextMenu.createMenuItem(cpdAction)); } else { action.setEnabled(false); } return true; }
public boolean update(IdeAction action, Context context) { int cmdId = action.getCommandId(); if (cmdId == DTD_TO_SCHEMA_CMD_ID) { action.setEnabled(enableDTD2Schema(context)); return true; } return false; }