public void enter() {
    Blackboard Identificadores = app.getBlackboard();
    ID_Inmueble = Integer.parseInt(Identificadores.get("IdInmueble").toString());

    // Mostramos los datos para el inmueble
    PatrimonioPostgre General = new PatrimonioPostgre();
    ArrayList Datos = General.DatosRegistro(ID_Inmueble);
    if (Datos == null) return;
    Iterator alIt = Datos.iterator();
    Iterator itControles = Registro.iterator();
    while (itControles.hasNext()) {
      try {
        JComponent comp = (JComponent) itControles.next();
        Object obj = alIt.next();
        if (comp instanceof JTextField)
          ((JTextField) comp).setText((obj != null) ? obj.toString() : "");
        if (comp instanceof JCheckBox) {
          String check = (obj != null) ? obj.toString() : "";
          if (check == "TRUE") {
            ((JCheckBox) comp).setSelected(true);
          } else {
            ((JCheckBox) comp).setSelected(false);
          }
        }
        if (comp instanceof JComboBox)
          ((JComboBox) comp).setSelectedItem((obj != null) ? obj.toString() : "");
      } catch (Exception A) {
        A.printStackTrace();
      }
    }
  }
 private JCheckBox buildOnDatabaseCheckBox() {
   JCheckBox checkBox = new JCheckBox();
   checkBox.setModel(buildOnDatabaseCheckBoxModel());
   checkBox.setText(resourceRepository().getString("onDatabase"));
   checkBox.setMnemonic(resourceRepository().getMnemonic("onDatabase"));
   return checkBox;
 }
Exemple #3
0
 /**
  * The ActionListener implementation
  *
  * @param event the event.
  */
 public void actionPerformed(ActionEvent event) {
   String searchText = textField.getText().trim();
   if (searchText.equals("") && !saveAs.isSelected() && (fileLength > 10000000)) {
     textPane.setText("Blank search text is not allowed for large IdTables.");
   } else {
     File outputFile = null;
     if (saveAs.isSelected()) {
       outputFile = chooser.getSelectedFile();
       if (outputFile != null) {
         String name = outputFile.getName();
         int k = name.lastIndexOf(".");
         if (k != -1) name = name.substring(0, k);
         name += ".txt";
         File parent = outputFile.getAbsoluteFile().getParentFile();
         outputFile = new File(parent, name);
         chooser.setSelectedFile(outputFile);
       }
       if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) System.exit(0);
       outputFile = chooser.getSelectedFile();
     }
     textPane.setText("");
     Searcher searcher = new Searcher(searchText, event.getSource().equals(searchPHI), outputFile);
     searcher.start();
   }
 }
  public void saveSettings() {
    datPath = path0.getText();
    dirPath = path1.getText();
    libPath = path2.getText();
    top = (Integer) spin.getValue();
    location = loc.getSelectedIndex();
    every = all.isSelected();
    filesys = choice.getSelectedIndex();
    rec = choice2.getSelectedIndex();

    config.setDatabasePath(datPath);
    config.setMusicLibraryPath(dirPath);
    config.setItunesLibraryPath(libPath);
    config.setTopArtists(top + "");
    config.setTopArtists(location + "");
    config.setScanFile(filesys + "");
    config.setScanRec(rec + "");

    if (every) config.setAllEvents("true");
    else config.setAllEvents("false");

    config.setEmailEnabled(emailNotificationEnabled.isSelected());
    config.setEmailAddress(usernameField.getText());
    config.setEmailPass(passwordField.getText());

    config.writePreferences();
  }
  public AboutPanel() {
    setTitle("About Panel");
    ImageIcon img = new ImageIcon("icons/preferences.jpg");
    setIconImage(img.getImage());
    Container contentPane = getContentPane();
    contentPane.setLayout(new MigLayout());

    setBackground(Color.GRAY);

    int style1 = Font.CENTER_BASELINE;
    Font font = new Font("Arial", style1, 13);

    about = new JLabel();
    about.setFont(font);
    String key = userPrefs.getRegistrationKey();
    if (key == null || key.length() == 0) {
      userPrefs.setRegistrationKey("Community Edition");
    }
    about.setText("<html>WattzAp Community Edition<br/><br/>Version 2.5.1<br/>19th August 2015");
    add(about, "alignx right, span");

    debug = new JCheckBox("Enable Debugging");
    if (userPrefs.isDebug()) {
      debug.setSelected(true);
    } else {
      debug.setSelected(false);
    }
    debug.addActionListener(this);
    add(debug);

    Dimension d = new Dimension(550, 300);
    this.setPreferredSize(d);
    pack();
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  }
 /*
  * Checks if the preferences have changed from the cached preferences.
  */
 private boolean prefsChanged() {
   return (prefs.getResolution() != resolution.getSelectedItem())
       || (prefs.getFullscreen() != fullscreen.isSelected())
       || (prefs.getBitrate() != bitrate.getValue())
       || (prefs.getUseOpenGlRenderer() != openGlRenderer.isSelected())
       || (prefs.getLocalAudio() != localAudio.isSelected());
 }
 @Override
 public void reset() {
   VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject);
   myHighlightRecentlyChanged.setSelected(settings.isShow());
   myHighlightInterval.setValue(settings.getLimitDays());
   myHighlightInterval.setEnabled(myHighlightRecentlyChanged.isSelected());
 }
  // counts up the score of the user.
  @SuppressWarnings("unchecked")
  public int scoreCounter() {
    if (b1.isSelected()) {
      score1++;
    } else if (c1.isSelected()) {
      score1++;
    } else if (d1.isSelected()) {
      score1++;
    } else if (e1.isSelected()) {
      score1++;
    } else if (f1.isSelected()) {
      score1++;
    } else if (g1.isSelected()) {
      score1++;
    } else if (h1.isSelected()) {
      score1++;
    } else if (i1.isSelected()) {
      score1++;
    } else if (j1.isSelected()) {
      score1++;
    } else if (k1.isSelected()) {
      score1++;
    }

    System.out.println(score1);

    return score1;
  }
  @Override
  public void apply(@NotNull HttpConfigurable settings) {
    if (!isValid()) {
      return;
    }

    if (isModified(settings)) {
      settings.AUTHENTICATION_CANCELLED = false;
    }

    settings.USE_PROXY_PAC = myAutoDetectProxyRb.isSelected();
    settings.USE_PAC_URL = myPacUrlCheckBox.isSelected();
    settings.PAC_URL = getText(myPacUrlTextField);
    settings.USE_HTTP_PROXY = myUseHTTPProxyRb.isSelected();
    settings.PROXY_TYPE_IS_SOCKS = mySocks.isSelected();
    settings.PROXY_AUTHENTICATION = myProxyAuthCheckBox.isSelected();
    settings.KEEP_PROXY_PASSWORD = myRememberProxyPasswordCheckBox.isSelected();

    settings.setProxyLogin(getText(myProxyLoginTextField));
    settings.setPlainProxyPassword(new String(myProxyPasswordTextField.getPassword()));
    settings.PROXY_EXCEPTIONS = StringUtil.nullize(myProxyExceptions.getText(), true);

    settings.PROXY_PORT = myProxyPortTextField.getNumber();
    settings.PROXY_HOST = getText(myProxyHostTextField);
  }
  @Override
  public void reset(@NotNull HttpConfigurable settings) {
    myNoProxyRb.setSelected(true); // default
    myAutoDetectProxyRb.setSelected(settings.USE_PROXY_PAC);
    myPacUrlCheckBox.setSelected(settings.USE_PAC_URL);
    myPacUrlTextField.setText(settings.PAC_URL);
    myUseHTTPProxyRb.setSelected(settings.USE_HTTP_PROXY);
    myProxyAuthCheckBox.setSelected(settings.PROXY_AUTHENTICATION);

    enableProxy(settings.USE_HTTP_PROXY);

    myProxyLoginTextField.setText(settings.getProxyLogin());
    myProxyPasswordTextField.setText(settings.getPlainProxyPassword());

    myProxyPortTextField.setNumber(settings.PROXY_PORT);
    myProxyHostTextField.setText(settings.PROXY_HOST);
    myProxyExceptions.setText(StringUtil.notNullize(settings.PROXY_EXCEPTIONS));

    myRememberProxyPasswordCheckBox.setSelected(settings.KEEP_PROXY_PASSWORD);
    mySocks.setSelected(settings.PROXY_TYPE_IS_SOCKS);
    myHTTP.setSelected(!settings.PROXY_TYPE_IS_SOCKS);

    boolean showError = !StringUtil.isEmptyOrSpaces(settings.LAST_ERROR);
    myErrorLabel.setVisible(showError);
    myErrorLabel.setText(showError ? errorText(settings.LAST_ERROR) : null);

    final String oldStyleText =
        CommonProxy.getMessageFromProps(CommonProxy.getOldStyleProperties());
    myOtherWarning.setVisible(oldStyleText != null);
    if (oldStyleText != null) {
      myOtherWarning.setText(oldStyleText);
      myOtherWarning.setIcon(Messages.getWarningIcon());
    }
  }
  public ModifySuperclassDialog(
      NCIEditTab tab, String name, RDFSClass aClass, boolean defining, boolean definingEditable) {
    super((JFrame) tab.getTopLevelAncestor(), "Modify Named Superclass", true);
    this.tab = tab;
    this.owlModel = tab.getOWLModel();
    this.defining = defining;
    this.defining_prev = defining;

    this.aClass = aClass;

    this.name = name;
    this.definingEditable = definingEditable;

    selectedCls = null;
    if (aClass != null) {
      selectedCls = (Cls) aClass;
    }

    String title = "Modify Named Superclass";
    cancelBtnPressed = false;
    JPanel panel = createPanel();

    int r =
        ProtegeUI.getModalDialogFactory()
            .showDialog(tab, panel, title, ModalDialogFactory.MODE_OK_CANCEL);

    if (r == ModalDialogFactory.OPTION_OK) {
      if (selectedCls == null) {
        try {
          MsgDialog.ok(this, "Incomplete data entry.");
          cancelBtnPressed = true;
          return;
        } catch (Exception ex) {
          Log.getLogger().log(Level.WARNING, "Exception caught", ex);
          ;
        }
      } else {
        if (name == null) {
          modified = true;
        } else {
          String selectedClsName = tab.getOWLWrapper().getInternalName(selectedCls);
          if (selectedClsName.compareTo(name) != 0) {
            modified = true;
          }
        }

        defining = definingCheckBox.isSelected();

        if (!defining_prev && definingCheckBox.isSelected()) modified = true;
        if (defining_prev && !definingCheckBox.isSelected()) modified = true;
        if (!modified) {
          cancelBtnPressed = true;
        }

        isDefinition = defining;
      }
    } else {
      cancelBtnPressed = true;
    }
  }
 public CheckBoxes() {
   cb1.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           trace("1", cb1);
         }
       });
   cb2.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           trace("2", cb2);
         }
       });
   cb3.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           trace("3", cb3);
         }
       });
   setLayout(new FlowLayout());
   add(new JScrollPane(t));
   add(cb1);
   add(cb2);
   add(cb3);
 }
  private void newComps() {
    ta = new JTextArea();
    // ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    ta.setFocusable(false);
    ta.setEditable(false);
    ta.setFont(new Font("Courier New", Font.BOLD, 20));
    ta.setBackground(Color.black);
    ta.setForeground(Color.GREEN);

    sc = new JScrollPane();
    sc.setViewportView(ta);

    btnExport = new JButton("Export");
    btnExport.setOpaque(false);
    btnExport.setFont(ta.getFont());
    btnExport.setFocusable(false);

    ckWrap = new JCheckBox("Wrap text");
    ckWrap.setOpaque(false);
    ckWrap.setForeground(Color.white);
    ckWrap.setFont(ta.getFont());
    ckWrap.setFocusable(false);

    chooser = new JFileChooser();
  }
 private void createCheckBoxes() {
   JPanel checkboxPanel = new JPanel();
   floaterBox = new JCheckBox(DISABLE_GRAVITY_FOR_SELECTED_OBJECT_CHECK_BOX);
   checkboxPanel.add(floaterBox);
   floaterBox.setFocusable(false);
   floaterBox.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           myLevelEditor.getMover().getStats().isFloating = floaterBox.isSelected();
           for (GameObject g : myLevelEditor.getSelected()) {
             g.setIsFloating(floaterBox.isSelected());
           }
         }
       });
   cameraBox = new JCheckBox("Camera Toggle");
   cameraBox.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           myLevelEditor.getMover().getStats().isCameraFollow = cameraBox.isSelected();
           for (GameObject g : myLevelEditor.getSelected()) {
             g.setIsScreenFollowing(cameraBox.isSelected());
           }
         }
       });
   checkboxPanel.add(cameraBox);
   cameraBox.setFocusable(false);
   checkboxPanel.setPreferredSize(CHECKBOX_PANEL_SIZE);
   checkboxPanel.setMaximumSize(CHECKBOX_PANEL_SIZE);
   homePanel.add(checkboxPanel);
 }
Exemple #15
0
  /** Store changes to table preferences. This method is called when the user clicks Ok. */
  @Override
  public void storeSettings() {

    prefs.putBoolean(JabRefPreferences.NAMES_AS_IS, namesAsIs.isSelected());
    prefs.putBoolean(JabRefPreferences.NAMES_FIRST_LAST, namesFf.isSelected());
    prefs.putBoolean(JabRefPreferences.NAMES_NATBIB, namesNatbib.isSelected());
    prefs.putBoolean(JabRefPreferences.NAMES_LAST_ONLY, lastNamesOnly.isSelected());
    prefs.putBoolean(JabRefPreferences.ABBR_AUTHOR_NAMES, abbrNames.isSelected());

    prefs.putInt(
        JabRefPreferences.AUTO_RESIZE_MODE,
        autoResizeMode.isSelected() ? JTable.AUTO_RESIZE_ALL_COLUMNS : JTable.AUTO_RESIZE_OFF);
    prefs.putBoolean(JabRefPreferences.PRIMARY_SORT_DESCENDING, priDesc.isSelected());
    prefs.putBoolean(JabRefPreferences.SECONDARY_SORT_DESCENDING, secDesc.isSelected());
    prefs.putBoolean(JabRefPreferences.TERTIARY_SORT_DESCENDING, terDesc.isSelected());
    prefs.put(JabRefPreferences.PRIMARY_SORT_FIELD, priField.getText().toLowerCase().trim());
    prefs.put(JabRefPreferences.SECONDARY_SORT_FIELD, secField.getText().toLowerCase().trim());
    prefs.put(JabRefPreferences.TERTIARY_SORT_FIELD, terField.getText().toLowerCase().trim());

    prefs.putBoolean(JabRefPreferences.FLOAT_MARKED_ENTRIES, floatMarked.isSelected());
    // updatefont

    String oldVal = prefs.get(JabRefPreferences.NUMERIC_FIELDS);
    String newVal = numericFields.getText().trim();
    if (newVal.isEmpty()) {
      newVal = null;
    }
    if (newVal != null && oldVal == null
        || newVal == null && oldVal != null
        || newVal != null && !newVal.equals(oldVal)) {
      prefs.put(JabRefPreferences.NUMERIC_FIELDS, newVal);
      BibtexFields.setNumericFieldsFromPrefs();
    }
  }
  /** Loads the default settings from Preferences to set up the dialog. */
  public void legacyLoadDefaults() {
    String defaultsString = Preferences.getDialogDefaults(getDialogName());

    if ((defaultsString != null) && (newImage != null)) {

      try {
        StringTokenizer st = new StringTokenizer(defaultsString, ",");

        textSearchWindowSide.setText("" + MipavUtil.getInt(st));
        textSimilarityWindowSide.setText("" + MipavUtil.getInt(st));
        textNoiseStandardDeviation.setText("" + MipavUtil.getFloat(st));
        textDegree.setText("" + MipavUtil.getFloat(st));
        doRician = MipavUtil.getBoolean(st);
        doRicianCheckBox.setSelected(doRician);
        textDegree.setEnabled(doRician);
        labelDegree.setEnabled(doRician);
        image25DCheckBox.setSelected(MipavUtil.getBoolean(st));

        if (MipavUtil.getBoolean(st)) {
          newImage.setSelected(true);
        } else {
          replaceImage.setSelected(true);
        }

      } catch (Exception ex) {

        // since there was a problem parsing the defaults string, start over with the original
        // defaults
        Preferences.debug("Resetting defaults for dialog: " + getDialogName());
        Preferences.removeProperty(getDialogName());
      }
    }
  }
 public boolean isDoNotAskMe() {
   if (myDoNotAskMeCheckBox.isEnabled()) {
     return myDoNotAskMeCheckBox.isSelected();
   } else {
     return !EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG;
   }
 }
  /** {@inheritDoc} */
  @Override
  public void contentHasChanged(boolean empty, String text) {
    if (labelHandler != null) {
      labelHandler.handleLabelStateFor(this, empty);
    }

    // check or unceheck sn / ski checkboxes
    final ServiceDigitalIdentityMultivalueAdapter serviceDigitalIdentityMultivalueAdapter =
        (ServiceDigitalIdentityMultivalueAdapter)
            certificateButton.getMultivaluePanel().getMultivalueModel();
    final List<DigitalIdentityType> digitalId =
        serviceDigitalIdentityMultivalueAdapter.getDigitalIdentityList().getDigitalId();

    boolean hasSn = false;
    boolean hasSki = false;

    for (Iterator<DigitalIdentityType> iterator = digitalId.iterator(); iterator.hasNext(); ) {
      DigitalIdentityType digitalIdentityType = iterator.next();
      if (digitalIdentityType.getX509SubjectName() != null) {
        hasSn = true;
      }
      if (digitalIdentityType.getX509SKI() != null) {
        hasSki = true;
      }
    }

    boxSN.setSelected(hasSn);
    boxSKI.setSelected(hasSki);

    alignSnSki();
  }
		setBackground(new Color(167, 202, 255));
		this.dialog = dialog;
		ActionListener buttonEvent = new ButtonHandler();
		edit.addActionListener(buttonEvent);
		JCheckBox hasVideoB = new JCheckBox("Video");
		artist.setText(song.getSongArtist().getName());
		songName.setText(song.getSongTitle());
		minutesF.setText(String.valueOf(song.getLength().toMinutes()));
		secondsF.setText(String.valueOf(song.getLength().minusMinutes(song.getLength().toMinutes()).getSeconds()));
		arrangementF.setText(song.getArrangementBy());
		musicF.setText(song.getMusicBy());
		lyricsF.setText(song.getLyricsBy());
		yearF.setText(String.valueOf(song.getYear()));
		if(song.isHasVideo()){
			hasVideoB.setSelected(true);
		}
		add(new JLabel("Name of artist: "));
		add(artist);
		add(new JLabel("Name of song: "));
		add(songName);
		add(new JLabel("Length: "));
		add(minutesF);
		add(new JLabel(":"));
		add(secondsF);
		add(new JLabel("Year: "));
		add(yearF);
		add(new JLabel("Arrangement by: "));
		add(arrangementF);
		add(new JLabel("Music by: "));
		add(musicF);
		add(new JLabel("Lyrics by: "));
		add(lyricsF);
		add(hasVideoB);
		add(edit);
	}
 public void setFilterConditionItem(FilterConditionItem filterConditionItem) {
   this.filterConditionItem = filterConditionItem;
   textField.setText(String.valueOf(filterConditionItem.getLeft().getText()));
   criteriaCombo.setSelectedItem(filterConditionItem.getCriteria());
   colValCheckBox.setSelected(
       filterConditionItem.getRight() != null
           && filterConditionItem.getRight()[0] instanceof CellValue);
   casecheckBox.setSelected(!filterConditionItem.isCaseSensitive());
   if (filterConditionItem.getCriteria() == Criteria.IS_IN
       || filterConditionItem.getCriteria() == Criteria.IS_NOT_IN) {
     setMultiTextbox(true);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
     for (int i = 0; i < filterConditionItem.getRight().length; i++) {
       IValue val = filterConditionItem.getRight()[i];
       if (i == 0) {
         ((ComparedValuePanel) lowerPanel.getComponent(0)).textField_1.setText(val.getText());
       } else {
         addComparedValuePanel().textField_1.setText(val.getText());
       }
     }
   } else {
     setMultiTextbox(false);
     ((ComparedValuePanel) lowerPanel.getComponent(0))
         .textField_1.setText(filterConditionItem.getRight()[0].getText());
   }
 }
  public EditDateTimeQuestionFrame(DateTimeQuestion dateTimeQuestion, SurveyPanel surveyPanel)
      throws IOException, ParseException {

    super(dateTimeQuestion, surveyPanel);
    this.dateTimeQuestion = dateTimeQuestion;

    this.setSize(600, 400);

    questionField.setText(question.getQuestion());
    hintField.setText(dateTimeQuestion.getHint());
    // errorMessageField.setText("");

    onlyDateBox = new JCheckBox("tylko data");
    onlyDateBox.setSelected(dateTimeQuestion.isOnlyDate());
    onlyDateBox.setBounds(FIELDS_X_POSITION, CURRENT_Y_POSITION, FIELDS_WIDTH, FIELDS_HEIGHT);
    this.add(onlyDateBox);

    CURRENT_Y_POSITION = CURRENT_Y_POSITION + FIELDS_HEIGHT + SPACE_HEIGHT;

    onlyTimeBox = new JCheckBox("tylko czas");
    onlyTimeBox.setSelected(dateTimeQuestion.isOnlyTime());
    onlyTimeBox.setBounds(FIELDS_X_POSITION, CURRENT_Y_POSITION, FIELDS_WIDTH, FIELDS_HEIGHT);
    this.add(onlyTimeBox);

    CURRENT_Y_POSITION = CURRENT_Y_POSITION + FIELDS_HEIGHT + SPACE_HEIGHT;

    saveButton.setBounds(
        ADD_BUTTON_X_POSITION, CURRENT_Y_POSITION + SPACE_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);

    cancelButton.setBounds(
        CANCEL_BUTTON_X_POSITION, CURRENT_Y_POSITION + SPACE_HEIGHT, BUTTON_WIDTH, BUTTON_HEIGHT);
  }
  /*
   * Gets the user choice for font, style and size and redraws the text
   *     accordingly.
   */
  public void setSampleFont() {
    // Get the font name from the JComboBox
    fontName = (String) facenameCombo.getSelectedItem();

    sampleField.setText(textField.getText());

    // Get the font style from the JCheckBoxes
    fontStyle = 0;
    if (italicCheckBox.isSelected()) fontStyle += Font.ITALIC;
    if (boldCheckBox.isSelected()) fontStyle += Font.BOLD;

    // Get the font size
    fontSize = 0;

    fontSize = Integer.parseInt((String) sizeCombo.getSelectedItem());

    // THE FOLLOWING IS NO LONGER NEEDED
    //            if(smallButton.isSelected())
    //                  fontSize=SMALL;
    //            else if(mediumButton.isSelected())
    //                  fontSize=MEDIUM;
    //            else if(largeButton.isSelected())
    //                  fontSize=LARGE;

    // Set the font of the text field
    sampleField.setFont(new Font(fontName, fontStyle, fontSize));
    sampleField.setForeground(fontColor);
    sampleField.repaint();

    pack();
  } // end setSampleFont method
Exemple #23
0
 /**
  * Creates a checkbox and sets it's value.
  *
  * @param strText either 'yes' or 'no' if yes then set the checkbox selected.
  */
 protected JCheckBox createChkBox(String strText, JPanel pnlDisplay) {
   JCheckBox chkField = new JCheckBox();
   boolean bSelected = (strText.equalsIgnoreCase("yes")) ? true : false;
   chkField.setSelected(bSelected);
   pnlDisplay.add(chkField);
   return chkField;
 }
  public Component getTableCellRendererComponent(
      JTable tabl, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

    // if(value==null)return new JLabel("EMPTY");
    // if(tabl==null)return new JLabel("EMPTY2");
    // if(super==null)return new JLabel("EMPTY3");
    Component c =
        super.getTableCellRendererComponent(
            tabl, value.toString(), isSelected, hasFocus, row, column);

    if (value instanceof Component) {
      return (Component) value;
    }

    if (value instanceof Boolean) {
      JCheckBox jc = new JCheckBox();
      jc.setEnabled((Boolean) value);
      jc.setHorizontalAlignment(SwingConstants.CENTER);
      jc.setBackground(c.getBackground());
      return jc;
    }

    return super.getTableCellRendererComponent(
        tabl, value.toString(), isSelected, hasFocus, row, column);
  }
Exemple #25
0
 public void unsetVirtual() {
   l2checkbox.setVisible(true);
   vlancheckbox.setVisible(true);
   ipcheckbox.setVisible(true);
   cap.setVisible(true);
   jb.setVisible(false);
 }
 void update(String group) {
   myTitleLabel.setText(
       "<html><body><h2 style=\"text-align:left;\">" + group + "</h2></body></html>");
   myContentPanel.removeAll();
   List<IdSet> idSets = PluginGroups.getInstance().getSets(group);
   for (final IdSet set : idSets) {
     final JCheckBox checkBox =
         new JCheckBox(set.getTitle(), PluginGroups.getInstance().isIdSetAllEnabled(set));
     checkBox.setModel(
         new JToggleButton.ToggleButtonModel() {
           @Override
           public boolean isSelected() {
             return PluginGroups.getInstance().isIdSetAllEnabled(set);
           }
         });
     checkBox.addActionListener(
         new ActionListener() {
           @Override
           public void actionPerformed(ActionEvent e) {
             PluginGroups.getInstance().setIdSetEnabled(set, !checkBox.isSelected());
             CustomizePluginsStepPanel.this.repaint();
           }
         });
     myContentPanel.add(checkBox);
   }
 }
 public void setEditable(boolean isEditable) {
   isEditable_ = isEditable;
   if (inputType_.equals("ALPHA") || inputType_.equals("KANJI") || inputType_.equals("NUMERIC")) {
     ((JTextField) component).setEditable(isEditable_);
     ((JTextField) component).setFocusable(isEditable_);
   }
   if (inputType_.equals("DATE")) {
     ((XFDateField) component).setEditable(isEditable_);
     ((XFDateField) component).setFocusable(isEditable_);
     int fieldWidth = XFUtility.getWidthOfDateValue(dialog_.getSession().getDateFormat(), 14);
     if (isEditable_) {
       this.setBounds(
           this.getBounds().x, this.getBounds().y, 150 + fieldWidth, XFUtility.FIELD_UNIT_HEIGHT);
     } else {
       this.setBounds(
           this.getBounds().x, this.getBounds().y, 124 + fieldWidth, XFUtility.FIELD_UNIT_HEIGHT);
     }
   }
   if (inputType_.equals("LISTBOX")) {
     ((JComboBox) component).setEditable(isEditable_);
     ((JComboBox) component).setFocusable(isEditable_);
   }
   if (inputType_.equals("CHECKBOX")) {
     ((JCheckBox) component).setEnabled(isEditable_);
     ((JCheckBox) component).setFocusable(isEditable_);
   }
 }
  @Override
  public JComponent createCustomComponent(Presentation presentation) {
    // this component cannot be stored right here because of action system architecture:
    // one action can be shown on multiple toolbars simultaneously
    JCheckBox checkBox = new JCheckBox();
    checkBox.setOpaque(false);

    checkBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            JCheckBox checkBox = (JCheckBox) e.getSource();
            ActionToolbar actionToolbar = UIUtil.getParentOfType(ActionToolbar.class, checkBox);
            DataContext dataContext =
                actionToolbar != null
                    ? actionToolbar.getToolbarDataContext()
                    : DataManager.getInstance().getDataContext(checkBox);
            CheckboxAction.this.actionPerformed(
                new AnActionEvent(
                    null,
                    dataContext,
                    ActionPlaces.UNKNOWN,
                    CheckboxAction.this.getTemplatePresentation(),
                    ActionManager.getInstance(),
                    0));
          }
        });

    return checkBox;
  }
  private Component createTabDisabled() {
    JPanel panel = new JPanel(new MigLayout("fill, wrap 1"));

    final JTextField textField = new JTextField();
    final JCheckBox checkBox = new JCheckBox("Enabled");
    checkBox.setSelected(true);
    panel.add(checkBox);
    checkBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent actionEvent) {
            textField.setEnabled(checkBox.isSelected());
          }
        });

    panel.add(textField);
    textField.setColumns(15);

    on(new JTextFieldDocumentChangedTrigger(textField)) //
        .read(new JTextFieldTextProvider(textField)) //
        .check(new StringNotEmptyRule()) //
        .handleWith(new IconBooleanFeedback(textField, "Cannot be empty")) //
        .trigger();

    return panel;
  }
  protected void performRefactoring(
      Project project,
      PsiDirectory directory,
      PsiPackage aPackage,
      boolean searchInComments,
      boolean searchForTextOccurences) {
    final VirtualFile sourceRoot =
        ProjectRootManager.getInstance(project)
            .getFileIndex()
            .getSourceRootForFile(directory.getVirtualFile());
    if (sourceRoot == null) {
      Messages.showErrorDialog(
          project,
          RefactoringBundle.message("destination.directory.does.not.correspond.to.any.package"),
          RefactoringBundle.message("cannot.move"));
      return;
    }
    final JavaRefactoringFactory factory = JavaRefactoringFactory.getInstance(project);
    final MoveDestination destination =
        myPreserveSourceRoot.isSelected() && myPreserveSourceRoot.isVisible()
            ? factory.createSourceFolderPreservingMoveDestination(aPackage.getQualifiedName())
            : factory.createSourceRootMoveDestination(aPackage.getQualifiedName(), sourceRoot);

    MoveClassesOrPackagesProcessor processor =
        new MoveClassesOrPackagesProcessor(
            myDirectory.getProject(),
            myElementsToMove,
            destination,
            searchInComments,
            searchForTextOccurences,
            myMoveCallback);
    if (processor.verifyValidPackageName()) {
      processor.run();
    }
  }