-
Notifications
You must be signed in to change notification settings - Fork 56
Tutorial
This is a short tutorial, teaches how to install and use the plugin. You can post installation or usage issues on https://github.com/SpartanRefactoring/Spartanizer/issues.
##Quick start
- Install the plugin:
- go to https://marketplace.eclipse.org/content/spartan-refactoring-0
- Drag installation button to eclipse's window
- install the plugin
- Choose
Refactor->Laconize..->Tips on/off - Spartanization suggestions should appear on your screen within a few minutes.
##User interface The key for efficient and productive work with the plugin is understanding it's various UI features.
###Main menu
The main spartanization menu can be found under Refactor->Laconize..:
-
Refactor->Laconize..->active window: preforms spartanization on active window. -
Refactor->Laconize..->entire project: preforms spartanization on the entire project (could take a few moments). -
Refactor->Laconize..->Tips on/off: enables/disables spartanization suggestions for current project. -
Refactor->Laconize..->Refresh all projects (slow): refreshes all project, while rebuilding spartanization suggestions. -
Refactor->Laconize..->Apply spartanization nature to all projects: enables spartanization suggestions in all projects.
#####Notes
- Spartanizing entire project means preforming major textual changes. Currently there is no way of reverting this process, though
ctrl+zis available (for files that were open during the spartanization process). - Keep in mind the suggestions will be built for a project only after it refreshed, so consider using
Refactor->Laconize..->Refresh all projects (slow)right afterRefactor->Laconize..->Apply spartanization nature to all projects.
###Marker resolutions The main feature of the plugin is marking code with spartanization suggestion. A short description of the suggestion will be shown upon hovering the cursor over the marker, followed by the following resolution options:
-
Apply: apply suggestion for the marked code. -
Apply after preview: allow you to inspect the suggestion while comparing the original code with the spartanized one. -
Laconize file: performs spartanization process on the current file. -
Laconize function: same as above, but for containing function. -
Laconize class: same as above, but for containing class. -
Apply to enclosing function: performs the described suggestion for the containing function. -
Apply to compilation unit: same as above, but for the entire file. -
Apply to entire project: same as above, but for the entire project. -
Suppress laconize tips on function: disables spartanization suggestions for the containing function (see below). -
Suppress laconize tips on class: same as above, but for containing class. -
Suppress laconize tips on class: same as above, but for containing file.
#####Notes
-
Laconize Xwill preform all kinds of enabled spartanizations, whileApply to Xwill perform only the current suggestion. - Spartanization suggestions disabling mechanism is implemented using Javadoc comments. A declaration (i.e. class, function and so on) with
[[SuppressWarningsSpartan]]in it's Javadoc will disallow any spartanization options within it. Using[[EnableWarningsSpartan]]will enable the suggestions once again, so user defined spartanization protocol can be easily conducted using using nested Javadoc spartanization comments. For example:
/**
* My cool class.
* [[SuppressWarningsSpartan]]
*/
Class MyClass {
// suggestions are disabled here
/**
* My cool inner class.
* [[EnableWarningsSpartan]]
*/
Class MyInnerClass {
// suggestions are enabled here
}
}
###Problems view
The spartanization suggestions can be view in the problems tab in the lower eclipse window. The suggestions are considered as info markers, and right click->Laconize.. offers the same menu as the main spartanization menu (see above).
[Written by Ori Roth]