use of javax.swing.JEditorPane in project suite by stupidsing.
the class EditorController method run.
private void run(Iterate<String> fun) {
JEditorPane editor = view.getEditor();
String selectedText = editor.getSelectedText();
String text = selectedText != null ? selectedText : editor.getText();
if (runThread == null || !runThread.isAlive())
runThread = Thread_.startThread(() -> {
view.showMessageRunning();
view.showMessage(fun.apply(text));
view.getEditor().requestFocusInWindow();
});
else
JOptionPane.showMessageDialog(view.getFrame(), "Previous evaluation in progress");
}
use of javax.swing.JEditorPane in project knime-core by knime.
the class OneWayANOVANodeView method createMainPanel.
/**
* The content of the view.
*/
private JPanel createMainPanel() {
JPanel p = new JPanel(new GridBagLayout());
GridBagConstraints c = createGridBagConstraints();
c.gridwidth = 2;
m_headerPane = new JEditorPane("text/html", "");
m_headerPane.setEditable(false);
p.add(m_headerPane, c);
c.gridwidth = 1;
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_descrStatPane = new JEditorPane("text/html", "");
m_descrStatPane.setEditable(false);
p.add(m_descrStatPane, c);
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_leveneStatPane = new JEditorPane("text/html", "");
m_leveneStatPane.setEditable(false);
p.add(m_leveneStatPane, c);
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_statPane = new JEditorPane("text/html", "");
m_statPane.setEditable(false);
p.add(m_statPane, c);
c.gridy++;
c.weighty = 1;
JPanel foo = new JPanel();
foo.setBackground(Color.white);
p.add(foo, c);
return p;
}
use of javax.swing.JEditorPane in project knime-core by knime.
the class TwoSampleTTestNodeView method createMainPanel.
/**
* The content of the view.
*/
private JPanel createMainPanel() {
JPanel p = new JPanel(new GridBagLayout());
GridBagConstraints c = createGridBagConstraints();
c.gridwidth = 2;
m_headerPane = new JEditorPane("text/html", "");
m_headerPane.setEditable(false);
p.add(m_headerPane, c);
c.gridwidth = 1;
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_descrStatPane = new JEditorPane("text/html", "");
m_descrStatPane.setEditable(false);
p.add(m_descrStatPane, c);
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_leveneStatPane = new JEditorPane("text/html", "");
m_leveneStatPane.setEditable(false);
p.add(m_leveneStatPane, c);
c.gridy++;
c.gridx = 0;
c.gridwidth = 2;
m_statPane = new JEditorPane("text/html", "");
m_statPane.setEditable(false);
p.add(m_statPane, c);
c.gridy++;
c.weighty = 1;
JPanel foo = new JPanel();
foo.setBackground(Color.white);
p.add(foo, c);
return p;
}
use of javax.swing.JEditorPane in project JWildfire by thargor6.
the class RessourceDialog method getEditorTextArea.
/**
* This method initializes editorTextArea
*
* @return javax.swing.JTextArea
*/
private JEditorPane getEditorTextArea() {
if (editorTextArea == null) {
if (Prefs.getPrefs().isTinaAdvancedCodeEditor()) {
try {
DefaultSyntaxKit.initKit();
// setting JSyntaxPane font, see comment in org.jwildfire.create.tina.swing.ScriptEditDialog for explanation
Configuration config = DefaultSyntaxKit.getConfig(DefaultSyntaxKit.class);
config.put("DefaultFont", "monospaced " + Integer.toString(Prefs.getPrefs().getTinaAdvancedCodeEditorFontSize()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
editorTextArea = new JEditorPane();
// if using advanced editor color fix, and one of JWildfire's dark look and feels (HiFi or Noire),
// override look and feel to set scriptEditor background to white,
// to work better with JSyntaxPane text colors
LookAndFeel laf = UIManager.getLookAndFeel();
String laf_name = laf.getName();
boolean using_dark_theme = laf_name.equalsIgnoreCase("HiFi") || laf_name.equalsIgnoreCase("Noire");
if (using_dark_theme && Prefs.getPrefs().isTinaAdvancedCodeEditor() && Prefs.getPrefs().isTinaAdvancedCodeEditorColorFix()) {
editorTextArea.setBackground(Color.white);
}
editorTextArea.setText("");
}
return editorTextArea;
}
use of javax.swing.JEditorPane in project JWildfire by thargor6.
the class ScriptEditDialog method getScriptEditor.
/**
* This method initializes editorTextArea
*
* @return javax.swing.JTextArea
*/
private JEditorPane getScriptEditor() {
if (scriptEditor == null) {
scriptEditor = new JEditorPane();
// if using advanced editor color fix, and one of JWildfire's dark look and feels (HiFi or Noire),
// override look and feel to set scriptEditor background to white,
// to work better with JSyntaxPane text colors
LookAndFeel laf = UIManager.getLookAndFeel();
String laf_name = laf.getName();
boolean using_dark_theme = laf_name.equalsIgnoreCase("HiFi") || laf_name.equalsIgnoreCase("Noire");
if (using_dark_theme && Prefs.getPrefs().isTinaAdvancedCodeEditor() && Prefs.getPrefs().isTinaAdvancedCodeEditorColorFix()) {
scriptEditor.setBackground(Color.white);
}
}
return scriptEditor;
}
Aggregations