reload();
SimpleContainer c = new SimpleContainer(parent);
c.addInput(this.getError());
ButtonArea b = new ButtonArea();
b.addButton(i18n.tr("�bernehmen"), new Action()
{
public void handleAction(Object context) throws ApplicationException
{
Profile p = getProfile();
p.setFileEncoding((String)getFileEncoding().getValue());
p.setQuotingChar((String)getQuoteChar().getValue());
p.setSeparatorChar((String)getSeparatorChar().getValue());
p.setSkipLines(((Integer)getSkipLines().getValue()).intValue());
// Spalten noch zuordnen
List<Column> columns = new ArrayList<Column>();
for (int i=0;i<selects.size();++i)
{
SelectInput input = selects.get(i);
Column c = (Column) input.getValue();
if (c == null)
continue; // Spalte nicht zugeordnet
// Spalten konnen mehrfach zugeordnet werden.
// Daher verwenden wir einen Clone. Andernfalls wuerden
// wir nur die letzte Zuordnung speichern
try
{
c = (Column) c.clone();
}
catch (CloneNotSupportedException e) {/*dann halt nicht */}
// Spaltennummer speichern
c.setColumn(i);
columns.add(c);
}
p.setColumns(columns);
storeProfile(p);
close();
}
},null,false,"ok.png");
b.addButton(i18n.tr("Datei neu laden"), new Action()
{
public void handleAction(Object context) throws ApplicationException
{
Profile p = getProfile();
p.setFileEncoding((String)getFileEncoding().getValue());
p.setQuotingChar((String)getQuoteChar().getValue());
p.setSeparatorChar((String)getSeparatorChar().getValue());
p.setSkipLines(((Integer)getSkipLines().getValue()).intValue());
reload();
}
},null,false,"view-refresh.png");
b.addButton(i18n.tr("Abbrechen"), new Action()
{
public void handleAction(Object context) throws ApplicationException
{
throw new OperationCanceledException();
}