use of java.awt.event.ItemListener in project knime-core by knime.
the class SleepNodeDialog method waitToTimePanel.
private void waitToTimePanel() {
m_waitToSpinnerModel = new SpinnerDateModel();
m_toSpinner = new JSpinner(m_waitToSpinnerModel);
m_toSpinner.setEditor(new JSpinner.DateEditor(m_toSpinner, "HH:mm:ss"));
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
m_waitToSpinnerModel.setValue(cal.getTime());
m_toRB = new JRadioButton("Wait to time:");
m_toRB.doClick();
m_toRB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (m_toRB.isSelected()) {
m_selection = 1;
}
m_toSpinner.setEnabled(m_toRB.isSelected());
}
});
}
use of java.awt.event.ItemListener in project intellij-plugins by JetBrains.
the class ComboBoxWithMoreOption method initItems.
public void initItems() {
addItems(this, myStartItems);
this.addItem(myMoreItem);
this.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED && myMoreItem.equals(getSelectedItem())) {
final Object prevItem = e.getItem();
ApplicationManager.getApplication().invokeLater(() -> {
if (getItemCount() != myStartItems.size() + myExtendedItems.size()) {
ComboBoxWithMoreOption.this.extend();
setSelectedItem(prevItem);
}
if (!ComboBoxWithMoreOption.this.isPopupVisible()) {
ComboBoxWithMoreOption.this.showPopup();
}
});
}
}
});
}
use of java.awt.event.ItemListener in project gephi by gephi.
the class UIExporterPDFPanel method initEvents.
private void initEvents() {
pageSizeCombo.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
Object selectedItem = pageSizeCombo.getSelectedItem();
if (selectedItem != customSizeString) {
PageSizeItem pageSize = (PageSizeItem) selectedItem;
setPageSize(pageSize);
}
}
});
widthTextField.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
updatePageSize();
}
});
heightTextField.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
updatePageSize();
}
});
unitLink.setAction(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
millimeter = !millimeter;
refreshUnit(true);
}
});
}
use of java.awt.event.ItemListener in project checkstyle by checkstyle.
the class Input0 method testMethod3.
//should give an ncss of 12
private void testMethod3() {
int a = 0;
switch(a) {
//falls through
case 1:
case 2:
System.identityHashCode("Hello");
break;
default:
break;
}
ItemListener lis = new ItemListener() {
//should give an ncss of 2
public void itemStateChanged(ItemEvent e) {
System.identityHashCode("Hello");
}
};
}
use of java.awt.event.ItemListener in project gephi by gephi.
the class DynamicRangePanel method setup.
public void setup(final DynamicRangeFilter filter) {
final BottomComponent bottomComponent = Lookup.getDefault().lookup(BottomComponent.class);
timelineButton.setText(bottomComponent.isVisible() ? CLOSE : OPEN);
timelineButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (!bottomComponent.isVisible()) {
bottomComponent.setVisible(true);
timelineButton.setText(CLOSE);
} else {
bottomComponent.setVisible(false);
timelineButton.setText(OPEN);
}
}
});
keepEmptyCheckbox.setSelected(filter.isKeepNull());
keepEmptyCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (!filter.isKeepNull() == keepEmptyCheckbox.isSelected()) {
filter.getProperties()[1].setValue(keepEmptyCheckbox.isSelected());
}
}
});
}
Aggregations