Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315718 - Create an Outline-like view with additional fields and enhanced behaviour for a CSS file
Summary: Create an Outline-like view with additional fields and enhanced behaviour for...
Status: NEW
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.css (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: wst.css CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 02:08 EDT by ashitha shetty CLA
Modified: 2012-09-24 11:36 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ashitha shetty CLA 2010-06-04 02:08:21 EDT
FUNCTIONAL REQUIREMENTS:  

I want to create a custom view for my CSS files which displays the outline of the CSS file contents(similar to the standard Outline view).
While the standard Outline view displays only the name of the CSS properties, my custom view should also display the values for those properties in a name:value format.

For instance,suppose the CSS file has the following contents:
BODY{
      background-color: black;
      border: none;
}

The standard Outline view displays the CSS nodes in the following format:
>BODY
   background-color
   border
 
My custom view has to display the CSS nodes in the following format:
>BODY
   background-color: black
   border: none


TECHNICAL DETAILS:

1)To display the CSS tree structure in my custom view, I create a tree viewer with the CSS model(of the CSS file) set as the input to this viewer.
Before setting the CSS model as input to the viewer, the CSS model has to be first loaded.

Issues/requirements at this point: 

a) The API for reading this model is internal -- > 
IStructuredModel model = StructuredModelManager.getModelManager().getModelForRead(file);
The IStructuredModel class is also internal.

Requirement: A non-internal API to load the model and hold a reference to it.

b) To this model, adapter factories have to be attached ,in order to listen to model change notifications. 
This API is again internal --> The EditorModelUtil.addFactoriesTo(model); 

Requirement: A non-internal API to attach adapter factories to the model.					   

2) The Outline view uses JFaceNodeContentProviderCSS and JFaceNodeLabelProviderCSS classes(in org.eclipse.wst.css.ui.views.contentoutline) as the content and label providers.
These providers delegate to the CSSNodeAdapter which in turn retrieves information from the CSS model. In order to provide any customization here, the logic in the CSS node adapter needs to be modified such as to provide the additional data that my view requires. 
  
Issues/requirements at this point: 
a) There seem to be no APIs for me to plug in my custom adapter to the CSS model.

Requirement: A way to plug in my adapter to the CSS model.Or a way to extend the existing adapter such as to allow customization.

b) In order to do any customization, the CSS model needs to be processed. But the complete CSS model is internal(ICSSModel,ICSSNode,ICSSValue ...).

Requirement: The CSS model needs to be exposed.
Comment 1 Nitin Dahyabhai CLA 2012-09-24 11:36:43 EDT
Have you considered implementing it as a patch to the existing Outline View, perhaps as features you can toggle from the toolbar?  The XML Outline View has similar functionality.  High quality patches are accepted.