* start {i} row index binding with 1 instead of 0
This commit is contained in:
parent
daaf51622b
commit
d601634e13
|
@ -561,7 +561,7 @@ public class CmdlineOperations implements CmdlineInterface {
|
|||
Map<File, File> renameMap = new LinkedHashMap<File, File>();
|
||||
|
||||
for (Entry<File, Object> it : service.getMetaData(selection).entrySet()) {
|
||||
MediaBindingBean bindingBean = new MediaBindingBean(it.getValue(), it.getKey(), null);
|
||||
MediaBindingBean bindingBean = new MediaBindingBean(it.getValue(), it.getKey());
|
||||
|
||||
if (filter == null || filter.matches(bindingBean)) {
|
||||
String newName = (format != null) ? format.format(bindingBean) : validateFileName(it.getValue().toString());
|
||||
|
|
|
@ -64,6 +64,10 @@ public class MediaBindingBean {
|
|||
private MediaInfo mediaInfo;
|
||||
private Object metaInfo;
|
||||
|
||||
public MediaBindingBean(Object infoObject, File mediaFile) {
|
||||
this(infoObject, mediaFile, singletonMap(mediaFile, infoObject));
|
||||
}
|
||||
|
||||
public MediaBindingBean(Object infoObject, File mediaFile, Map<File, Object> context) {
|
||||
this.infoObject = infoObject;
|
||||
this.mediaFile = mediaFile;
|
||||
|
@ -756,7 +760,7 @@ public class MediaBindingBean {
|
|||
|
||||
@Define("i")
|
||||
public Integer getModelIndex() {
|
||||
return identityIndexOf(context.values(), getInfoObject());
|
||||
return 1 + identityIndexOf(context.values(), getInfoObject());
|
||||
}
|
||||
|
||||
@Define("di")
|
||||
|
|
|
@ -110,7 +110,7 @@ class BindingDialog extends JDialog {
|
|||
if (bindingModel.executor.isShutdown())
|
||||
return;
|
||||
|
||||
bindingModel.setModel(getSampleExpressions(), new MediaBindingBean(getInfoObject(), getMediaFile(), null));
|
||||
bindingModel.setModel(getSampleExpressions(), new MediaBindingBean(getInfoObject(), getMediaFile()));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.text.Format;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -447,7 +446,7 @@ public class FormatDialog extends JDialog {
|
|||
media = new File(path);
|
||||
}
|
||||
|
||||
return new MediaBindingBean(info, media, Collections.singletonMap(media, info));
|
||||
return new MediaBindingBean(info, media);
|
||||
}
|
||||
|
||||
private ExecutorService createExecutor() {
|
||||
|
@ -642,7 +641,7 @@ public class FormatDialog extends JDialog {
|
|||
File file = dialog.getMediaFile();
|
||||
|
||||
// change sample
|
||||
sample = new MediaBindingBean(info, file, Collections.singletonMap(file, info));
|
||||
sample = new MediaBindingBean(info, file);
|
||||
|
||||
// remember sample
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue