Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text.formatter
Class ContextBasedFormattingStrategy


java.lang.Object
  extended by 
org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy
All Implemented Interfaces:
IFormattingStrategy, IFormattingStrategyExtension

public abstract class ContextBasedFormattingStrategy
extends Object
implements IFormattingStrategy, IFormattingStrategyExtension

Formatting strategy for context based content formatting. Retrieves the preferences set on the formatting context's FormattingContextProperties.CONTEXT_PREFERENCES property and makes them available to subclasses.

Since:
3.0

Constructor Summary
ContextBasedFormattingStrategy ()
           
 
Method Summary
 void format ()
          Formats the region with the properties indicated in the formatting context previously supplied by formatterStarts(IFormattingContext).
  String format ( String content, boolean start, String indentation, int[] positions)
          Formats the given string.
 void formatterStarts ( IFormattingContext context)
          Informs the strategy about the start of a formatting process in which it will participate.
 void formatterStarts ( String indentation)
          Informs the strategy about the start of a formatting process in which it will participate.
 void formatterStops ()
          Informs the strategy that the formatting process in which it has participated has been finished.
  Map getPreferences ()
          Returns the preferences used for the current formatting step.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextBasedFormattingStrategy

public ContextBasedFormattingStrategy()
Method Detail

format

public void format()
Description copied from interface: IFormattingStrategyExtension
Formats the region with the properties indicated in the formatting context previously supplied by formatterStarts(IFormattingContext).

Specified by:
format in interface IFormattingStrategyExtension

format

public 
String format(
String content,
                     boolean start,
                     
String indentation,
                     int[] positions)
Description copied from interface: IFormattingStrategy
Formats the given string. During the formatting process this strategy must update the given character positions according to the changes applied to the given string.

Specified by:
format in interface IFormattingStrategy
Parameters:
content - the initial string to be formatted
start - indicates whether the beginning of content is a line start in its document
indentation - the indentation string to be used
positions - the character positions to be updated
Returns:
the formatted string

formatterStarts

public void formatterStarts(
IFormattingContext context)
Description copied from interface: IFormattingStrategyExtension
Informs the strategy about the start of a formatting process in which it will participate.

Specified by:
formatterStarts in interface IFormattingStrategyExtension
Parameters:
context - the formatting context used in the corresponding formatting process.

formatterStarts

public void formatterStarts(
String indentation)
Description copied from interface: IFormattingStrategy
Informs the strategy about the start of a formatting process in which it will participate.

Specified by:
formatterStarts in interface IFormattingStrategy
Parameters:
indentation - the indent string of the first line at which the overall formatting process starts.

formatterStops

public void formatterStops()
Description copied from interface: IFormattingStrategy
Informs the strategy that the formatting process in which it has participated has been finished.

Specified by:
formatterStops in interface IFormattingStrategy
Specified by:
formatterStops in interface IFormattingStrategyExtension

getPreferences

public final 
Map getPreferences()
Returns the preferences used for the current formatting step.

Returns:
The preferences for the current formatting step

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire