Ejemplo n.º 1
0
  public DylematorUI() {
    super("Dylemator");
    initComponents();
    createUserDialog();

    sd.setRandom(false);
    sd.setWordsPerMinute(180);
    // this.textArea.setEditorKit(new MyEditorKit());
  }
Ejemplo n.º 2
0
 @Override
 public boolean configureTask(
     RunConfiguration runConfiguration, RunConfigurableBeforeRunTask task) {
   SelectionDialog dialog =
       new SelectionDialog(task.getSettings(), getAvailableConfigurations(runConfiguration));
   dialog.show();
   RunnerAndConfigurationSettings settings = dialog.getSelectedSettings();
   if (settings != null) {
     task.setSettings(settings);
     return true;
   } else {
     return false;
   }
 }
Ejemplo n.º 3
0
 /**
  * The user has selected a resource and the dialog is closing. Set the selected resource as the
  * dialog result.
  */
 protected void okPressed() {
   TableItem items[] = folderNames.getSelection();
   if (items.length == 1) {
     ArrayList result = new ArrayList();
     result.add(items[0].getData());
     setResult(result);
   }
   super.okPressed();
 }
Ejemplo n.º 4
0
  private void displayCenteredText(String text) {
    textArea.setText("");
    text = "\n\n\n" + text;
    SimpleAttributeSet attribs = new SimpleAttributeSet();
    float fnt = sd.getFontSize();
    StyledDocument doc = (StyledDocument) textArea.getDocument();
    Style style = doc.getStyle(StyleContext.DEFAULT_STYLE); // doc.addStyle("MyStyle",null);
    StyleConstants.setFontSize(style, (int) fnt);
    StyleConstants.setLineSpacing(attribs, 0.5f);
    StyleConstants.setFontFamily(style, "Segoe UI");
    StyleConstants.setAlignment(attribs, StyleConstants.ALIGN_CENTER);
    textArea.setParagraphAttributes(attribs, true);

    try {
      doc.insertString(doc.getLength(), text, style);
      doc.setParagraphAttributes(0, doc.getLength() - 1, attribs, false);
    } catch (BadLocationException ex) {
      Logger.getLogger(DylematorUI.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
Ejemplo n.º 5
0
 private void preferencesMenuItemActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_preferencesMenuItemActionPerformed
   sd.setVisible(true);
 } // GEN-LAST:event_preferencesMenuItemActionPerformed
Ejemplo n.º 6
0
 /** @see org.eclipse.jface.window.Window#create() */
 public void create() {
   super.create();
   pattern.setFocus();
   getButton(IDialogConstants.OK_ID).setEnabled(okEnabled);
 }
Ejemplo n.º 7
0
 /** @see org.eclipse.jface.dialogs.Dialog#cancelPressed() */
 protected void cancelPressed() {
   setResult(null);
   super.cancelPressed();
 }