import("system.neon");
import("system.result");
import("Document_lib");

var openFileState;
if(DocumentUtil.canOpenSelectedDocument())
    openFileState = neon.COMPONENTSTATE_EDITABLE;
else
    openFileState = neon.COMPONENTSTATE_INVISIBLE;

result.string(openFileState);