1 /*
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
79 /**
80 * {@inheritDoc}
81 */
82 @Override
83 protected void installListeners() {
84 super.installListeners();
85 toolBar.addPropertyChangeListener(this);
86 }
87
88 /**
89 * {@inheritDoc}
90 */
91 @Override
92 protected void uninstallListeners() {
93 super.uninstallListeners();
94 toolBar.removePropertyChangeListener(this);
95 }
96
97 private void updateStyle(JToolBar c) {
98 SynthContext context = getContext(
99 c, Region.TOOL_BAR_CONTENT, null, ENABLED);
100 contentStyle = SynthLookAndFeel.updateStyle(context, this);
101
102 context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, null, ENABLED);
103 dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);
104
105 context = getContext(c, ENABLED);
106 SynthStyle oldStyle = style;
107
108 style = SynthLookAndFeel.updateStyle(context, this);
109 if (oldStyle != style) {
110 handleIcon =
111 style.getIcon(context, "ToolBar.handleIcon");
112 if (oldStyle != null) {
113 uninstallKeyboardActions();
114 installKeyboardActions();
115 }
116 }
117 }
118
119 /**
120 * {@inheritDoc}
121 */
122 @Override
|
1 /*
2 * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
79 /**
80 * {@inheritDoc}
81 */
82 @Override
83 protected void installListeners() {
84 super.installListeners();
85 toolBar.addPropertyChangeListener(this);
86 }
87
88 /**
89 * {@inheritDoc}
90 */
91 @Override
92 protected void uninstallListeners() {
93 super.uninstallListeners();
94 toolBar.removePropertyChangeListener(this);
95 }
96
97 private void updateStyle(JToolBar c) {
98 SynthContext context = getContext(
99 c, Region.TOOL_BAR_CONTENT, contentStyle, ENABLED);
100 contentStyle = SynthLookAndFeel.updateStyle(context, this);
101
102 context = getContext(c, Region.TOOL_BAR_DRAG_WINDOW, dragWindowStyle, ENABLED);
103 dragWindowStyle = SynthLookAndFeel.updateStyle(context, this);
104
105 context = getContext(c, ENABLED);
106 SynthStyle oldStyle = style;
107
108 style = SynthLookAndFeel.updateStyle(context, this);
109 if (oldStyle != style) {
110 handleIcon =
111 style.getIcon(context, "ToolBar.handleIcon");
112 if (oldStyle != null) {
113 uninstallKeyboardActions();
114 installKeyboardActions();
115 }
116 }
117 }
118
119 /**
120 * {@inheritDoc}
121 */
122 @Override
|