StyledEditorKit.AlignmentAction (Java Platform SE 8 ) (original) (raw)
- javax.swing.AbstractAction
- javax.swing.text.TextAction
- javax.swing.text.StyledEditorKit.StyledTextAction
* * javax.swing.text.StyledEditorKit.AlignmentAction
- javax.swing.text.StyledEditorKit.StyledTextAction
- javax.swing.text.TextAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Enclosing class:
StyledEditorKit
public static class StyledEditorKit.AlignmentAction
extends StyledEditorKit.StyledTextAction
An action to set paragraph alignment. This sets theStyleConstants.Alignment
attribute for the currently selected range of the target JEditorPane. This is done by callingStyledDocument.setParagraphAttributes
on the styled document associated with the target JEditorPane.
If the target text component is specified as the source of the ActionEvent and there is a command string, the command string will be interpreted as an integer that should be one of the legal values for theStyleConstants.Alignment
attribute.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans
package. Please see XMLEncoder.
Field Summary
* ### Fields inherited from class javax.swing.[AbstractAction](../../../javax/swing/AbstractAction.html "class in javax.swing") `[changeSupport](../../../javax/swing/AbstractAction.html#changeSupport), [enabled](../../../javax/swing/AbstractAction.html#enabled)` * ### Fields inherited from interface javax.swing.[Action](../../../javax/swing/Action.html "interface in javax.swing") `[ACCELERATOR_KEY](../../../javax/swing/Action.html#ACCELERATOR%5FKEY), [ACTION_COMMAND_KEY](../../../javax/swing/Action.html#ACTION%5FCOMMAND%5FKEY), [DEFAULT](../../../javax/swing/Action.html#DEFAULT), [DISPLAYED_MNEMONIC_INDEX_KEY](../../../javax/swing/Action.html#DISPLAYED%5FMNEMONIC%5FINDEX%5FKEY), [LARGE_ICON_KEY](../../../javax/swing/Action.html#LARGE%5FICON%5FKEY), [LONG_DESCRIPTION](../../../javax/swing/Action.html#LONG%5FDESCRIPTION), [MNEMONIC_KEY](../../../javax/swing/Action.html#MNEMONIC%5FKEY), [NAME](../../../javax/swing/Action.html#NAME), [SELECTED_KEY](../../../javax/swing/Action.html#SELECTED%5FKEY), [SHORT_DESCRIPTION](../../../javax/swing/Action.html#SHORT%5FDESCRIPTION), [SMALL_ICON](../../../javax/swing/Action.html#SMALL%5FICON)`
Constructor Summary
Constructors
Constructor Description AlignmentAction(String nm, int a) Creates a new AlignmentAction. Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description void actionPerformed(ActionEvent e) Sets the alignment. * ### Methods inherited from class javax.swing.text.[StyledEditorKit.StyledTextAction](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html "class in javax.swing.text") `[getEditor](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getEditor-java.awt.event.ActionEvent-), [getStyledDocument](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledDocument-javax.swing.JEditorPane-), [getStyledEditorKit](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#getStyledEditorKit-javax.swing.JEditorPane-), [setCharacterAttributes](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setCharacterAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-), [setParagraphAttributes](../../../javax/swing/text/StyledEditorKit.StyledTextAction.html#setParagraphAttributes-javax.swing.JEditorPane-javax.swing.text.AttributeSet-boolean-)` * ### Methods inherited from class javax.swing.text.[TextAction](../../../javax/swing/text/TextAction.html "class in javax.swing.text") `[augmentList](../../../javax/swing/text/TextAction.html#augmentList-javax.swing.Action:A-javax.swing.Action:A-), [getFocusedComponent](../../../javax/swing/text/TextAction.html#getFocusedComponent--), [getTextComponent](../../../javax/swing/text/TextAction.html#getTextComponent-java.awt.event.ActionEvent-)` * ### Methods inherited from class javax.swing.[AbstractAction](../../../javax/swing/AbstractAction.html "class in javax.swing") `[addPropertyChangeListener](../../../javax/swing/AbstractAction.html#addPropertyChangeListener-java.beans.PropertyChangeListener-), [clone](../../../javax/swing/AbstractAction.html#clone--), [firePropertyChange](../../../javax/swing/AbstractAction.html#firePropertyChange-java.lang.String-java.lang.Object-java.lang.Object-), [getKeys](../../../javax/swing/AbstractAction.html#getKeys--), [getPropertyChangeListeners](../../../javax/swing/AbstractAction.html#getPropertyChangeListeners--), [getValue](../../../javax/swing/AbstractAction.html#getValue-java.lang.String-), [isEnabled](../../../javax/swing/AbstractAction.html#isEnabled--), [putValue](../../../javax/swing/AbstractAction.html#putValue-java.lang.String-java.lang.Object-), [removePropertyChangeListener](../../../javax/swing/AbstractAction.html#removePropertyChangeListener-java.beans.PropertyChangeListener-), [setEnabled](../../../javax/swing/AbstractAction.html#setEnabled-boolean-)` * ### Methods inherited from class java.lang.[Object](../../../java/lang/Object.html "class in java.lang") `[equals](../../../java/lang/Object.html#equals-java.lang.Object-), [finalize](../../../java/lang/Object.html#finalize--), [getClass](../../../java/lang/Object.html#getClass--), [hashCode](../../../java/lang/Object.html#hashCode--), [notify](../../../java/lang/Object.html#notify--), [notifyAll](../../../java/lang/Object.html#notifyAll--), [toString](../../../java/lang/Object.html#toString--), [wait](../../../java/lang/Object.html#wait--), [wait](../../../java/lang/Object.html#wait-long-), [wait](../../../java/lang/Object.html#wait-long-int-)`
Constructor Detail
* #### AlignmentAction public AlignmentAction([String](../../../java/lang/String.html "class in java.lang") nm, int a) Creates a new AlignmentAction. Parameters: `nm` \- the action name `a` \- the alignment >= 0
Method Detail
* #### actionPerformed public void actionPerformed([ActionEvent](../../../java/awt/event/ActionEvent.html "class in java.awt.event") e) Sets the alignment. Parameters: `e` \- the action event
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.