Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.jdeveloper.java.imports
Class AbstractSurrounder

java.lang.Object
  extended by oracle.jdeveloper.java.imports.AbstractSurrounder
Direct Known Subclasses:
AbstractTryCatchFinallySurrounder, CodeBlockSurrounder, IfSyncWhileForSurrounder

public abstract class AbstractSurrounder
extends java.lang.Object

The AbstractSurrounder is the abstract implementation that helps in performing the "Surround with" functionality for Java-like languages (basically, languages with descendants from C).


Field Summary
protected  CodingStyleOptions codingStyleOptions
           
 int endPos
           
 int startPos
           
 int surroundedEndPos
           
 int surroundedStartPos
           
protected  EditDescriptor undoDescriptor
           
 
Constructor Summary
protected AbstractSurrounder()
           
 
Method Summary
protected static void blockIndent(BasicEditorPane editorPane, int start, int end)
          Indent the text in the given offsets.
 void doSurround(BasicEditorPane editorPane, Context context)
          The entry point for the surround-with operation.
protected abstract  void doSurroundImpl(BasicEditorPane editorPane, Context context)
          The implementation of the surround-with operation.
protected static int getIndentSize(BasicEditorPane editorPane)
          Get the indentation size.
protected static java.lang.String getIndentString(BasicEditorPane editorPane, int indent)
          Get the indentation String object for the given indent size.
protected abstract  java.lang.String getNameImpl()
          The name of the surround-with operation.
protected static int getOuterIndent(BasicEditorPane editorPane)
          Get the outer indent.
protected static int getTabSize(BasicEditorPane editorPane)
          Get the tab size.
protected static boolean getUseTabs(BasicEditorPane editorPane)
          Check whether a tab character should be used for the given editor.
protected static boolean isBraceAlone()
          Check whether open braces are on the same line or on the next line.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

undoDescriptor

protected final EditDescriptor undoDescriptor

codingStyleOptions

protected CodingStyleOptions codingStyleOptions

startPos

public int startPos

endPos

public int endPos

surroundedStartPos

public int surroundedStartPos

surroundedEndPos

public int surroundedEndPos
Constructor Detail

AbstractSurrounder

protected AbstractSurrounder()
Method Detail

doSurroundImpl

protected abstract void doSurroundImpl(BasicEditorPane editorPane,
                                       Context context)
                                throws javax.swing.text.BadLocationException
The implementation of the surround-with operation.

Parameters:
editorPane - The editor pane
context - The IDE context
Throws:
javax.swing.text.BadLocationException - If the surround operation fails

getNameImpl

protected abstract java.lang.String getNameImpl()
The name of the surround-with operation.

Returns:
String The name of the surround-with operation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

doSurround

public final void doSurround(BasicEditorPane editorPane,
                             Context context)
The entry point for the surround-with operation.

Parameters:
editorPane - The editor pane
context - The IDE context

blockIndent

protected static final void blockIndent(BasicEditorPane editorPane,
                                        int start,
                                        int end)
Indent the text in the given offsets.

Parameters:
editorPane - The editor pane
start - The start offset
end - The end offset

isBraceAlone

protected static final boolean isBraceAlone()
Check whether open braces are on the same line or on the next line. This information is retrieved from the preferences.

Returns:
boolean True of open braces need to be on the next line, false otherwise

getIndentSize

protected static final int getIndentSize(BasicEditorPane editorPane)
Get the indentation size.

Parameters:
editorPane - The editor pane
Returns:
int The indentation size

getTabSize

protected static final int getTabSize(BasicEditorPane editorPane)
Get the tab size.

Parameters:
editorPane - The editor pane
Returns:
int The tab size

getUseTabs

protected static final boolean getUseTabs(BasicEditorPane editorPane)
Check whether a tab character should be used for the given editor.

Parameters:
editorPane - The editor pane
Returns:
boolean True if a tab character should be used for the given editor, false otherwise

getOuterIndent

protected static final int getOuterIndent(BasicEditorPane editorPane)
Get the outer indent.

Parameters:
editorPane - The editor pane
Returns:
int The outer indent

getIndentString

protected static final java.lang.String getIndentString(BasicEditorPane editorPane,
                                                        int indent)
Get the indentation String object for the given indent size.

Parameters:
editorPane - The editor pane
indent - The indent size
Returns:
String The indentation String

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

Copyright © 1997, 2009, Oracle. All rights reserved.