source: java/main/src/main/java/com/framsticks/gui/controls/TextOnlyControl.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 582 bytes
Line 
1package com.framsticks.gui.controls;
2
3import javax.swing.text.JTextComponent;
4
5import com.framsticks.params.PrimitiveParam;
6
7@SuppressWarnings("serial")
8public abstract class TextOnlyControl extends TextControl {
9
10        public TextOnlyControl(PrimitiveParam<?> valueParam) {
11                super(valueParam);
12        }
13
14        protected abstract JTextComponent getTextComponent();
15
16        @Override
17        public void pushValueToUserInterfaceImpl(Object text) {
18                getTextComponent().setText(getParam().serialize(text));
19        }
20
21        @Override
22        public Object pullValueFromUserInterface() {
23                return getTextComponent().getText();
24        }
25}
Note: See TracBrowser for help on using the repository browser.