use of de.catma.ui.dialog.SingleTextInputDialog in project catma by forTEXT.
the class ProjectView method handleCommitRequest.
private void handleCommitRequest() {
try {
if (project.hasUncommittedChanges()) {
SingleTextInputDialog dlg = new SingleTextInputDialog("Commit all changes", "Please enter a short description for this commit:", commitMsg -> {
try {
project.commitChanges(commitMsg);
Notification.show("Info", "Your changes have been committed!", Type.HUMANIZED_MESSAGE);
} catch (Exception e) {
errorHandler.showAndLogError("Error committing all changes!", e);
}
});
dlg.show();
} else {
Notification.show("Info", "There are no uncommitted changes!", Type.HUMANIZED_MESSAGE);
}
} catch (Exception e) {
errorHandler.showAndLogError("Error accessing Project!", e);
}
}
use of de.catma.ui.dialog.SingleTextInputDialog in project catma by forTEXT.
the class ProjectView method handleImportCollectionRequest.
private void handleImportCollectionRequest() {
try {
if (project.hasUncommittedChanges()) {
SingleTextInputDialog dlg = new SingleTextInputDialog("Commit all changes", "You have changes, that need to be committed first, please enter a short description for this commit:", commitMsg -> {
try {
project.commitChanges(commitMsg);
importCollection();
} catch (Exception e) {
setEnabled(true);
((ErrorHandler) UI.getCurrent()).showAndLogError("error committing changes", e);
}
});
dlg.show();
} else {
importCollection();
}
} catch (Exception e) {
errorHandler.showAndLogError("Error accessing Project!", e);
}
}
use of de.catma.ui.dialog.SingleTextInputDialog in project catma by forTEXT.
the class ProjectView method handleSynchronizeRequest.
private void handleSynchronizeRequest() {
try {
setEnabled(false);
if (project.hasUncommittedChanges()) {
SingleTextInputDialog dlg = new SingleTextInputDialog("Commit all changes", "You have uncommitted changes, please enter a short description for this commit:", commitMsg -> {
try {
project.commitChanges(commitMsg);
synchronizeProject();
} catch (Exception e) {
setEnabled(true);
((ErrorHandler) UI.getCurrent()).showAndLogError("error committing changes", e);
}
});
dlg.show();
} else {
synchronizeProject();
}
} catch (Exception e) {
errorHandler.showAndLogError("error accessing project", e);
}
}
use of de.catma.ui.dialog.SingleTextInputDialog in project catma by forTEXT.
the class TagSelectionPanel method handleAddTagsetRequest.
private void handleAddTagsetRequest() {
SingleTextInputDialog tagsetNameDlg = new SingleTextInputDialog("Add Tagset", "Please enter the Tagset name:", new SaveCancelListener<String>() {
@Override
public void savePressed(String result) {
IDGenerator idGenerator = new IDGenerator();
project.getTagManager().addTagsetDefinition(new TagsetDefinition(idGenerator.generateTagsetId(), result, new Version()));
}
});
tagsetNameDlg.show();
}
use of de.catma.ui.dialog.SingleTextInputDialog in project catma by forTEXT.
the class TagsView method handleAddTagsetRequest.
private void handleAddTagsetRequest() {
if (project.isAuthorizedOnProject(RBACPermission.TAGSET_CREATE_OR_UPLOAD)) {
SingleTextInputDialog tagsetNameDlg = new SingleTextInputDialog("Add Tagset", "Please enter the Tagset name:", new SaveCancelListener<String>() {
@Override
public void savePressed(String result) {
IDGenerator idGenerator = new IDGenerator();
project.getTagManager().addTagsetDefinition(new TagsetDefinition(idGenerator.generateTagsetId(), result, new Version()));
}
});
tagsetNameDlg.show();
} else {
Notification.show("Info", "You do not have the permission to create Tagsets! " + "Please contact the Project maintainer for changes!", Type.HUMANIZED_MESSAGE);
}
}
Aggregations