home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.text.html;
-
- import com.sun.java.swing.JEditorPane;
- import com.sun.java.swing.text.JTextComponent;
- import com.sun.java.swing.text.Style;
- import com.sun.java.swing.text.StyledDocument;
- import com.sun.java.swing.text.TextAction;
- import java.awt.event.ActionEvent;
-
- class HTMLEditorKit$LogicalStyleAction extends HTMLEditorKit.HtmlAction {
- String styleStr;
-
- HTMLEditorKit$LogicalStyleAction(String var1) {
- super("html-logical-style-action");
- this.styleStr = var1;
- }
-
- public void actionPerformed(ActionEvent var1) {
- JEditorPane var2 = (JEditorPane)((TextAction)this).getFocusedComponent();
- if (var2 != null) {
- StyledDocument var3 = (StyledDocument)((JTextComponent)var2).getDocument();
- Style var4 = var3.getStyle(this.styleStr);
- if (var4 != null) {
- var3.setLogicalStyle(((JTextComponent)var2).getCaretPosition(), var4);
- }
- }
-
- }
-
- public void setLogicalStyle(Object var1, String var2) {
- this.styleStr = var2;
- this.actionPerformed(new ActionEvent(var1, 0, "html-logical-style"));
- }
- }
-