public void apply() { if (!isModified()) return; final ScalaProjectSettings scalaProjectSettings = ScalaProjectSettings.getInstance(myProject); scalaProjectSettings.setImplicitParametersSearchDepth( (Integer) implicitParametersSearchDepthSpinner.getValue()); scalaProjectSettings.setOutputLimit((Integer) outputSpinner.getValue()); scalaProjectSettings.setInProcessMode(runWorksheetInTheCheckBox.isSelected()); scalaProjectSettings.setInteractiveMode(worksheetInteractiveModeCheckBox.isSelected()); scalaProjectSettings.setSearchAllSymbols(searchAllSymbolsIncludeCheckBox.isSelected()); scalaProjectSettings.setEnableJavaToScalaConversion( enableConversionOnCopyCheckBox.isSelected()); scalaProjectSettings.setDontShowConversionDialog(donTShowDialogCheckBox.isSelected()); scalaProjectSettings.setTreatDocCommentAsBlockComment( treatDocCommentAsBlockComment.isSelected()); scalaProjectSettings.setShowImplisitConversions(showImplicitConversionsInCheckBox.isSelected()); scalaProjectSettings.setShowArgumentsToByNameParams( showArgumentsToByNameParametersCheckBox.isSelected()); scalaProjectSettings.setIncludeBlockExpressions( includeBlockExpressionsExpressionsCheckBox.isSelected()); scalaProjectSettings.setIncludeLiterals(includeLiteralsCheckBox.isSelected()); scalaProjectSettings.setIgnorePerformance(myResolveToAllClassesCheckBox.isSelected()); scalaProjectSettings.setDisableLangInjection(myDisableLanguageInjection.isSelected()); scalaProjectSettings.setDisableI18N(myDisablei18n.isSelected()); scalaProjectSettings.setDontCacheCompoundTypes(myDontCacheCompound.isSelected()); scalaProjectSettings.setScalaPriority(useScalaClassesPriorityCheckBox.isSelected()); scalaProjectSettings.setCollectionTypeHighlightingLevel( collectionHighlightingChooser.getSelectedIndex()); injectionPrefixTable.saveSettings(scalaProjectSettings); }
public MainForm() { alfa.setValue(1); beta.setValue(1); gamma.setValue(1); loadDatabase.addActionListener( e -> { fileChooser.setCurrentDirectory(new File(database.getText())); int returnVal = fileChooser.showOpenDialog(panel1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); database.setText(file.getPath()); } }); loadKeyword.addActionListener( e -> { fileChooser.setCurrentDirectory(new File(keywords.getText())); int returnVal = fileChooser.showOpenDialog(panel1); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); keywords.setText(file.getPath()); } }); search.addActionListener( e -> { isKeywordsEnabled = keywordsEnabled.getSelectedIndex() != 0; DatabaseCollection.clear(); if (isKeywordsEnabled) { new KeywordParser(keywords.getText()).parse(); } new DocumentParser(database.getText()).parse(); Method method1 = Method.valueOf((String) MainForm.this.method.getSelectedItem()); Document query1 = new Document(MainForm.this.query.getText(), "", false); showResults(method1, query1); }); oznacz.addActionListener( e -> { for (Result result : results.getSelectedValuesList()) { result.setMarkedAsGood(!result.isMarkedAsGood()); } results.repaint(); }); newQuestion.addActionListener( e -> { ResultModel model = (ResultModel) results.getModel(); Document query1 = model.getQuery(); calculateRelevance( model.getResultList(), query1, (Integer) alfa.getValue(), (Integer) beta.getValue(), (Integer) gamma.getValue()); queryHelp.setText(query1.getQueryText()); Method method1 = Method.valueOf((String) MainForm.this.method.getSelectedItem()); showResults(method1, query1); }); }
private void onOK() { System.out.println("pase por aqui"); int tamanyHidato = (int) spinnerTamanyHidato.getValue(); int forats = (int) spinnerForats.getValue(); int numerosPrecolocats = (int) spinnerNumerosPrecolocats.getValue(); String dificultat = (String) comboBoxDificultat.getSelectedItem(); ControladorHidato.fesCreacioAutomatica(tamanyHidato, forats, numerosPrecolocats, dificultat); dispose(); }
@SuppressWarnings({"ConstantConditions", "RedundantIfStatement"}) public boolean isModified() { final ScalaProjectSettings scalaProjectSettings = ScalaProjectSettings.getInstance(myProject); if (scalaProjectSettings.isShowImplisitConversions() != showImplicitConversionsInCheckBox.isSelected()) return true; if (scalaProjectSettings.isShowArgumentsToByNameParams() != showArgumentsToByNameParametersCheckBox.isSelected()) return true; if (scalaProjectSettings.isIncludeBlockExpressions() != includeBlockExpressionsExpressionsCheckBox.isSelected()) return true; if (scalaProjectSettings.isIncludeLiterals() != includeLiteralsCheckBox.isSelected()) return true; if (scalaProjectSettings.getImplicitParametersSearchDepth() != (Integer) implicitParametersSearchDepthSpinner.getValue()) return true; if (scalaProjectSettings.getOutputLimit() != (Integer) outputSpinner.getValue()) return true; if (scalaProjectSettings.isInProcessMode() != runWorksheetInTheCheckBox.isSelected()) return true; if (scalaProjectSettings.isInteractiveMode() != worksheetInteractiveModeCheckBox.isSelected()) return true; if (scalaProjectSettings.isSearchAllSymbols() != searchAllSymbolsIncludeCheckBox.isSelected()) return true; if (scalaProjectSettings.isEnableJavaToScalaConversion() != enableConversionOnCopyCheckBox.isSelected()) return true; if (scalaProjectSettings.isDontShowConversionDialog() != donTShowDialogCheckBox.isSelected()) return true; if (scalaProjectSettings.isTreatDocCommentAsBlockComment() != treatDocCommentAsBlockComment.isSelected()) return true; if (scalaProjectSettings.isIgnorePerformance() != myResolveToAllClassesCheckBox.isSelected()) return true; if (scalaProjectSettings.isDisableLangInjection() != myDisableLanguageInjection.isSelected()) return true; if (scalaProjectSettings.isDisableI18N() != myDisablei18n.isSelected()) return true; if (scalaProjectSettings.isDontCacheCompoundTypes() != myDontCacheCompound.isSelected()) return true; if (scalaProjectSettings.isScalaPriority() != useScalaClassesPriorityCheckBox.isSelected()) return true; if (scalaProjectSettings.getCollectionTypeHighlightingLevel() != collectionHighlightingChooser.getSelectedIndex()) return true; if (injectionPrefixTable.isModified(scalaProjectSettings)) return true; return false; }
private void onSemesterSelected() { LOGGER.trace( "KurseSemesterwahlController Event Semester selected =" + spinnerSemester.getValue()); boolean equalFieldAndModelValue = equalsNullSafe(spinnerSemester.getValue(), kurseSemesterwahlModel.getSemester()); setModelSemester(); if (equalFieldAndModelValue && isModelValidationMode()) { // Wenn Field und Model den gleichen Wert haben, erfolgt kein PropertyChangeEvent. Deshalb // muss hier die Validierung angestossen werden. LOGGER.trace("Validierung wegen equalFieldAndModelValue"); validate(); } }
/** Saves event into the list. */ public synchronized void save() { myEvent.setNEID(myNE.getId()); myEvent.setEnabled(true); myEvent.setDescription(desc.getText()); int h = (Integer) hh.getValue(); int m = (Integer) mm.getValue(); double s = (Double) ss.getValue(); myEvent.setTime(h + (m / 60.0) + (s / 3600.0)); myEventManager.clearEvent(myEvent); myEventManager.addEvent(myEvent); if (eventTable != null) eventTable.updateData(); return; }
private void onOK() { // add your code here game = new Game(((Number) numberOfRounds.getValue()).intValue()); game.setMaxProcessorSpeed(((Number) maxCpu.getValue()).intValue()); for (RobotSource factory : entrantsModel.getList()) { try { game.addEntrant(factory.createFactory()); } catch (IOException e) { throw new RuntimeException(e); } } dispose(); }
public void saveDisplayObjectType() { DOTPoint newDOTPoint = (DOTPoint) _dotDefinitionDialogFrame.getScratchDisplayObjectType().getCopy(null); final String name = _dotDefinitionDialogFrame.getNameText(); if ((name == null) || (name.length() == 0)) { JOptionPane.showMessageDialog( new JFrame(), "Bitte geben Sie einen Namen an!", "Fehler", JOptionPane.ERROR_MESSAGE); return; } if (!_dotDefinitionDialogFrame.isReviseOnly()) { if (_dotDefinitionDialogFrame.getDotManager().containsDisplayObjectType(name)) { JOptionPane.showMessageDialog( new JFrame(), "Ein Darstellungstyp mit diesem Namen existiert bereits!", "Fehler", JOptionPane.ERROR_MESSAGE); return; } } newDOTPoint.setName(name); newDOTPoint.setInfo(_dotDefinitionDialogFrame.getInfoText()); final Object value = _translationFactorSpinner.getValue(); if (value instanceof Number) { final Number number = (Number) value; newDOTPoint.setTranslationFactor(number.doubleValue()); } newDOTPoint.setJoinByLine(_joinByLineCheckBox.isSelected()); _dotDefinitionDialogFrame.getDotManager().saveDisplayObjectType(newDOTPoint); _dotDefinitionDialogFrame.setDisplayObjectType(newDOTPoint, true); }
@Override public boolean isModified() { VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject); if (myHighlightRecentlyChanged.isSelected() != settings.isShow()) return true; if (!Comparing.equal(myHighlightInterval.getValue(), settings.getLimitDays())) return true; return false; }
private void preferredIndexFieldChanged(ChangeEvent e) { Integer indx = (Integer) (preferredIndexField.getValue()); int index = indx.intValue(); if (index != objEntityViewField.getPrefIndex()) { objEntityViewField.setPrefIndex(index); } }
@Override public void actionPerformed(ActionEvent e) { parent.newGame( (int) numAI.getValue(), AIPlayer.Difficulty.valueOf(chooseDifficulty.getSelection().getActionCommand())); this.dispose(); }
/** Reaction to value changes in the form. */ public void stateChanged(ChangeEvent e) { String nm = ((JComponent) e.getSource()).getName(); double x; if (nm.equals(nmSpinMaxFlow)) { x = (Double) spinMaxFlow.getValue(); mf = x; } if (nm.equals(nmSpinCapDrop)) { x = (Double) spinCapDrop.getValue(); drp = x; } if (nm.equals(nmSpinCritDen)) { x = (Double) spinCritDen.getValue(); if (x <= jd) cd = x; } if (nm.equals(nmSpinJamDen)) { x = (Double) spinJamDen.getValue(); if (x >= cd) jd = x; } if (nm.equals(nmSpinVff)) { x = (Double) spinVff.getValue(); if (x > 0.0) cd = mf / x; double xx = (Double) spinWc.getValue(); if (xx > 0.0) jd = cd + (mf / xx); } if (nm.equals(nmSpinWc)) { x = (Double) spinWc.getValue(); if (x > 0.0) jd = cd + (mf / x); } updateSpinners(); updateFDSeries(); return; }
/** Update date spinner to synchronize with the other spinners */ private void updateDate() { // Get current month and year in int int month = ((SpinnerListModel) jspMonth.getModel()).getList().indexOf(jspMonth.getValue()); int year = ((Integer) spinnerYear.getValue()).intValue(); // Set a new maximum number of days for the new month and year SpinnerNumberModel numberModel = (SpinnerNumberModel) jspDay.getModel(); numberModel.setMaximum(new Integer(maxDaysInMonth(year, month))); // Set a new current day if it exceeds the maximum if (((Integer) (numberModel.getValue())).intValue() > maxDaysInMonth(year, month)) numberModel.setValue(new Integer(maxDaysInMonth(year, month))); // Get the current day int day = ((Integer) jspDay.getValue()).intValue(); // Set a new date in the date spinner jspDate.setValue(new GregorianCalendar(year, month, day).getTime()); }
public void stateChanged(ChangeEvent e) { if (e.getSource() instanceof JSlider && !isAdjusting) { int red = redSlider.getValue(); int green = greenSlider.getValue(); int blue = blueSlider.getValue(); Color color = new Color(red, green, blue); getColorSelectionModel().setSelectedColor(color); } else if (e.getSource() instanceof JSpinner && !isAdjusting) { int red = ((Integer) redField.getValue()).intValue(); int green = ((Integer) greenField.getValue()).intValue(); int blue = ((Integer) blueField.getValue()).intValue(); Color color = new Color(red, green, blue); getColorSelectionModel().setSelectedColor(color); } }
private void makeGridOverlay(int centerX, int centerY) { IJ.setTool(Toolbar.SPARE2); Overlay overlay = vad_.getImagePlus().getOverlay(); if (overlay == null || overlay.size() == 0) { overlay = new Overlay(); } else { overlay.clear(); } int gridWidth = (Integer) gridXSpinner_.getValue(); int gridHeight = (Integer) gridYSpinner_.getValue(); int roiWidth = gridWidth * tileWidth_; int roiHeight = gridHeight * tileHeight_; Roi rectangle = new Roi(centerX - roiWidth / 2, centerY - roiHeight / 2, roiWidth, roiHeight); rectangle.setStrokeWidth(20f); overlay.add(rectangle); vad_.getImagePlus().setOverlay(overlay); }
public boolean settingsChanged() { return !originalDownloadDirectory.equals(downloadDirectoryTextField.getText()) || !originalMaxParallelDownloads.equals(maxParallelDownloadsSpinner.getValue().toString()) || !originalFileNameScheme.equals(fileNameSchemeTextField.getText()) || originalStartTab != startTabComboBox.getSelectedIndex() || originalDownloadComplete != downloadCompletedComboBox.getSelectedIndex() || originalLocale != languageComboBox.getSelectedItem() && !originalProxyHost.equals(proxyHostTextField.getText()) && !originalProxyPort.equals(proxyPortTextField.getText()); }
private void setOriginalSettings() { originalDownloadDirectory = downloadDirectoryTextField.getText(); originalMaxParallelDownloads = maxParallelDownloadsSpinner.getValue().toString(); originalFileNameScheme = fileNameSchemeTextField.getText(); originalStartTab = startTabComboBox.getSelectedIndex(); originalDownloadComplete = downloadCompletedComboBox.getSelectedIndex(); originalLocale = (Locale) languageComboBox.getSelectedItem(); originalProxyHost = proxyHostTextField.getText(); originalProxyPort = proxyPortTextField.getText(); }
public PreferencesProxyDTO getPreferencesProxyDTO() { String proxySettingType = proxySettingGroup.getSelection().getActionCommand(); switch (proxySettingType) { case "noProxy": preferencesProxyDTO.setProxySettingType(0); break; case "systemProxy": preferencesProxyDTO.setProxySettingType(1); break; case "manualProxy": preferencesProxyDTO.setProxySettingType(2); } if (useProxyRadioButton.isSelected()) preferencesProxyDTO.setUseProxyNotSocks(true); else preferencesProxyDTO.setUseProxyNotSocks(false); // for http preferencesProxyDTO.setHttpProxyAddress(httpProxyAddressTextField.getText()); preferencesProxyDTO.setHttpProxyPort((Integer) httpProxyPortSpinner.getValue()); preferencesProxyDTO.setHttpProxyUserName(httpProxyUserNameTextField.getText()); preferencesProxyDTO.setHttpProxyPassword(new String(httpProxyPasswordField.getPassword())); // for https preferencesProxyDTO.setHttpsProxyAddress(httpsProxyAddressTextField.getText()); preferencesProxyDTO.setHttpsProxyPort((Integer) httpsProxyPortSpinner.getValue()); preferencesProxyDTO.setHttpsProxyUserName(httpsProxyUserNameTextField.getText()); preferencesProxyDTO.setHttpsProxyPassword(new String(httpsProxyPasswordField.getPassword())); // for ftp preferencesProxyDTO.setFtpProxyAddress(ftpProxyAddressTextField.getText()); preferencesProxyDTO.setFtpProxyPort((Integer) ftpProxyPortSpinner.getValue()); preferencesProxyDTO.setFtpProxyUserName(ftpProxyUserNameTextField.getText()); preferencesProxyDTO.setFtpProxyPassword(new String(ftpProxyPasswordField.getPassword())); // for ftp preferencesProxyDTO.setSocksProxyAddress(socksProxyAddressTextField.getText()); preferencesProxyDTO.setSocksProxyPort((Integer) socksProxyPortSpinner.getValue()); preferencesProxyDTO.setSocksProxyUserName(socksProxyUserNameTextField.getText()); preferencesProxyDTO.setSocksProxyPassword(new String(socksProxyPasswordField.getPassword())); return preferencesProxyDTO; }
/** {@collect.stats} Sets the values of the controls to reflect the color */ private void setColor(Color newColor) { int red = newColor.getRed(); int blue = newColor.getBlue(); int green = newColor.getGreen(); if (redSlider.getValue() != red) { redSlider.setValue(red); } if (greenSlider.getValue() != green) { greenSlider.setValue(green); } if (blueSlider.getValue() != blue) { blueSlider.setValue(blue); } if (((Integer) redField.getValue()).intValue() != red) redField.setValue(new Integer(red)); if (((Integer) greenField.getValue()).intValue() != green) greenField.setValue(new Integer(green)); if (((Integer) blueField.getValue()).intValue() != blue) blueField.setValue(new Integer(blue)); }
private void resetPanel() { cal = new GregorianCalendar( Integer.parseInt(yearSpi.getValue().toString()), monthBox.getSelectedIndex(), Integer.parseInt(lastLabel.getText())); startPoint_x = 20; startPoint_y = 10; panel.removeAll(); panel.repaint(); initCalPanel(); }
private void onOK() { String columnNames[] = {"Clerk", "Salary"}; int month = (int) monthSpinner.getValue(); Object rowData[][] = saleSystem.salaryCheck.salaryRowDataProduce(month); JTable table = new JTable(rowData, columnNames); tcl = new TableCellListener(table, action); tableInitialise(table); }
// Add course method public void addCourse() { try { Database db = new Database(); String coursename = (String) coursecombobox.getSelectedItem(); if (coursecombobox.getSelectedIndex() == 0) { throw new Exception("No course selected"); } float fees = db.getCoursefees(coursename); float totalfees = fees + (ims.main.Settings.getInstallment() * (int) spinner.getValue()); long id = (long) table.getValueAt((int) table.getSelectionModel().getMinSelectionIndex(), 0); db.addCourseToCurrentStudent(id, totalfees, (int) spinner.getValue(), coursename); updateFeesData(id); courseReset(); } catch (Exception e) { JOptionPane.showMessageDialog(this, e.getMessage(), null, JOptionPane.ERROR_MESSAGE); } }
void Save(SpritesNPCManager mgr) { try { SpriteNPC t = mgr.mapNPCs.get(myIndex); mgr.mapNPCs.get(myIndex).bSpriteSet = (byte) ((int) ((Integer) txtSpriteSet.getValue())); mgr.mapNPCs.get(myIndex).bBehavior1 = Byte.parseByte(txtBehavior1.getText()); mgr.mapNPCs.get(myIndex).bBehavior2 = Byte.parseByte(txtBehavior2.getText()); mgr.mapNPCs.get(myIndex).bIsTrainer = (byte) (chkIsTrainer.isSelected() ? 1 : 0); mgr.mapNPCs.get(myIndex).bTrainerLOS = Byte.parseByte(txtTrainerLOS.getText()); mgr.mapNPCs.get(myIndex).pScript = Integer.parseInt(txtScript.getText(), 16); mgr.mapNPCs.get(myIndex).iFlag = Integer.parseInt(txtiFlag.getText()); } catch (Exception e) { } MainGUI.eventEditorPanel.Redraw = true; MainGUI.eventEditorPanel.repaint(); }
// calculate and display amounts private void calculateJButtonActionPerformed(ActionEvent event) { // declare variables to store user input double principal = Double.parseDouble(principalJTextField.getText()); double rate = Double.parseDouble(interestRateJTextField.getText()); Integer integerObject = (Integer) yearsJSpinner.getValue(); Integer year = integerObject.intValue(); yearlyBalanceJTextArea.setText("Year\tAmount on Deposit"); DecimalFormat dollars = new DecimalFormat("$0.00"); // calculate the total value for each year for (int count = 1; count <= year; count++) { double amount = principal * Math.pow((1 + rate / 100), count); yearlyBalanceJTextArea.append("\n" + count + "\t" + dollars.format(amount)); } // end for } // end method calculateJButtonActionPerformed
/*-------------------------------------------------------------------------*/ public void commit(String name) { // custom impls only supported if (name == null) { return; } Map<String, DifficultyLevel> difficultyLevels = Database.getInstance().getDifficultyLevels(); try { Class clazz = Class.forName(impl.getText()); DifficultyLevel dl = (DifficultyLevel) clazz.newInstance(); dl.setName(name); dl.setSortOrder((Integer) sortOrder.getValue()); difficultyLevels.put(name, dl); } catch (Exception x) { throw new MazeException(x); } }
public boolean isModified() { Sdk sdk = myCompilationServerSdk.getSelectedJdk(); String sdkName = sdk == null ? null : sdk.getName(); if (showTypeInfoOnCheckBox.isSelected() != mySettings.SHOW_TYPE_TOOLTIP_ON_MOUSE_HOVER) return true; if (!delaySpinner.getValue().equals(mySettings.SHOW_TYPE_TOOLTIP_DELAY)) return true; return !(myEnableCompileServer.isSelected() == mySettings.COMPILE_SERVER_ENABLED && myCompilationServerPort.getText().equals(mySettings.COMPILE_SERVER_PORT) && ComparatorUtil.equalsNullable(sdkName, mySettings.COMPILE_SERVER_SDK) && myCompilationServerMaximumHeapSize .getText() .equals(mySettings.COMPILE_SERVER_MAXIMUM_HEAP_SIZE) && myCompilationServerJvmParameters .getText() .equals(mySettings.COMPILE_SERVER_JVM_PARAMETERS) && myIncrementalTypeCmb.getModel().getSelectedItem().equals(mySettings.INCREMENTAL_TYPE) && myCompileOrderCmb.getModel().getSelectedItem().equals(mySettings.COMPILE_ORDER)); }
private void generateFile() { int res = fileChooser.showSaveDialog(this); if (res != JFileChooser.APPROVE_OPTION) return; fileChooser.getCurrentDirectory(); File dir = fileChooser.getSelectedFile(); String source = wordListArea.getText(); String[] lines = source.split("\n"); ArrayList<String> list = new ArrayList<String>(lines.length); for (String line1 : lines) { String line = line1.trim(); if (line.length() > 0) { list.add(line); } } String titlePre = "wordlist"; String titleInput = titleField.getText().trim(); if (titleInput.length() > 0) titlePre = titleInput; boolean split = splitLinesCheckBox.isSelected(); int splitNum = (Integer) splitNumSpinner.getValue(); try { if (!split || list.size() < splitNum) { File file = new File(dir, titlePre + ".xml"); PrintWriter writer = new PrintWriter(file, "UTF-8"); writer.println(format(titlePre, list)); writer.close(); } else { for (int i = 0; i < list.size() / splitNum; i++) { String title = titlePre + "_" + (i + 1); File file = new File(dir, title + ".xml"); PrintWriter writer = new PrintWriter(file, "UTF-8"); writer.println(format(title, list.subList(i * splitNum, (i + 1) * splitNum - 1))); writer.close(); } } } catch (IOException e) { e.printStackTrace(); } }
public void apply() throws ConfigurationException { mySettings.INCREMENTAL_TYPE = (String) myIncrementalTypeCmb.getModel().getSelectedItem(); mySettings.COMPILE_ORDER = (String) myCompileOrderCmb.getModel().getSelectedItem(); mySettings.COMPILE_SERVER_ENABLED = myEnableCompileServer.isSelected(); mySettings.COMPILE_SERVER_PORT = myCompilationServerPort.getText(); Sdk sdk = myCompilationServerSdk.getSelectedJdk(); mySettings.COMPILE_SERVER_SDK = sdk == null ? null : sdk.getName(); mySettings.COMPILE_SERVER_MAXIMUM_HEAP_SIZE = myCompilationServerMaximumHeapSize.getText(); mySettings.COMPILE_SERVER_JVM_PARAMETERS = myCompilationServerJvmParameters.getText(); mySettings.SHOW_TYPE_TOOLTIP_ON_MOUSE_HOVER = showTypeInfoOnCheckBox.isSelected(); mySettings.SHOW_TYPE_TOOLTIP_DELAY = (Integer) delaySpinner.getValue(); // TODO // boolean externalCompiler = // CompilerWorkspaceConfiguration.getInstance(myProject).USE_COMPILE_SERVER; // // if (!externalCompiler || !myEnableCompileServer.isSelected()) { // myProject.getComponent(CompileServerLauncher.class).stop(); // } // myProject.getComponent(CompileServerManager.class).configureWidget(); }
public boolean saveSettings() { if (checkSettings()) { Groovesquid.getConfig().setDownloadDirectory(downloadDirectoryTextField.getText()); Groovesquid.getConfig() .setMaxParallelDownloads((Integer) (maxParallelDownloadsSpinner.getValue())); Groovesquid.getConfig().setFileNameScheme(fileNameSchemeTextField.getText()); // Groovesquid.getConfig().setAutocompleteEnabled(searchAutocompleteCheckBox.isSelected()); Groovesquid.getConfig().setStartTab(startTabComboBox.getSelectedIndex()); Groovesquid.getConfig().setDownloadComplete(downloadCompletedComboBox.getSelectedIndex()); if (originalLocale != languageComboBox.getSelectedItem()) { Locale locale = (Locale) languageComboBox.getSelectedItem(); I18n.setCurrentLocale(locale); Groovesquid.resetGui(); } if (!proxyHostTextField.getText().isEmpty() && !proxyPortTextField.getText().isEmpty()) { Groovesquid.getConfig().setProxyHost(proxyHostTextField.getText()); try { Groovesquid.getConfig().setProxyPort(Integer.parseInt(proxyPortTextField.getText())); } catch (NumberFormatException e) { JOptionPane.showMessageDialog(this, I18n.getLocaleString("INVALID_PROXY_PORT")); return false; } } else { Groovesquid.getConfig().setProxyHost(null); Groovesquid.getConfig().setProxyPort(null); } setOriginalSettings(); JOptionPane.showMessageDialog( this, I18n.getLocaleString("SETTINGS_SAVED"), I18n.getLocaleString("SETTINGS"), JOptionPane.INFORMATION_MESSAGE); return true; } else { return false; } }
@Override public void apply() throws ConfigurationException { VcsContentAnnotationSettings settings = VcsContentAnnotationSettings.getInstance(myProject); settings.setShow(myHighlightRecentlyChanged.isSelected()); settings.setLimit(((Number) myHighlightInterval.getValue()).intValue()); }