001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Evgeniya G. Maenkova
019: * @version $Revision$
020: */package javax.swing.plaf.basic;
021:
022: import java.beans.PropertyChangeEvent;
023: import javax.swing.JComponent;
024: import javax.swing.plaf.ComponentUI;
025: import javax.swing.text.Caret;
026: import javax.swing.text.Element;
027: import javax.swing.text.Highlighter;
028: import javax.swing.text.View;
029:
030: public class TextAreaUI extends BasicTextAreaUI {
031: boolean propertyChangeFlag = false;
032:
033: String eventName = "";
034:
035: boolean flagModelChanged = false;
036:
037: boolean flagCreate = false;
038:
039: static String callOrder = "";
040:
041: public static ComponentUI createUI(final JComponent arg0) {
042: callOrder += "createUI::";
043: return new TextAreaUI();
044: }
045:
046: @Override
047: public View create(final Element elem) {
048: callOrder += "create::";
049: flagCreate = true;
050: return super .create(elem);
051: }
052:
053: @Override
054: protected Highlighter createHighlighter() {
055: callOrder += "createHighlighter::";
056: return super .createHighlighter();
057: }
058:
059: @Override
060: protected Caret createCaret() {
061: callOrder += "createCaret::";
062: return super .createCaret();
063: }
064:
065: @Override
066: protected void installDefaults() {
067: callOrder += "installDefaults::";
068: super .installDefaults();
069: }
070:
071: @Override
072: protected void installKeyboardActions() {
073: callOrder += "installKeyboardActions::";
074: super .installKeyboardActions();
075: }
076:
077: @Override
078: protected void installListeners() {
079: callOrder += "installListeners::";
080: super .installListeners();
081: }
082:
083: @Override
084: public void installUI(final JComponent c) {
085: callOrder += "installUI::";
086: super .installUI(c);
087: }
088:
089: @Override
090: protected void uninstallDefaults() {
091: callOrder += "uninstallDefaults::";
092: super .uninstallDefaults();
093: }
094:
095: @Override
096: protected void uninstallKeyboardActions() {
097: callOrder += "uninstallKeyboardActions::";
098: super .uninstallKeyboardActions();
099: }
100:
101: @Override
102: protected void uninstallListeners() {
103: callOrder += "uninstallListeners::";
104: super .uninstallListeners();
105: }
106:
107: @Override
108: public void uninstallUI(final JComponent c) {
109: callOrder += "uninstallUI::";
110: super .uninstallUI(c);
111: }
112:
113: @Override
114: protected void propertyChange(final PropertyChangeEvent e) {
115: eventName = e.getPropertyName();
116: propertyChangeFlag = true;
117: super .propertyChange(e);
118: }
119:
120: @Override
121: protected void modelChanged() {
122: callOrder += "modelChanged::";
123: flagModelChanged = true;
124: super.modelChanged();
125: }
126: }
|