コード例 #1
0
 public void actionPerformed(ActionEvent e) {
   int index = tablePlugins.getSelectedRow();
   CompilerPlugin plugin = (CompilerPlugin) getPluginsModel().getItem(index);
   EditPathDialog dialog = new EditPathDialog(myEditorContext.getProject(), CHOOSER_DESCRIPTOR);
   dialog.setPath(plugin.path());
   dialog.show();
   if (dialog.isOK()) {
     String path =
         CompilerPlugin.pathTo(new File(dialog.getPath()), myEditorContext.getModule());
     myPlugins.set(index, new CompilerPlugin(path, myEditorContext.getModule()));
     getPluginsModel().fireTableRowsUpdated(index, index);
   }
 }
コード例 #2
0
  private void update(ConfigurationData data) {
    data.setBasePackage(basePackageField.getText());
    data.setFsc(myFSCRadioButton.isSelected());
    data.setCompilerLibraryName(getCompilerLibraryName());
    data.setCompilerLibraryLevel(getCompilerLibraryLevel());

    try {
      data.setMaximumHeapSize(Integer.parseInt(myMaximumHeapSize.getText().trim()));
    } catch (NumberFormatException e) {
      data.setMaximumHeapSize(myData.getMaximumHeapSize());
    }

    data.setVmOptions(myVmParameters.getText().trim());

    data.setWarnings(myEnableWarnings.isSelected());
    data.setDeprecationWarnings(myDeprecationWarnings.isSelected());
    data.setUncheckedWarnings(myUncheckedWarnings.isSelected());
    data.setOptimiseBytecode(myOptimiseBytecode.isSelected());
    data.setExplainTypeErrors(myExplainTypeErrors.isSelected());
    data.setContinuations(myEnableContinuations.isSelected());

    data.setDebuggingInfoLevel((DebuggingInfoLevel) myDebuggingInfoLevel.getSelectedItem());
    data.setCompilerOptions(myCompilerOptions.getText().trim());

    data.setPluginPaths(CompilerPlugin.toPaths(myPlugins));

    updateCheckboxesState();
  }
コード例 #3
0
  public void reset() {
    basePackageField.setText(myData.getBasePackage());
    myFSCRadioButton.setSelected(myData.getFsc());
    myRunSeparateCompilerRadioButton.setSelected(!myData.getFsc());
    updateLibrariesList();
    setCompilerLibraryById(
        new LibraryId(myData.getCompilerLibraryName(), myData.getCompilerLibraryLevel()));
    myMaximumHeapSize.setText(Integer.toString(myData.getMaximumHeapSize()));
    myVmParameters.setText(myData.getVmOptions());

    myEnableWarnings.setSelected(myData.getWarnings());
    myDeprecationWarnings.setSelected(myData.getDeprecationWarnings());
    myUncheckedWarnings.setSelected(myData.getUncheckedWarnings());
    myOptimiseBytecode.setSelected(myData.getOptimiseBytecode());
    myExplainTypeErrors.setSelected(myData.getExplainTypeErrors());
    myEnableContinuations.setSelected(myData.getContinuations());

    myDebuggingInfoLevel.setSelectedItem(myData.getDebuggingInfoLevel());
    myCompilerOptions.setText(myData.getCompilerOptions());

    myPlugins =
        new ArrayList(
            CompilerPlugin.fromPaths(myData.getPluginPaths(), myEditorContext.getModule()));
    getPluginsModel().setItems(myPlugins);
  }
コード例 #4
0
 public void actionPerformed(ActionEvent e) {
   VirtualFile[] files =
       FileChooser.chooseFiles(myEditorContext.getProject(), CHOOSER_DESCRIPTOR);
   tablePlugins.clearSelection();
   for (VirtualFile file : files) {
     String path =
         CompilerPlugin.pathTo(VfsUtil.virtualToIoFile(file), myEditorContext.getModule());
     CompilerPlugin item = new CompilerPlugin(path, myEditorContext.getModule());
     getPluginsModel().addRow(item);
     tablePlugins.addSelection(item);
   }
   tablePlugins.requestFocusInWindow();
 }
コード例 #5
0
 private static ValidationResult checkContinuationsPlugin(List<CompilerPlugin> plugins) {
   for (CompilerPlugin plugin : plugins) {
     if ("continuations".equals(plugin.name())) return ValidationResult.OK;
   }
   return new ValidationResult("No continuations compiler plugin jar added");
 }