/** * Allow DefaultListModel to work with subscript operators.<p> * <b>WARNING:</b> this operation does not replace the element at the * specified index, rather it inserts the element at that index, thus * increasing the size of of the model by 1. * * @param self a DefaultListModel * @param index an index * @param e the element to insert at the given index * @since 1.6.4 */ public static void putAt(DefaultListModel self, int index, Object e) { self.set(index, e); }
/** * Replaces the element at the specified position in this list with the * specified element. * * @param index index of element to replace * @param element element to be stored at the specified position * @throws ArrayIndexOutOfBoundsException */ @Override public Object set(int index, Object element) { if (!(element instanceof CheckBoxListItem)) { return ((CheckBoxListItem) super.set(index, new CheckBoxListItem( element))).getContent(); } else { return ((CheckBoxListItem) super.set(index, element)).getContent(); } }
@Override public void run() { podLM.set(index, element); }}); return null;//Meh.
private void setItem(ClassPathSupport.Item item, int index) { model.set(index, item); }
private void setItem(ClassPathSupport.Item item, int index) { model.set(index, item); }
/** * Allow DefaultListModel to work with subscript operators.<p> * <b>WARNING:</b> this operation does not replace the element at the * specified index, rather it inserts the element at that index, thus * increasing the size of of the model by 1. * * @param self a DefaultListModel * @param index an index * @param e the element to insert at the given index * @since 1.6.4 */ public static void putAt(DefaultListModel self, int index, Object e) { self.set(index, e); }
/** * Allow DefaultListModel to work with subscript operators.<p> * <b>WARNING:</b> this operation does not replace the element at the * specified index, rather it inserts the element at that index, thus * increasing the size of of the model by 1. * * @param self a DefaultListModel * @param index an index * @param e the element to insert at the given index * @since 1.6.4 */ public static void putAt(DefaultListModel self, int index, Object e) { self.set(index, e); }
/** * Allow DefaultListModel to work with subscript operators.<p> * <b>WARNING:</b> this operation does not replace the element at the * specified index, rather it inserts the element at that index, thus * increasing the size of of the model by 1. * * @param self a DefaultListModel * @param index an index * @param e the element to insert at the given index * @since 1.6.4 */ public static void putAt(DefaultListModel self, int index, Object e) { self.set(index, e); }
@Override public void mouseClicked (MouseEvent e) { int i = lUseIn.getSelectedIndex (); if (i < 0) return; String name = (String) lUseIn.getModel ().getElementAt (i); if (name.charAt (0) == '+') ((DefaultListModel) lUseIn.getModel ()).set (i, "-" + name.substring (1)); else ((DefaultListModel) lUseIn.getModel ()).set (i, "+" + name.substring (1)); fireChanged(); } });
@Override public void keyTyped (KeyEvent e) { if (e.getKeyChar () == KeyEvent.VK_SPACE) { int i = lUseIn.getSelectedIndex (); if (i < 0) return; String name = (String) lUseIn.getModel ().getElementAt (i); if (name.charAt (0) == '+') ((DefaultListModel) lUseIn.getModel ()).set (i, "-" + name.substring (1)); else ((DefaultListModel) lUseIn.getModel ()).set (i, "+" + name.substring (1)); fireChanged(); } } });
public void actionPerformed(ActionEvent ae) { String editedItem = itemField.getText(); if (isAddMode) { listModel.addElement(editedItem); } else { listModel.set(list.getSelectedIndex(), editedItem); } ItemEditor.this.dispose(); } });
public void actionPerformed(ActionEvent ae) { String editedItem = itemField.getText(); if (isAddMode) { listModel.addElement(editedItem); } else { listModel.set(list.getSelectedIndex(), editedItem); } ItemEditor.this.dispose(); } });
private void bSourceMoveUpActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bSourceMoveUpActionPerformed if (platform == null) return; final int row = lSourcePaths.getSelectedIndex(); if (row <= 0) return; final Object value1 = mSources.get(row - 1); final Object value2 = mSources.get(row); mSources.set(row - 1, value2); mSources.set(row, value1); lSourcePaths.setSelectedIndex(row - 1); refreshButtons(); }//GEN-LAST:event_bSourceMoveUpActionPerformed
private void bJavaDocMoveUpActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bJavaDocMoveUpActionPerformed if (platform == null) return; final int row = lJavaDocPaths.getSelectedIndex(); if (row <= 0) return; final Object value1 = mJavaDocs.get(row - 1); final Object value2 = mJavaDocs.get(row); mJavaDocs.set(row - 1, value2); mJavaDocs.set(row, value1); lJavaDocPaths.setSelectedIndex(row - 1); refreshButtons(); }//GEN-LAST:event_bJavaDocMoveUpActionPerformed
private void bJavaDocMoveDownActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bJavaDocMoveDownActionPerformed if (platform == null) return; final int row = lJavaDocPaths.getSelectedIndex(); if (row < 0 && row >= mJavaDocs.getSize() - 1) return; final Object value1 = mJavaDocs.get(row); final Object value2 = mJavaDocs.get(row + 1); mJavaDocs.set(row, value2); mJavaDocs.set(row + 1, value1); lJavaDocPaths.setSelectedIndex(row + 1); refreshButtons(); }//GEN-LAST:event_bJavaDocMoveDownActionPerformed
private void changeItem() { String selectedValue = list.getSelectedValue(); int selectedIndex = list.getSelectedIndex(); if (selectedIndex > -1) { String newValue = editor.showDialog( Language.getString("settings.listSelector.editEntry", title), selectedValue, info); newValue = format(newValue); if (newValue != null && !newValue.isEmpty()) { data.set(selectedIndex, newValue); } } }
private void bSourceMoveDownActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bSourceMoveDownActionPerformed if (platform == null) return; final int row = lSourcePaths.getSelectedIndex(); if (row < 0 && row >= mSources.getSize() - 1) return; final Object value1 = mSources.get(row); final Object value2 = mSources.get(row + 1); mSources.set(row, value2); mSources.set(row + 1, value1); lSourcePaths.setSelectedIndex(row + 1); refreshButtons(); }//GEN-LAST:event_bSourceMoveDownActionPerformed
/** * Modifies a given border and sets it to a new border */ public void setBorder(BorderProperty new_border, BorderProperty old_border) { int index = m_borders_model.indexOf(old_border); if (index >= 0) { m_borders_model.set(index, new_border); } updateBorderView(); }
@SuppressWarnings("unchecked") private void updateView() { IBeanExtensionDialogView<E> b = beanExtensionDialogs.get(current); b.setBean(bean, valueMap, false, false); cardPanel.removeAll(); cardPanel.add(getComponent(b), "toto"); //$NON-NLS-1$ cardPanel.revalidate(); cardPanel.repaint(); cardLayout.show(cardPanel, "toto"); dialog.setTitle(b.getTitle()); for (int i = 0; i < beanExtensionDialogListModel.getSize(); i++) { BeanExtensionDialogViewState<E> s = (BeanExtensionDialogViewState<E>) beanExtensionDialogListModel.getElementAt(i); s.state = current == i ? StateEnum.PROGRESS : (current > i ? StateEnum.DONE : StateEnum.NOT_DONE); beanExtensionDialogListModel.set(i, s); } b.openDialog(); }