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.debug.ui.sourcelookup
Class CommonSourceNotFoundEditor


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.ui.part.WorkbenchPart
          extended by 

org.eclipse.ui.part.EditorPart
              extended by 
org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor
All Implemented Interfaces:
IAdaptable, IExecutableExtension, IEditorPart, IReusableEditor, ISaveablePart, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation

public class CommonSourceNotFoundEditor
extends EditorPart
implements IReusableEditor

Default editor displayed when source is not found. Displays a button to modify the source lookup path.

This editor's id is IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR (value org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditor).

This class may be instantiated and subclassed.

Since:
3.2
See Also:
AbstractSourceLookupDirector, CommonSourceNotFoundEditorInput

Field Summary
 
Fields inherited from interface org.eclipse.ui. IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui. IWorkbenchPart
PROP_TITLE
 
Constructor Summary
CommonSourceNotFoundEditor ()
           
 
Method Summary
protected  void closeEditor ()
          Closes this editor.
protected  void createButtons ( Composite parent)
          Create buttons to be displayed in this editor
 void createPartControl ( Composite parent)
          Creates the SWT controls for this workbench part.
 void dispose ()
          The WorkbenchPart implementation of this IWorkbenchPart method disposes the title image loaded by setInitializationData.
 void doSave ( IProgressMonitor monitor)
          Saves the contents of this part.
 void doSaveAs ()
          Saves the contents of this part to another object.
protected  void editSourceLookupPath ()
          Edits the source lookup path associated with the active debug context.
protected   Object getArtifact ()
          Returns the artifact this editor was opened for (i.e. the artifact that source was not found for), or null
protected   String getText ()
          Return the text to be displayed in this editor.
 void init ( IEditorSite site, IEditorInput input)
          Initializes this editor with the given editor site and input.
protected  void initialize ()
          Initialize this editor.
 boolean isDirty ()
          Returns whether the contents of this part have changed since the last save operation.
 boolean isSaveAsAllowed ()
          Returns whether the "Save As" operation is supported by this part.
 void setFocus ()
          Asks this part to take focus within the workbench.
 void setInput ( IEditorInput input)
          Sets the input to this editor.
 
Methods inherited from class org.eclipse.ui.part. EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, 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, 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. IEditorPart
getEditorInput, getEditorSite
 
Methods inherited from interface org.eclipse.ui. IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime. IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.ui. ISaveablePart
isSaveOnCloseNeeded
 

Constructor Detail

CommonSourceNotFoundEditor

public CommonSourceNotFoundEditor()
Method Detail

doSave

public void doSave(
IProgressMonitor monitor)
Description copied from interface: ISaveablePart
Saves the contents of this part.

If the save is successful, the part should fire a property changed event reflecting the new dirty state (PROP_DIRTY property).

If the save is cancelled through user action, or for any other reason, the part should invoke setCancelled on the IProgressMonitor to inform the caller.

This method is long-running; progress and cancellation are provided by the given progress monitor.

Specified by:
doSave in interface ISaveablePart
Specified by:
doSave in class EditorPart
Parameters:
monitor - the progress monitor

doSaveAs

public void doSaveAs()
Description copied from interface: ISaveablePart
Saves the contents of this part to another object.

Implementors are expected to open a "Save As" dialog where the user will be able to select a new name for the contents. After the selection is made, the contents should be saved to that new name. During this operation a IProgressMonitor should be used to indicate progress.

If the save is successful, the part fires a property changed event reflecting the new dirty state (PROP_DIRTY property).

Specified by:
doSaveAs in interface ISaveablePart
Specified by:
doSaveAs in class EditorPart

init

public void init(
IEditorSite site,
                 
IEditorInput input)
          throws 
PartInitException
Description copied from interface: IEditorPart
Initializes this editor with the given editor site and input.

This method is automatically called shortly after the part is instantiated. It marks the start of the part's lifecycle. The IWorkbenchPart.dispose method will be called automically at the end of the lifecycle. Clients must not call this method.

Implementors of this method must examine the editor input object type to determine if it is understood. If not, the implementor must throw a PartInitException

Specified by:
init in interface IEditorPart
Specified by:
init in class EditorPart
Parameters:
site - the editor site
input - the editor input
Throws:
PartInitException - if this editor was not initialized successfully

isDirty

public boolean isDirty()
Description copied from interface: ISaveablePart
Returns whether the contents of this part have changed since the last save operation. If this value changes the part must fire a property listener event with PROP_DIRTY.

Note: this method is called often on a part open or part activation switch, for example by actions to determine their enabled status.

Specified by:
isDirty in interface ISaveablePart
Specified by:
isDirty in class EditorPart
Returns:
true if the contents have been modified and need saving, and false if they have not changed since the last save

isSaveAsAllowed

public boolean isSaveAsAllowed()
Description copied from interface: ISaveablePart
Returns whether the "Save As" operation is supported by this part.

Specified by:
isSaveAsAllowed in interface ISaveablePart
Specified by:
isSaveAsAllowed in class EditorPart
Returns:
true if "Save As" is supported, and false if not supported

createPartControl

public void createPartControl(
Composite parent)
Description copied from interface: IWorkbenchPart
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors this is a multi-step process:

  1. Create one or more controls within the parent.
  2. Set the parent layout as needed.
  3. Register any global actions with the site's IActionBars.
  4. Register any context menus with the site.
  5. Register a selection provider with the site, to make it available to the workbench's ISelectionService (optional).

Specified by:
createPartControl in interface IWorkbenchPart
Specified by:
createPartControl in class WorkbenchPart
Parameters:
parent - the parent control

createButtons

protected void createButtons(
Composite parent)
Create buttons to be displayed in this editor

Parameters:
parent - composite to create the buttons in.

editSourceLookupPath

protected void editSourceLookupPath()
Edits the source lookup path associated with the active debug context. After the path is edited, source lookup is performed again and this editor is closed.


setFocus

public void setFocus()
Description copied from interface: IWorkbenchPart
Asks this part to take focus within the workbench. Parts must assign focus to one of the controls contained in the part's parent composite.

Clients should not call this method (the workbench calls this method at appropriate times). To have the workbench activate a part, use IWorkbenchPage.activate(IWorkbenchPart) instead.

Specified by:
setFocus in interface IWorkbenchPart
Specified by:
setFocus in class WorkbenchPart

setInput

public void setInput(
IEditorInput input)
Description copied from class: EditorPart
Sets the input to this editor. This method simply updates the internal member variable.

Unlike most of the other set methods on this class, this method does not fire a property change. Clients that call this method from a subclass must ensure that they fire an IWorkbenchPartConstants.PROP_INPUT property change after calling this method but before leaving whatever public method they are in. Clients that expose this method as public API must fire the property change within their implementation of setInput.

Note that firing a property change may cause listeners to immediately reach back and call methods on this editor. Care should be taken not to fire the property change until the editor has fully updated its internal state to reflect the new input.

Specified by:
setInput in interface IReusableEditor
Overrides:
setInput in class EditorPart
Parameters:
input - the editor input
See Also:
EditorPart.setInputWithNotify(IEditorInput)

getText

protected 
String getText()
Return the text to be displayed in this editor. The text is reset each time the editor input is set.

Returns:
the text to be displayed in this editor

closeEditor

protected void closeEditor()
Closes this editor.


dispose

public void dispose()
Description copied from class: WorkbenchPart
The WorkbenchPart implementation of this IWorkbenchPart method disposes the title image loaded by setInitializationData. Subclasses may extend.

Specified by:
dispose in interface IWorkbenchPart
Overrides:
dispose in class WorkbenchPart

getArtifact

protected 
Object getArtifact()
Returns the artifact this editor was opened for (i.e. the artifact that source was not found for), or null

Returns:
artifact with associated source or null

initialize

protected void initialize()
Initialize this editor. Called after init(IEditorSite, IEditorInput). By default, a launch listener is added to close this editor when the associated launch terminates. Subclasses may override.


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