private void calculateEnabledState() { for (int i = 0, limit = Outliner.documents.openDocumentCount(); i < limit; i++) { Document doc = Outliner.documents.getDocument(i); if ((doc.isModified() || doc.getFileName().equals("")) && !PropertyContainerUtil.getPropertyAsBoolean( doc.getDocumentInfo(), DocumentInfo.KEY_IMPORTED)) { setEnabled(true); return; } } setEnabled(false); }