private void recalculateDisplay() { String object_data; String[] page_data; String data; int datasize; object_data = cObject.getSelectedItem(); datasize = clJumpto.getDataSize(); page_data = new String[datasize]; for (int i = 0; i < datasize; i++) { data = ((pageEntry) clJumpto.retrieveEntry(i)).getValue(); page_data[i] = clJumpto.getPageString(transf.createInt(data, null)); } setValuesToObjects(); cObject.select(0); cObject.select(object_data); for (int i = 0; i < datasize; i++) { clJumpto.selectPage(0); clJumpto.selectPage(page_data[i]); ((pageEntry) clJumpto.retrieveEntry(i)) .setValue(String.valueOf(clJumpto.getSelectedPageIndex())); } clJumpto.displayEntry(clJumpto.getSelected()); }
public wPanel getCreatorPanel() { wPanel p; wButton update; p = new wPanel(); p.setLayout(new WizardLayout()); cObject = new LabeledChoice("Object to use for interactive input"); clJumpto = new ChoiceList("Select the page to jump to, when the #th option is selected...", false); update = new wButton(" Update Interactive data "); cObject.add("None - don't use interactivity"); clJumpto.insertPage(" Next Page ", 0); setValuesToObjects(); cObject.select((linkObject == -1) ? 0 : linkObject); for (int i = 0; i < links.size(); i++) { clJumpto.addEntry(i, new pageEntry((String) links.elementAt(i))); } clJumpto.deleteEntry( links.size()); // by default, DoubleList has an entry already (now the last one) clJumpto.displayEntry(0); p.add(cObject); p.add(clJumpto); p.add(update); update.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ev) { recalculateDisplay(); } }); return p; }