You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.7 KiB
51 lines
1.7 KiB
package com.fanruan.cloud.s3.file.submit.s3cloud.ui; |
|
|
|
import com.fanruan.cloud.s3.file.submit.s3cloud.job.S3SubmitJob; |
|
import com.fr.design.beans.BasicBeanPane; |
|
import com.fanruan.api.design.ui.component.table.UITableEditorPane; |
|
import com.fanruan.cloud.s3.file.submit.s3cloud.fun.S3SubmitTarget; |
|
import com.fanruan.cloud.s3.file.submit.s3cloud.fun.S3SubmitTargetConfig; |
|
|
|
import java.awt.*; |
|
|
|
|
|
public class S3PathConfigPane extends BasicBeanPane<S3SubmitJob> { |
|
|
|
private UITableEditorPane<S3SubmitTarget> tableEditorPane; |
|
private S3SubmitPathTableModel model = new S3SubmitPathTableModel(); |
|
|
|
public S3PathConfigPane() { |
|
setLayout(new BorderLayout()); |
|
this.tableEditorPane = new UITableEditorPane<>(model); |
|
this.add(tableEditorPane, BorderLayout.CENTER); |
|
} |
|
|
|
@Override |
|
public void populateBean(S3SubmitJob job) { |
|
if (job != null) { |
|
S3SubmitTargetConfig submitTargetConfig = job.getSubmitTargetConfig(); |
|
if (submitTargetConfig != null) { |
|
S3SubmitTarget[] targets = submitTargetConfig.getSubmitTargets(); |
|
this.tableEditorPane.populate(targets); |
|
} |
|
} |
|
} |
|
|
|
@Override |
|
public S3SubmitJob updateBean() { |
|
S3SubmitJob submitJob = new S3SubmitJob(); |
|
S3SubmitTargetConfig submitTargetConfig = new S3SubmitTargetConfig(); |
|
java.util.List<S3SubmitTarget> targetList = tableEditorPane.update(); |
|
for (S3SubmitTarget target : targetList) { |
|
submitTargetConfig.addSubmitTarget(target); |
|
} |
|
model.clear(); |
|
submitJob.setSubmitTargetConfig(submitTargetConfig); |
|
return submitJob; |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return "Path"; |
|
} |
|
}
|
|
|