CompileType compileType = getCompilerSettings(object.getProject()).getCompileType();
compilerManager.compileObject(object, contentType, compileType, false);
}
public void update(AnActionEvent e) {
Presentation presentation = e.getPresentation();
CompilerSettings compilerSettings = getCompilerSettings(object.getProject());
CompileType compileType = compilerSettings.getCompileType();
DBObjectStatusHolder status = object.getStatus();
boolean isDebug = compileType == CompileType.DEBUG;
if (compileType == CompileType.KEEP) {
isDebug = status.is(contentType, DBObjectStatus.DEBUG);
}
boolean isPresent = status.is(contentType, DBObjectStatus.PRESENT);
boolean isValid = status.is(contentType, DBObjectStatus.VALID);
//boolean isDebug = status.is(contentType, DBObjectStatus.DEBUG);
boolean isCompiling = status.is(contentType, DBObjectStatus.COMPILING);
boolean isEnabled = isPresent && !isCompiling && (compilerSettings.alwaysShowCompilerControls() || !isValid/* || isDebug != isDebugActive*/);
presentation.setEnabled(isEnabled);
String text =
contentType == DBContentType.CODE_SPEC ? "Compile spec" :
contentType == DBContentType.CODE_BODY ? "Compile body" : "Compile";
if (isDebug) text = text + " (Debug)";
if (compileType == CompileType.ASK) text = text + "...";
presentation.setText(text);
}