use of org.jabref.model.database.DatabaseLocation in project jabref by JabRef.
the class DatabasePropertiesDialog method updateEnableStatus.
public void updateEnableStatus() {
DatabaseLocation location = panel.getBibDatabaseContext().getLocation();
boolean isShared = (location == DatabaseLocation.SHARED);
// the encoding of shared database is always UTF-8
encoding.setEnabled(!isShared);
saveInOriginalOrder.setEnabled(!isShared);
saveInSpecifiedOrder.setEnabled(!isShared);
saveOrderPanel.setEnabled(!isShared);
protect.setEnabled(!isShared);
}
use of org.jabref.model.database.DatabaseLocation in project jabref by JabRef.
the class BasePanel method getTabTitle.
public String getTabTitle() {
StringBuilder title = new StringBuilder();
DatabaseLocation databaseLocation = this.bibDatabaseContext.getLocation();
boolean isAutosaveEnabled = Globals.prefs.getBoolean(JabRefPreferences.LOCAL_AUTO_SAVE);
if (databaseLocation == DatabaseLocation.LOCAL) {
if (this.bibDatabaseContext.getDatabaseFile().isPresent()) {
// check if file is modified
String changeFlag = isModified() && !isAutosaveEnabled ? "*" : "";
title.append(this.bibDatabaseContext.getDatabaseFile().get().getName()).append(changeFlag);
} else {
title.append(GUIGlobals.UNTITLED_TITLE);
if (getDatabase().hasEntries()) {
// if the database is not empty and no file is assigned,
// the database came from an import and has to be treated somehow
// -> mark as changed
// This also happens internally at basepanel to ensure consistency line 224
title.append('*');
}
}
} else if (databaseLocation == DatabaseLocation.SHARED) {
title.append(this.bibDatabaseContext.getDBMSSynchronizer().getDBName() + " [" + Localization.lang("shared") + "]");
}
return title.toString();
}
Aggregations