Search in sources :

Example 81 with ChangeEvent

use of javax.swing.event.ChangeEvent in project intellij-plugins by JetBrains.

the class JSCreateMethodDialog method createVisibilityPanel.

@Override
protected JPanel createVisibilityPanel() {
    JPanel visibilityPanel = super.createVisibilityPanel();
    if (myMethod.isConstructor()) {
        return visibilityPanel;
    }
    JPanel panel = new JPanel(new BorderLayout());
    panel.add(visibilityPanel, BorderLayout.NORTH);
    myStaticCb = new JCheckBox(JSBundle.message("declare.static"));
    myStaticCb.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(final ChangeEvent e) {
            updateSignature();
        }
    });
    panel.add(myStaticCb, BorderLayout.SOUTH);
    return panel;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 82 with ChangeEvent

use of javax.swing.event.ChangeEvent in project intellij-plugins by JetBrains.

the class DependenciesConfigurable method rebuildSdksModel.

private void rebuildSdksModel() {
    final JdkComboBox.JdkComboBoxItem selectedItem = mySdkCombo.getSelectedItem();
    JdkComboBox.NoneJdkComboBoxItem noneSdkItem = new JdkComboBox.NoneJdkComboBoxItem();
    myFreeze = true;
    try {
        mySdkCombo.reloadModel(noneSdkItem, myProject);
    } finally {
        myFreeze = false;
    }
    if (selectedItem instanceof JdkComboBox.NoneJdkComboBoxItem) {
        mySdkCombo.setSelectedItem(noneSdkItem);
    } else {
        String selectedSdkName = selectedItem.getSdkName();
        if (selectedSdkName != null) {
            Sdk sdk = mySkdsModel.findSdk(selectedSdkName);
            if (sdk != null) {
                mySdkCombo.setSelectedJdk(sdk);
            } else {
                mySdkCombo.setInvalidJdk(selectedSdkName);
            }
        } else {
            mySdkCombo.setSelectedItem(noneSdkItem);
        }
    }
    if (mySdkCombo.getSelectedJdk() != selectedItem.getJdk()) {
        updateOnSelectedSdkChange();
    }
    mySdkChangeDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) Sdk(com.intellij.openapi.projectRoots.Sdk) JdkComboBox(com.intellij.openapi.roots.ui.configuration.JdkComboBox)

Example 83 with ChangeEvent

use of javax.swing.event.ChangeEvent in project processdash by dtuma.

the class TeamTimePanel method applySubteamFilter.

public void applySubteamFilter(Set<Integer> subteamFilter, String subteamName) {
    this.teamMemberFilter = null;
    this.subteamFilter = subteamFilter;
    this.subteamName = subteamName;
    this.teamList.setSubteamFilter(subteamFilter);
    rebuildPanelContents();
    ChangeEvent evt = new ChangeEvent(this);
    for (ChangeListener l : listenerList.getListeners(ChangeListener.class)) l.stateChanged(evt);
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 84 with ChangeEvent

use of javax.swing.event.ChangeEvent in project processdash by dtuma.

the class AbstractEVChart method fireStateChanged.

protected void fireStateChanged() {
    if (changeListeners != null) {
        List<ChangeListener> listeners = new ArrayList<ChangeListener>(changeListeners);
        ChangeEvent evt = new ChangeEvent(this);
        for (ChangeListener l : listeners) l.stateChanged(evt);
    }
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) ChangeEvent(javax.swing.event.ChangeEvent) ArrayList(java.util.ArrayList) ChangeListener(javax.swing.event.ChangeListener) PropertyChangeListener(java.beans.PropertyChangeListener)

Example 85 with ChangeEvent

use of javax.swing.event.ChangeEvent in project processdash by dtuma.

the class TeamMemberColumnManager method createColumns.

/** Create or recreate TeamMemberTimeColumn objects for each team member
     */
private void createColumns() {
    List<TeamMemberTimeColumn> obsoletePlanTimeColumns = planTimeColumnList;
    List<TeamMemberActualTimeColumn> obsoleteActualTimeColumns = actualTimeColumnList;
    ArrayList newColumns = new ArrayList();
    planTimeColumnList = new ArrayList<TeamMemberTimeColumn>();
    actualTimeColumnList = new ArrayList<TeamMemberActualTimeColumn>();
    Iterator teamMembers = teamList.getTeamMembers().iterator();
    while (teamMembers.hasNext()) {
        // Loop through the list of team members.
        TeamMember m = (TeamMember) teamMembers.next();
        // try to find a preexisting planned time column for this team member.
        TeamMemberTimeColumn planTimeCol = getExistingValidTimeColumn(obsoletePlanTimeColumns, m);
        if (planTimeCol == null) {
            // create a new column for this team member.
            planTimeCol = new TeamMemberTimeColumn(dataModel, m);
            newColumns.add(planTimeCol);
        }
        // add the column to our master list.
        planTimeColumnList.add(planTimeCol);
        // try to find a preexisting actual time column for this team member.
        TeamMemberActualTimeColumn actualTimeCol = getExistingValidTimeColumn(obsoleteActualTimeColumns, m);
        if (actualTimeCol == null) {
            // create a new column for this team member.
            actualTimeCol = new TeamMemberActualTimeColumn(m);
            newColumns.add(actualTimeCol);
        }
        // add the column to our master list.
        actualTimeColumnList.add(actualTimeCol);
    }
    // make the changes to the columns in the data model.
    if (!newColumns.isEmpty() || !obsoletePlanTimeColumns.isEmpty() || !obsoleteActualTimeColumns.isEmpty()) {
        List obsoleteColumns = new ArrayList();
        obsoleteColumns.addAll(obsoletePlanTimeColumns);
        obsoleteColumns.addAll(obsoleteActualTimeColumns);
        dataModel.addRemoveDataColumns(newColumns, obsoleteColumns);
    }
    // alert any listeners that have registered interest
    ChangeEvent e = new ChangeEvent(this);
    for (ChangeListener l : listeners) l.stateChanged(e);
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) TeamMemberList(teamdash.team.TeamMemberList) ChangeListener(javax.swing.event.ChangeListener) TeamMember(teamdash.team.TeamMember)

Aggregations

ChangeEvent (javax.swing.event.ChangeEvent)245 ChangeListener (javax.swing.event.ChangeListener)206 JPanel (javax.swing.JPanel)60 ActionEvent (java.awt.event.ActionEvent)52 ActionListener (java.awt.event.ActionListener)47 JLabel (javax.swing.JLabel)40 Dimension (java.awt.Dimension)30 GridBagConstraints (java.awt.GridBagConstraints)27 GridBagLayout (java.awt.GridBagLayout)24 JCheckBox (javax.swing.JCheckBox)24 Insets (java.awt.Insets)22 JButton (javax.swing.JButton)21 JSlider (javax.swing.JSlider)21 PropertyChangeEvent (java.beans.PropertyChangeEvent)20 JSpinner (javax.swing.JSpinner)19 SpinnerNumberModel (javax.swing.SpinnerNumberModel)19 BorderLayout (java.awt.BorderLayout)18 PropertyChangeListener (java.beans.PropertyChangeListener)17 IOException (java.io.IOException)16 BoxLayout (javax.swing.BoxLayout)16