Java Code Examples for javax.swing.ComboBoxModel#getSelectedItem()

The following examples show how to use javax.swing.ComboBoxModel#getSelectedItem() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EntityClassesPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updatePackageComboBox() {
    SourceGroup sourceGroup = (SourceGroup)locationComboBox.getSelectedItem();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 2
Source File: DBScriptPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updatePackageComboBox() {
    SourceGroup sourceGroup = (SourceGroup) locationComboBox.getSelectedItem();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem() != null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 3
Source File: JpaControllerSetupPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup)locationComboBox.getSelectedItem();
    ComboBoxModel model = PackageView.createListView(sourceGroup);
    if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF")
            && model.getSize() > 1) { // NOI18N
        model.setSelectedItem(model.getElementAt(1));
    }
    packageComboBox.setModel(model);
}
 
Example 4
Source File: JaxRsConfigurationPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sg = getSourceGroup();
    if (sg != null) {
        ComboBoxModel model = PackageView.createListView(sg);
        if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        String oldValue = ((JTextComponent)restAppPackage.getEditor().getEditorComponent()).getText();
        restAppPackage.setModel(model);
        if (oldValue.length() > 0) {
            ((JTextComponent)restAppPackage.getEditor().getEditorComponent()).setText(oldValue);
        }
    }
}
 
Example 5
Source File: ContainerItemSetupPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup)locationComboBox.getSelectedItem();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 6
Source File: SingletonSetupPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = getSourceGroup();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem() != null && model.getSelectedItem().toString().startsWith("META-INF") && model.getSize() > 1) { // NOI18N

            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 7
Source File: PersistenceClientSetupPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup)locationComboBox.getSelectedItem();
    JComboBox[] combos = {jpaPackageComboBox, jsfPackageComboBox};
    for (JComboBox combo : combos) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        combo.setModel(model);
    }
}
 
Example 8
Source File: EjbFacadeVisualPanel2.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup)locationComboBox.getSelectedItem();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem()!= null && model.getSelectedItem().toString().startsWith("META-INF") //NOI18N
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 9
Source File: EntityClassesConfigurationPanel.java    From jeddict with Apache License 2.0 5 votes vote down vote up
private void updatePackageComboBox() {
    SourceGroup sourceGroup = (SourceGroup) locationComboBox.getSelectedItem();
    if (sourceGroup != null) {
        ComboBoxModel model = PackageView.createListView(sourceGroup);
        if (model.getSelectedItem() != null && model.getSelectedItem().toString().startsWith("META-INF")
                && model.getSize() > 1) { // NOI18N
            model.setSelectedItem(model.getElementAt(1));
        }
        packageComboBox.setModel(model);
    }
}
 
Example 10
Source File: ClassSetupPanelVisual.java    From jeddict with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup) locationComboBox.getSelectedItem();
    ComboBoxModel model = PackageView.createListView(sourceGroup);
    if (model.getSelectedItem() != null && model.getSelectedItem().toString().startsWith("META-INF")
            && model.getSize() > 1) { // NOI18N
        model.setSelectedItem(model.getElementAt(1));
    }
    packageComboBox.setModel(model);
}
 
Example 11
Source File: DocSetupPanelVisual.java    From jeddict with Apache License 2.0 5 votes vote down vote up
private void updateSourceGroupPackages() {
    SourceGroup sourceGroup = (SourceGroup) locationComboBox.getSelectedItem();
    ComboBoxModel model = PackageView.createListView(sourceGroup);
    if (model.getSelectedItem() != null && model.getSelectedItem().toString().startsWith("META-INF")
            && model.getSize() > 1) { // NOI18N
        model.setSelectedItem(model.getElementAt(1));
    }
    packageComboBox.setModel(model);
}