com.aptana.ide.editors.views.profiles
Class ProfilesView

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.ViewPart
              extended by com.aptana.ide.editors.views.profiles.ProfilesView
All Implemented Interfaces:
IFileContextListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public class ProfilesView
extends org.eclipse.ui.part.ViewPart
implements IFileContextListener

ProfilesView is the view in charge of Code Assist Profiles. It contains a collection of JavaScript files, and allows the user to add and remove files from the list. It will also automatically create a list of files based on the files in the current HTML document by reading the <script> tags at the top.


Nested Class Summary
protected  class ProfilesView.CheckboxAction
          CheckboxAction
 
Field Summary
protected static java.lang.String GENERIC_EDITOR_CLASS
          Generic editor class
protected static java.lang.String HTML_EDITOR_CLASS
          HTML editor class
protected static java.lang.String HTML_EDITOR_ID
          HTML editor id
protected static java.lang.String JS_EDITOR_CLASS
          JS editor class
protected static java.lang.String JS_EDITOR_ID
          JS editor id
 ProfileManager profileManager
          profileManager
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ProfilesView()
          The constructor.
 
Method Summary
 void addProfile(java.lang.Object profile)
          addProfile
 void addProfilesViewEventListener(IProfilesViewEventListener l)
          addProfilesViewEventListener
 ProfileURI[] convertSelectionToProfileURIs(org.eclipse.jface.viewers.StructuredSelection selection)
          Converts a selection into a lists of paths
 Profile createDynamicProfile(java.lang.String name, java.lang.String path)
          createDynamicProfile
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          This is a callback that will allow us to create the viewer and initialize it.
 Profile createProfile(java.lang.String name, java.lang.String path)
          createProfile
protected  org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
          createTreeViewer
 void dispose()
           
 void expandAll()
           
 void expandProfile(java.lang.String profilePath)
           
 void fireProfilesViewEvent(ProfilesViewEvent e)
          fireProfilesViewEvent
 Profile getCurrentProfile()
          getCurrentProfile
 boolean getIsLinked()
          getIsLinked
 boolean getLinkWithEditorState()
          getLinkWithEditorState
 java.lang.String[] getProfilePaths()
          getProfiles
 Profile[] getProfiles()
          getProfiles Returns all profiles
protected  void handleDrop(org.eclipse.swt.dnd.DropTargetEvent event)
          handleDrop
 void onContentChanged(FileContextContentEvent evt)
          onContentChanged
 void removeProfile(java.lang.String name)
          removeProfile
 void removeProfilesViewEventListener(IProfilesViewEventListener l)
          removeProfilesViewEventListener
 void setCurrentProfile(java.lang.String name)
          setCurrentProfile
 void setFocus()
          Passing the focus request to the viewer's control.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

JS_EDITOR_CLASS

protected static final java.lang.String JS_EDITOR_CLASS
JS editor class

See Also:
Constant Field Values

HTML_EDITOR_CLASS

protected static final java.lang.String HTML_EDITOR_CLASS
HTML editor class

See Also:
Constant Field Values

GENERIC_EDITOR_CLASS

protected static final java.lang.String GENERIC_EDITOR_CLASS
Generic editor class

See Also:
Constant Field Values

JS_EDITOR_ID

protected static final java.lang.String JS_EDITOR_ID
JS editor id

See Also:
Constant Field Values

HTML_EDITOR_ID

protected static final java.lang.String HTML_EDITOR_ID
HTML editor id

See Also:
Constant Field Values

profileManager

public ProfileManager profileManager
profileManager

Constructor Detail

ProfilesView

public ProfilesView()
The constructor.

Method Detail

fireProfilesViewEvent

public void fireProfilesViewEvent(ProfilesViewEvent e)
fireProfilesViewEvent

Parameters:
e -

addProfilesViewEventListener

public void addProfilesViewEventListener(IProfilesViewEventListener l)
addProfilesViewEventListener

Parameters:
l -

removeProfilesViewEventListener

public void removeProfilesViewEventListener(IProfilesViewEventListener l)
removeProfilesViewEventListener

Parameters:
l -

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.dispose()

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
This is a callback that will allow us to create the viewer and initialize it.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
Parameters:
parent -

onContentChanged

public void onContentChanged(FileContextContentEvent evt)
Description copied from interface: IFileContextListener
onContentChanged

Specified by:
onContentChanged in interface IFileContextListener
See Also:
IFileContextListener.onContentChanged(com.aptana.ide.editors.unified.FileContextContentEvent)

handleDrop

protected void handleDrop(org.eclipse.swt.dnd.DropTargetEvent event)
handleDrop

Parameters:
event -

createTreeViewer

protected org.eclipse.jface.viewers.TreeViewer createTreeViewer(org.eclipse.swt.widgets.Composite parent)
createTreeViewer

Parameters:
parent -
Returns:
TreeViewer

convertSelectionToProfileURIs

public ProfileURI[] convertSelectionToProfileURIs(org.eclipse.jface.viewers.StructuredSelection selection)
Converts a selection into a lists of paths

Parameters:
selection - The paths of the selection
Returns:
String[]

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

expandAll

public void expandAll()

expandProfile

public void expandProfile(java.lang.String profilePath)
Parameters:
profilePath -

getLinkWithEditorState

public boolean getLinkWithEditorState()
getLinkWithEditorState

Returns:
boolean

getIsLinked

public boolean getIsLinked()
getIsLinked

Returns:
boolean

addProfile

public void addProfile(java.lang.Object profile)
addProfile

Parameters:
profile -

createProfile

public Profile createProfile(java.lang.String name,
                             java.lang.String path)
createProfile

Parameters:
name -
path -
Returns:
Profile

createDynamicProfile

public Profile createDynamicProfile(java.lang.String name,
                                    java.lang.String path)
createDynamicProfile

Parameters:
name -
path -
Returns:
Profile

removeProfile

public void removeProfile(java.lang.String name)
removeProfile

Parameters:
name -

setCurrentProfile

public void setCurrentProfile(java.lang.String name)
setCurrentProfile

Parameters:
name -

getCurrentProfile

public Profile getCurrentProfile()
getCurrentProfile

Returns:
String

getProfilePaths

public java.lang.String[] getProfilePaths()
getProfiles

Returns:
String[]

getProfiles

public Profile[] getProfiles()
getProfiles Returns all profiles

Returns:
Profile[]