}
private void initReaderToolbar(JToolBar toolBar) {
final ImageIcon autoOff = createIcon(12);
final ImageIcon autoOn = createIcon(13);
final StartStopButton autoModeB = new StartStopButton() {
@Override
public void initialize() {
doOnAction();
}
@Override
public void actionOn() {
geco.siHandler().setRequestHandler(geco.autoMergeHandler());
setIcon(autoOn);
setToolTipText(Messages.uiGet("GecoWindow.AutoMergeTooltip")); //$NON-NLS-1$
}
@Override
public void actionOff() {
geco.siHandler().setRequestHandler(geco.defaultMergeHandler());
setIcon(autoOff);
setToolTipText(Messages.uiGet("GecoWindow.ManualMergeTooltip")); //$NON-NLS-1$
}
};
toolBar.add(autoModeB);
final ImageIcon splitOff = createIcon(10);
final ImageIcon splitOn = createIcon(11);
final StartStopButton autoSplitB = new StartStopButton() {
@Override
public void initialize() {
setToolTipText(Messages.uiGet("GecoWindow.AutoprintTooltip")); //$NON-NLS-1$
doOffAction();
}
@Override
public void actionOn() {
setIcon(splitOn);
geco.splitPrinter().enableAutoprint();
}
@Override
public void actionOff() {
geco.splitPrinter().disableAutoprint();
setIcon(splitOff);
}
};
toolBar.add(autoSplitB);
final ImageIcon startIcon = createIcon(5);
final ImageIcon stopIcon = createIcon(6);
startB = new StartStopButton() {
@Override
public void initialize() {
setSelected(false);
setText(Messages.uiGet("GecoWindow.StartReaderButton")); //$NON-NLS-1$
setIcon(startIcon);
}
@Override
public void actionOn() {
if( ! autoSplitB.isSelected() ) {
int confirm = JOptionPane.showConfirmDialog(
GecoWindow.this,
Messages.uiGet("GecoWindow.AutoprintConfirm1"), //$NON-NLS-1$
Messages.uiGet("GecoWindow.AutoprintConfirm2"), //$NON-NLS-1$
JOptionPane.YES_NO_OPTION);
if( confirm==JOptionPane.YES_OPTION ) {
autoSplitB.doOnAction();
}
}
geco.siHandler().start();
setText(Messages.uiGet("GecoWindow.StartingButton")); //$NON-NLS-1$
setIcon(stopIcon);