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

  




 

 

EclipseJDT Plug-in Developer Guide
Previous Page Home Next Page

Clean Ups

Identifier:
org.eclipse.jdt.ui.cleanUps

Since:
3.5

Description:
This extension point allows to add clean ups that can solve problems in a compilation unit.

Configuration Markup:

<!ELEMENT extension ( cleanUp* , cleanUpConfigurationUI* , cleanUpOptionsInitializer*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED

>

  • point - a fully qualified identifier of the target extension point
  • id - an optional identifier of the extension instance
  • name - an optional name of the extension instance

<!ELEMENT cleanUp EMPTY>

<!ATTLIST cleanUp

class    CDATA #REQUIRED

id       CDATA #REQUIRED

runAfter IDREF #IMPLIED

>

  • class - the fully qualified class name implementing the interface org.eclipse.jdt.ui.cleanup.ICleanUp
  • id - a unique id that will be used to identify this clean up
  • runAfter - optional clean up id specifying that this clean up should run after it

<!ELEMENT cleanUpConfigurationUI EMPTY>

<!ATTLIST cleanUpConfigurationUI

name        CDATA #REQUIRED

class       CDATA #REQUIRED

cleanUpKind (cleanUp|saveAction)

>

A clean up configuration UI for the given clean up kind. Each contributed clean up must at least provide UI that allows to disable it.


  • name - a name that allows to identify this configuration in the UI
  • class - the fully qualified class name implementing the interface org.eclipse.jdt.ui.cleanup.ICleanUpConfigurationUI
  • cleanUpKind - The kind of clean up this configuration UI configures. Currently only the following are supported:
    • cleanUp: a normal clean up
    • saveAction: a clean up executed on save in the Java editor

<!ELEMENT cleanUpOptionsInitializer EMPTY>

<!ATTLIST cleanUpOptionsInitializer

cleanUpKind (cleanUp|saveAction)

class       CDATA #REQUIRED

>

An options initializer that returns default options for a clean up kind. Each clean up will consult all contributed initializers to check whether it is enabled.


  • cleanUpKind - The kind of clean up this initializer initializes. Currently only the following are supported:
    • cleanUp: a normal clean up
    • saveAction: a clean up executed on save in the Java editor
  • class - the fully qualified class name implementing the interface org.eclipse.jdt.ui.cleanup.ICleanUpOptionsInitializer

Examples:
The following is an example of a clean up that updates a copyright on save:


   <extension
         point=
"org.eclipse.jdt.ui.cleanUps"
>
      <cleanUp
            id=
"org.eclipse.jdt.copyrightsaveaction.copyright_clean_up"

            class=
"org.eclipse.jdt.ui.internal.copyrightupdater.CopyrightUpdaterCleanUp"
>
      </cleanUp>
      
      <cleanUpOptionsInitializer
            class=
"org.eclipse.jdt.ui.internal.copyrightupdater.CopyrightOnSaveOptionsInitializer"

            cleanUpKind=
"saveAction"
>
      </cleanUpOptionsInitializer>
      
      <cleanUpConfigurationUI
            class=
"org.eclipse.jdt.ui.internal.copyrightupdater.CopyrightTabPage"

            name=
"%cleanUpConfigurationUI.name"

            cleanUpKind=
"saveAction"
>
      </cleanUpConfigurationUI>
   </extension>


Copyright (c) 2008, 2009 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v10.html


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