Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Kommentar: Migrated to Confluence 4.0


Below you find a reference implementation for a JAXFront Plugin. This plugin just displays a label, a text area with 4 rows, a certain textfont and a fat green border around the control.
com.jaxfront.demo.api.OwnPlugin
public class OwnPlugin extends AbstractSimpleVisualizer {
private JTextArea _textArea;
public String getLabelText() {
return "Simple Plugin Example";
}
public String getText() {
if (_textArea != null) return _textArea.getText();
return null;
}
public void populateView() {
if (getModel() != null && _textArea != null) {
String value = ((SimpleType)getModel()).getValue();
if (value != null) {
_textArea.setText(value);
}
}
}
protected JComponent createEditorComponent() {
_textArea = new JTextArea();
_textArea.setForeground(Color.blue);
setBorder(BorderFactory.createMatteBorder(20,20,20,20,Color.GREEN));
_textArea.addFocusListener(this);
_textArea.setFont(new Font(null,1,20));
_textArea.setRows(4);
_textArea.setLineWrap(true);
_textArea.addFocusListener(this);
_firstFocusableComponent = _textArea;
return _textArea;
}
}