public DylematorUI() { super("Dylemator"); initComponents(); createUserDialog(); sd.setRandom(false); sd.setWordsPerMinute(180); // this.textArea.setEditorKit(new MyEditorKit()); }
@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; } }
/** * 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(); }
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); } }
private void preferencesMenuItemActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_preferencesMenuItemActionPerformed sd.setVisible(true); } // GEN-LAST:event_preferencesMenuItemActionPerformed
/** @see org.eclipse.jface.window.Window#create() */ public void create() { super.create(); pattern.setFocus(); getButton(IDialogConstants.OK_ID).setEnabled(okEnabled); }
/** @see org.eclipse.jface.dialogs.Dialog#cancelPressed() */ protected void cancelPressed() { setResult(null); super.cancelPressed(); }