Skip to content

Commit

Permalink
Added limit to multiple edit
Browse files Browse the repository at this point in the history
  • Loading branch information
sleroux-keep committed Jan 2, 2017
1 parent 8f1053d commit e27947d
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/org/roda/rodain/inspection/InspectionPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ private void createTop() {
Tooltip.install(topBox, new Tooltip(I18n.help("tooltip.inspectionPanel")));
}
}

public void resetTop(){
createTop();
setTop(topBox);
}

private void createMetadata() {
metadata = new VBox();
Expand Down
20 changes: 19 additions & 1 deletion src/main/java/org/roda/rodain/schema/ui/SchemaPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,25 @@ public void changed(ObservableValue observable, TreeItem oldValue, TreeItem newV
sits.createAndUpdateFooter();
} else {
// more than one item is selected
RodaIn.getInspectionPane().update(selectedItems);
String multipleEditMax = AppProperties.getAppConfig("app.multipleEdit.max");
int multipleEditMaxInt = 100;
if(multipleEditMax!=null){
multipleEditMaxInt = Integer.parseInt(multipleEditMax);
}
if(selectedItems.size()<multipleEditMaxInt){
RodaIn.getInspectionPane().update(selectedItems);
}else{
RodaIn.getInspectionPane().resetTop();
RodaIn.getInspectionPane().setCenter(new HBox());
Alert dlg = new Alert(Alert.AlertType.WARNING);
dlg.initStyle(StageStyle.UNDECORATED);
dlg.setHeaderText(I18n.t("SchemaPane.tooManySelected.header"));
dlg.setTitle(I18n.t("SchemaPane.tooManySelected.title"));
dlg.setContentText(I18n.t("SchemaPane.tooManySelected.content"));
dlg.initModality(Modality.APPLICATION_MODAL);
dlg.initOwner(primaryStage);
dlg.show();
}
}
} else
Footer.setClassPlanStatus("");
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/properties/.app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# These files won't appear in the explorer and won't be included in the SIPs
app.ignoredFiles=Thumbs.db,\\.DS_Store,\\..*
app.helpEnabled=true
app.multipleEdit.max=100
lastClassificationScheme=
# Force a locale, using the JVM default locale if not defined here
# app.language = en
4 changes: 4 additions & 0 deletions src/main/resources/properties/lang.properties
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,7 @@ Main.helpPage=
errorValidatingMetadata = The file is not valid according to the schema.
ExportBox.title=4. Final step
SchemaPane.tooManySelected.header=Too many items selected
SchemaPane.tooManySelected.content=Multiple edition not available
SchemaPane.tooManySelected.title=Too many items selected
4 changes: 4 additions & 0 deletions src/main/resources/properties/lang_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,7 @@ errorValidatingMetadata = The file is not valid according to the schema.
ExportBox.title=4. Submission Packages
SchemaPane.tooManySelected.header=Too many items selected
SchemaPane.tooManySelected.content=Multiple edition not available
SchemaPane.tooManySelected.title=Too many items selected
3 changes: 3 additions & 0 deletions src/main/resources/properties/lang_es_CL.properties
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,6 @@ help - Ayuda
menu - Menú
Main.helpPage - Ayuda

SchemaPane.tooManySelected.header=Demasiados elementos seleccionados
SchemaPane.tooManySelected.content=Edición multipla no disponible
SchemaPane.tooManySelected.title=Demasiados elementos seleccionados
5 changes: 5 additions & 0 deletions src/main/resources/properties/lang_hu.properties
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,8 @@ CreationModalProcessing.errorMessagesStopped.content = Mivel a nagyszámú hiba
help = Segítség
menu = Menü
Main.helpPage = Segítség


SchemaPane.tooManySelected.header=Túl sok elem van kijelölve
SchemaPane.tooManySelected.content=Több kiadás nem elérhető
SchemaPane.tooManySelected.title=Túl sok elem van kijelölve
4 changes: 4 additions & 0 deletions src/main/resources/properties/lang_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,7 @@ Main.helpPage=Ajuda
errorValidatingMetadata = O ficheiro não é valido de acordo com o schema.

ExportBox.title=4. Pacotes de Submissão

SchemaPane.tooManySelected.header=Demasiados itens seleccionados
SchemaPane.tooManySelected.content=Edição múltipla não disponível
SchemaPane.tooManySelected.title=Demasiados itens seleccionados

0 comments on commit e27947d

Please sign in to comment.