/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* HiddenTagView subclasses EditableView to contain a JTextField showing
* the element name. When the textfield is edited the element name is
* reset. As this inherits from EditableView if the JTextComponent is
* not editable, the textfield will not be visible.
*
* @author Scott Violet
*/
super(e);
yAlign = 1;
}
if (doc instanceof StyledDocument) {
}
else {
}
// Create a panel to wrap the textfield so that the textfields
// laf border shows through.
if (isEndTag()) {
}
else {
}
return panel;
}
return yAlign;
}
return 0.5f;
}
// Default to preferred.
}
return super.getMinimumSpan(axis);
}
}
return super.getPreferredSpan(axis);
}
// Default to preferred.
}
return super.getMaximumSpan(axis);
}
// DocumentListener methods
}
}
}
// View method
if (!isSettingAttributes) {
}
}
// local methods
Container c = getContainer();
float d = fm.getDescent();
}
void resetBorder() {
if (isEndTag()) {
}
else {
}
}
}
/**
* This resets the text on the text component we created to match
* that of the AttributeSet for the Element we represent.
* <p>If this is invoked on the event dispatching thread, this
* directly invokes <code>_setTextFromModel</code>, otherwise
* <code>SwingUtilities.invokeLater</code> is used to schedule execution
* of <code>_setTextFromModel</code>.
*/
void setTextFromModel() {
if (SwingUtilities.isEventDispatchThread()) {
}
else {
public void run() {
}
});
}
}
/**
* This resets the text on the text component we created to match
* that of the AttributeSet for the Element we represent.
*/
void _setTextFromModel() {
try {
isSettingAttributes = true;
if (doc instanceof AbstractDocument) {
}
resetBorder();
preferenceChanged(this, true, true);
}
}
}
finally {
isSettingAttributes = false;
if (doc instanceof AbstractDocument) {
}
}
}
/**
* This copies the text from the text component we've created
* to the Element's AttributeSet we represent.
* <p>If this is invoked on the event dispatching thread, this
* directly invokes <code>_updateModelFromText</code>, otherwise
* <code>SwingUtilities.invokeLater</code> is used to schedule execution
* of <code>_updateModelFromText</code>.
*/
void updateModelFromText() {
if (!isSettingAttributes) {
if (SwingUtilities.isEventDispatchThread()) {
}
else {
public void run() {
}
});
}
}
}
/**
* This copies the text from the text component we've created
* to the Element's AttributeSet we represent.
*/
void _updateModelFromText() {
(doc instanceof StyledDocument)) {
if (textComponent != null) {
isSettingAttributes = true;
try {
(getStartOffset(), getEndOffset() -
getStartOffset(), sas, false);
}
finally {
isSettingAttributes = false;
}
}
}
}
getComponent(0);
}
}
boolean isEndTag() {
return true;
}
}
return false;
}
/** Alignment along the y axis, based on the font of the textfield. */
float yAlign;
/** Set to true when setting attributes. */
boolean isSettingAttributes;
// Following are for Borders that used for Unknown tags and comments.
//
// Border defines
x += padding;
}
}
public boolean isBorderOpaque() {
return false;
}
} // End of class HiddenTagView.StartTagBorder
x += padding;
x, y + height / 2);
x, y + height / 2);
}
}
public boolean isBorderOpaque() {
return false;
}
} // End of class HiddenTagView.EndTagBorder
} // End of HiddenTagView