yaoh.wu
7 years ago
5 changed files with 180 additions and 108 deletions
@ -1,45 +1,45 @@ |
|||||||
package com.fr.design.dscolumn; |
package com.fr.design.dscolumn; |
||||||
|
|
||||||
import java.awt.Dimension; |
|
||||||
import java.awt.event.ItemEvent; |
|
||||||
import java.awt.event.ItemListener; |
|
||||||
import java.util.Iterator; |
|
||||||
|
|
||||||
import com.fr.data.TableDataSource; |
import com.fr.data.TableDataSource; |
||||||
import com.fr.design.data.datapane.TableDataComboBox; |
import com.fr.design.data.datapane.TableDataComboBox; |
||||||
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; |
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper; |
||||||
import com.fr.main.impl.WorkBook; |
import com.fr.main.impl.WorkBook; |
||||||
import com.fr.report.cell.TemplateCellElement; |
import com.fr.report.cell.TemplateCellElement; |
||||||
|
|
||||||
|
import java.awt.*; |
||||||
|
import java.awt.event.ItemEvent; |
||||||
|
import java.awt.event.ItemListener; |
||||||
|
import java.util.Iterator; |
||||||
|
|
||||||
public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane { |
public class SelectedConfirmedDataColumnPane extends SelectedDataColumnPane { |
||||||
|
|
||||||
public SelectedConfirmedDataColumnPane () { |
public SelectedConfirmedDataColumnPane() { |
||||||
super(false); |
super(false, false); |
||||||
} |
} |
||||||
|
|
||||||
protected void initTableNameComboBox() { |
protected void initTableNameComboBox() { |
||||||
tableNameComboBox = new TableDataComboBox(new WorkBook()); |
tableNameComboBox = new TableDataComboBox(new WorkBook()); |
||||||
tableNameComboBox.addItemListener(new ItemListener() { |
tableNameComboBox.addItemListener(new ItemListener() { |
||||||
@Override |
@Override |
||||||
public void itemStateChanged(ItemEvent e) { |
public void itemStateChanged(ItemEvent e) { |
||||||
columnNameComboBox.setLoaded(false); |
columnNameComboBox.setLoaded(false); |
||||||
} |
} |
||||||
}); |
}); |
||||||
tableNameComboBox.setPreferredSize(new Dimension(100, 20)); |
tableNameComboBox.setPreferredSize(new Dimension(100, 20)); |
||||||
} |
} |
||||||
|
|
||||||
public void populate(TableDataSource source, TemplateCellElement cell) { |
public void populate(TableDataSource source, TemplateCellElement cell) { |
||||||
tableNameComboBox.refresh(source); |
tableNameComboBox.refresh(source); |
||||||
tableNameComboBox.setEditable(false); |
tableNameComboBox.setEditable(false); |
||||||
tableNameComboBox.setEnabled(false); |
tableNameComboBox.setEnabled(false); |
||||||
super.populate(source, cell); |
super.populate(source, cell); |
||||||
try { |
try { |
||||||
Iterator it = source.getTableDataNameIterator(); |
Iterator it = source.getTableDataNameIterator(); |
||||||
String name = (String)it.next(); |
String name = (String) it.next(); |
||||||
TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name); |
TemplateTableDataWrapper wrapper = new TemplateTableDataWrapper(source.getTableData(name), name); |
||||||
tableNameComboBox.setSelectedItem(wrapper); |
tableNameComboBox.setSelectedItem(wrapper); |
||||||
tableNameComboBox.getModel().setSelectedItem(wrapper); |
tableNameComboBox.getModel().setSelectedItem(wrapper); |
||||||
} catch (Exception e) { |
} catch (Exception e) { |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
Loading…
Reference in new issue