|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
com.aptana.ide.core.ui.views.fileexplorer.FileExplorerView
public class FileExplorerView
This sample class demonstrates how to plug-in a new workbench view. The view shows data obtained from the model. The sample creates a dummy model on the fly, but a real implementation would connect to the model available either in this or another plug-in (e.g. the workspace). The view is connected to the model using a content provider.
The view uses a label provider to define how model objects should be presented in the view. Each view can present the same model objects using different labels and icons, if needed. Alternatively, a single label provider can be shared between views in order to ensure that objects of the same type are presented in the same way everywhere.
| Nested Class Summary | |
|---|---|
protected class |
FileExplorerView.NewButtonAction
|
class |
FileExplorerView.NewWizardMenu
A NewWizardMenu augments BaseNewWizardMenu with IDE-specific actions: New
Project... |
| Field Summary | |
|---|---|
static java.lang.String |
ID
ID |
static java.lang.String |
lastSelected
lastSelected |
static int |
secondaryIdCounter
secondaryIdCounter |
protected boolean |
showLocalEndpoints
showLocalEndpoints |
| Fields inherited from interface com.aptana.ide.core.io.sync.ISyncManagerChangeListener |
|---|
ADD, DELETE, EDIT |
| Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
|---|
PROP_TITLE |
| Constructor Summary | |
|---|---|
FileExplorerView()
The constructor. |
|
| Method Summary | |
|---|---|
void |
createPartControl(org.eclipse.swt.widgets.Composite parent)
This is a callback that will allow us to create the viewer and initialize it. |
protected org.eclipse.jface.viewers.TreeViewer |
createViewer(org.eclipse.swt.widgets.Composite parent)
Creates the viewer. |
void |
dispose()
|
org.eclipse.swt.widgets.TreeItem |
findTreeItem(org.eclipse.swt.widgets.TreeItem[] treeItems,
java.lang.Object dataToFind)
Find the action set for the given name |
protected java.lang.String |
getStatusLineMessage(org.eclipse.jface.viewers.IStructuredSelection selection)
Returns the message to show in the status line. |
org.eclipse.jface.viewers.TreeViewer |
getViewer()
|
IVirtualFile[] |
getVirtualFilesProtected(IVirtualFile source)
getVirtualFilesProtected |
protected void |
handleDrop(org.eclipse.swt.dnd.DropTargetEvent event)
handleDrop |
protected void |
handleKeyPressed(org.eclipse.swt.events.KeyEvent event)
Handles a key press event from the viewer. |
protected void |
handleKeyReleased(org.eclipse.swt.events.KeyEvent event)
Handles a key release in the viewer. |
protected void |
handleSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Handles a selection changed event from the viewer. |
void |
init(org.eclipse.ui.IViewSite site,
org.eclipse.ui.IMemento memento)
|
protected void |
initLabelProvider(org.eclipse.jface.viewers.TreeViewer viewer)
initLabelProvider |
protected void |
initListeners(org.eclipse.jface.viewers.TreeViewer viewer)
Adds the listeners to the viewer. |
void |
openFileInEditor(IVirtualFile file)
openFileInEditor |
void |
refresh()
Deprecated. (use refresh with passing in an object |
void |
refresh(java.lang.Object toRefresh)
refresh |
void |
saveState(org.eclipse.ui.IMemento memento)
|
void |
setFocus()
Passing the focus request to the viewer's control. |
void |
setViewer(org.eclipse.jface.viewers.TreeViewer viewer)
|
void |
syncManagerEvent(java.lang.Object obj,
int actionId)
syncManagerEvent |
protected void |
updateActionBars(org.eclipse.jface.viewers.IStructuredSelection selection)
Updates the action bar actions. |
protected void |
updateStatusLine(org.eclipse.jface.viewers.IStructuredSelection selection)
Updates the message shown in the status line. |
| Methods inherited from class org.eclipse.ui.part.ViewPart |
|---|
checkSite, getViewSite, init, 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 |
|---|
public static java.lang.String lastSelected
public static int secondaryIdCounter
public static final java.lang.String ID
protected boolean showLocalEndpoints
| Constructor Detail |
|---|
public FileExplorerView()
| Method Detail |
|---|
public void dispose()
dispose in interface org.eclipse.ui.IWorkbenchPartdispose in class org.eclipse.ui.part.WorkbenchPartWorkbenchPart.dispose()
public void syncManagerEvent(java.lang.Object obj,
int actionId)
syncManagerEvent in interface ISyncManagerChangeListenerobj - actionId - public void createPartControl(org.eclipse.swt.widgets.Composite parent)
createPartControl in interface org.eclipse.ui.IWorkbenchPartcreatePartControl in class org.eclipse.ui.part.WorkbenchPartparent - protected org.eclipse.jface.viewers.TreeViewer createViewer(org.eclipse.swt.widgets.Composite parent)
parent - the parent composite
protected void initLabelProvider(org.eclipse.jface.viewers.TreeViewer viewer)
viewer - protected void initListeners(org.eclipse.jface.viewers.TreeViewer viewer)
viewer - the viewerprotected void handleKeyPressed(org.eclipse.swt.events.KeyEvent event)
event - the key eventprotected void handleSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
event - the selection eventprotected void updateActionBars(org.eclipse.jface.viewers.IStructuredSelection selection)
selection - the current selectionprotected void updateStatusLine(org.eclipse.jface.viewers.IStructuredSelection selection)
selection - the current selectionprotected java.lang.String getStatusLineMessage(org.eclipse.jface.viewers.IStructuredSelection selection)
selection - the current selection
protected void handleKeyReleased(org.eclipse.swt.events.KeyEvent event)
event - the key eventprotected void handleDrop(org.eclipse.swt.dnd.DropTargetEvent event)
event -
public IVirtualFile[] getVirtualFilesProtected(IVirtualFile source)
throws java.io.IOException
source -
java.io.IOExceptionpublic void refresh()
refresh in interface IRefreshableViewpublic void refresh(java.lang.Object toRefresh)
toRefresh - public void openFileInEditor(IVirtualFile file)
file - public void setFocus()
setFocus in interface org.eclipse.ui.IWorkbenchPartsetFocus in class org.eclipse.ui.part.WorkbenchPart
public void init(org.eclipse.ui.IViewSite site,
org.eclipse.ui.IMemento memento)
throws org.eclipse.ui.PartInitException
init in interface org.eclipse.ui.IViewPartinit in class org.eclipse.ui.part.ViewPartorg.eclipse.ui.PartInitExceptionIViewPart.init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)public void saveState(org.eclipse.ui.IMemento memento)
saveState in interface org.eclipse.ui.IPersistablesaveState in interface org.eclipse.ui.IViewPartsaveState in class org.eclipse.ui.part.ViewPartIPersistable.saveState(org.eclipse.ui.IMemento)public org.eclipse.jface.viewers.TreeViewer getViewer()
public void setViewer(org.eclipse.jface.viewers.TreeViewer viewer)
viewer - The viewer to set.
public org.eclipse.swt.widgets.TreeItem findTreeItem(org.eclipse.swt.widgets.TreeItem[] treeItems,
java.lang.Object dataToFind)
treeItems - dataToFind -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||