List of usage examples for javax.swing.event EventListenerList EventListenerList
EventListenerList
From source file:org.pentaho.reporting.designer.core.util.FormulaEditorPanel.java
/** * Creates a new <code>JPanel</code> with a double buffer and a flow layout. *///from ww w. j av a 2 s.c om public FormulaEditorPanel() { this.listenerList = new EventListenerList(); this.dataAttributeContext = new DefaultDataAttributeContext(); setLayout(new BorderLayout()); ellipsisButton = new EllipsisButton("..."); ellipsisButton.setDefaultCapable(false); ellipsisButton.setMargin(new Insets(0, 0, 0, 0)); ellipsisButton.addActionListener(new OpenFormulaEditorAction()); changeEventGenerator = new ValueChangeEventGenerator(); tagModel = new DefaultComboBoxModel(); tagModel.addListDataListener(changeEventGenerator); formulaBox = new JComboBox(tagModel); formulaBox.setEditable(true); formulaBox.addKeyListener(new KeyEventForwarder()); formulaField = new JTextField(); formulaField.getDocument().addDocumentListener(changeEventGenerator); formulaBox.addKeyListener(new KeyEventForwarder()); add(formulaField, BorderLayout.CENTER); add(ellipsisButton, BorderLayout.EAST); }
From source file:org.pentaho.reporting.designer.core.util.undo.UndoManager.java
public UndoManager() { undoListeners = new EventListenerList(); undos = new ArrayList<UndoRecord>(MAXIMUM_UNDO_SIZE); undoNames = new ArrayList<String>(MAXIMUM_UNDO_SIZE); }
From source file:org.pentaho.reporting.designer.extensions.pentaho.repository.model.RepositoryTreeModel.java
public RepositoryTreeModel() { this.listenerList = new EventListenerList(); this.filters = EMPTY_FILTER; this.showFoldersOnly = true; this.root = new RepositoryTreeRoot(); }
From source file:org.pentaho.reporting.libraries.designtime.swing.date.DateCellEditor.java
/** * Constructs a new <code>DatePickerParameterComponent</code>. *//* w ww.j a va 2s . com*/ public DateCellEditor(final Class dateType) { this.listeners = new EventListenerList(); this.dateType = dateType; if (this.dateType.isArray()) { this.dateType = this.dateType.getComponentType(); } setLayout(new BorderLayout()); dateField = new JFormattedTextField(); dateField.setColumns(20); dateField.setEditable(true); pickDateButton = new EllipsisButton(new PickDateListener()); add(dateField, BorderLayout.CENTER); add(pickDateButton, BorderLayout.EAST); }
From source file:org.pentaho.reporting.libraries.designtime.swing.date.TimeCellEditor.java
/** * Constructs a new <code>DatePickerParameterComponent</code>. *//* w w w . j av a 2s .c om*/ public TimeCellEditor(final Class dateType) { this.listeners = new EventListenerList(); this.dateType = dateType; if (this.dateType.isArray()) { this.dateType = this.dateType.getComponentType(); } dateField = new JTextField(); dateField.setColumns(20); final TextComponentEditHandler listener = new TextComponentEditHandler(dateField); dateField.getDocument().addDocumentListener(listener); dateField.addActionListener(listener); setLayout(new BorderLayout()); dateField.setEditable(true); add(dateField, BorderLayout.CENTER); setDateFormat(createDateFormat(DEFAULT_FORMAT, Locale.getDefault(), TimeZone.getDefault())); }
From source file:org.wings.SComponent.java
/** * Adds an event listener for the given event class * * @param type The class/type of events to listen to. * @param listener The listener itself.//w w w . j ava2 s.c o m */ protected final <T extends EventListener> void addEventListener(Class<T> type, T listener) { if (listeners == null) { listeners = new EventListenerList(); } listeners.add(type, listener); }
From source file:sk.stuba.fiit.kvasnicka.qsimsimulation.rule.SimulationRuleBean.java
/** * removes all delivery listeners/* ww w. jav a 2 s.c om*/ */ public void removeAllDeliveryListeners() { listenerList = new EventListenerList(); //listenerList cannot remove all listeners, so I simply create a new object instead... }