Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Context Menu Contributions for accessing File and Project Wizards Preliminary support for an Outline View
- Loading branch information
jasonsantos
committed
Jan 30, 2009
1 parent
b0f42ec
commit 4fe762e
Showing
10 changed files
with
286 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
org.keplerproject.ldt.ui/src/org/keplerproject/ldt/ui/LuaPerspective.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
package org.keplerproject.ldt.ui; | ||
|
||
import org.eclipse.ui.IFolderLayout; | ||
import org.eclipse.ui.IPageLayout; | ||
import org.eclipse.ui.IPerspectiveFactory; | ||
import org.eclipse.ui.console.IConsoleConstants; | ||
import org.keplerproject.ldt.ui.wizards.LuaFileWizard; | ||
import org.keplerproject.ldt.ui.wizards.LuaProjectWizard; | ||
|
||
public class LuaPerspective implements IPerspectiveFactory { | ||
|
||
|
||
private IPageLayout factory; | ||
|
||
public LuaPerspective() { | ||
super(); | ||
} | ||
|
||
public void createInitialLayout(IPageLayout factory) { | ||
this.factory = factory; | ||
addViews(); | ||
addActionSets(); | ||
addNewWizardShortcuts(); | ||
addPerspectiveShortcuts(); | ||
addViewShortcuts(); | ||
} | ||
|
||
private void addViews() { | ||
// Creates the overall folder layout. | ||
// Note that each new Folder uses a percentage of the remaining | ||
// EditorArea. | ||
|
||
IFolderLayout bottom = factory.createFolder("bottomRight", // NON-NLS-1 | ||
IPageLayout.BOTTOM, 0.75f, factory.getEditorArea()); | ||
|
||
bottom.addView(IPageLayout.ID_PROBLEM_VIEW); | ||
bottom.addView("org.eclipse.team.ui.GenericHistoryView"); // NON-NLS-1 | ||
bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); | ||
|
||
IFolderLayout topLeft = factory.createFolder("topLeft", // NON-NLS-1 | ||
IPageLayout.LEFT, 0.25f, factory.getEditorArea()); | ||
|
||
topLeft.addView(IPageLayout.ID_RES_NAV); | ||
|
||
IFolderLayout topRight = factory.createFolder("topRight", // NON-NLS-1 | ||
IPageLayout.RIGHT, 0.75f, factory.getEditorArea()); | ||
|
||
topRight.addView(IPageLayout.ID_OUTLINE); | ||
|
||
factory.addFastView("org.eclipse.team.ccvs.ui.RepositoriesView", 0.50f); // NON-NLS-1 | ||
factory.addFastView("org.eclipse.team.sync.views.SynchronizeView", | ||
0.50f); // NON-NLS-1 | ||
} | ||
|
||
private void addActionSets() { | ||
factory.addActionSet("org.eclipse.debug.ui.launchActionSet"); // NON-NLS-1 | ||
factory.addActionSet("org.eclipse.debug.ui.debugActionSet"); // NON-NLS-1 | ||
factory.addActionSet("org.eclipse.debug.ui.profileActionSet"); // NON-NLS-1 | ||
factory.addActionSet("org.eclipse.team.ui.actionSet"); // NON-NLS-1 | ||
factory.addActionSet("org.eclipse.team.cvs.ui.CVSActionSet"); // NON-NLS-1 | ||
factory.addActionSet("org.eclipse.ant.ui.actionSet.presentation"); // NON-NLS-1 | ||
factory.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); // NON-NLS-1 | ||
} | ||
|
||
private void addPerspectiveShortcuts() { | ||
factory | ||
.addPerspectiveShortcut("org.eclipse.team.ui.TeamSynchronizingPerspective"); // NON-NLS-1 | ||
factory | ||
.addPerspectiveShortcut("org.eclipse.team.cvs.ui.cvsPerspective"); // NON-NLS-1 | ||
factory.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); // NON-NLS-1 | ||
} | ||
|
||
private void addNewWizardShortcuts() { | ||
|
||
factory.addNewWizardShortcut(LuaProjectWizard.WIZARD_ID); | ||
factory.addNewWizardShortcut(LuaFileWizard.WIZARD_ID); | ||
// factory.addNewWizardShortcut(RubyNewModuleWizard.WIZARD_ID); | ||
// factory.addNewWizardShortcut(RubyNewFileWizard.WIZARD_ID); | ||
|
||
factory | ||
.addNewWizardShortcut("org.eclipse.team.cvs.ui.newProjectCheckout");// NON-NLS-1 | ||
factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");// NON-NLS-1 | ||
factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");// NON-NLS-1 | ||
} | ||
|
||
private void addViewShortcuts() { | ||
factory.addShowViewShortcut("org.eclipse.team.ccvs.ui.AnnotateView"); // NON-NLS-1 | ||
factory.addShowViewShortcut("org.eclipse.team.ui.GenericHistoryView"); // NON-NLS-1 | ||
factory.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); | ||
factory.addShowViewShortcut(IPageLayout.ID_RES_NAV); | ||
factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); | ||
factory.addShowViewShortcut(IPageLayout.ID_OUTLINE); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
org.keplerproject.ldt.ui/src/org/keplerproject/ldt/ui/editors/LuaOutlinePage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.keplerproject.ldt.ui.editors; | ||
|
||
import org.eclipse.jface.viewers.TreeViewer; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.ui.IEditorInput; | ||
import org.eclipse.ui.texteditor.IDocumentProvider; | ||
import org.eclipse.ui.views.contentoutline.ContentOutlinePage; | ||
import org.eclipse.ui.views.contentoutline.IContentOutlinePage; | ||
import org.keplerproject.ldt.ui.editors.outline.LuaOutlineContentProvider; | ||
import org.keplerproject.ldt.ui.editors.outline.LuaOutlineLabelProvider; | ||
|
||
public class LuaOutlinePage extends ContentOutlinePage implements | ||
IContentOutlinePage { | ||
|
||
IEditorInput in; | ||
|
||
public LuaOutlinePage(IDocumentProvider documentProvider, | ||
LuaEditor luaEditor) { | ||
super(); | ||
} | ||
|
||
public void setInput(IEditorInput editorInput) { | ||
in = editorInput; | ||
System.out.println("setInput"); | ||
} | ||
|
||
private void sysout(String name) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
public void createControl(Composite parent) { | ||
super.createControl(parent); | ||
TreeViewer viewer= getTreeViewer(); | ||
viewer.setContentProvider(new LuaOutlineContentProvider()); | ||
viewer.setLabelProvider(new LuaOutlineLabelProvider()); | ||
viewer.addSelectionChangedListener(this); | ||
viewer.setInput(in); | ||
} | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...roject.ldt.ui/src/org/keplerproject/ldt/ui/editors/outline/LuaOutlineContentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.keplerproject.ldt.ui.editors.outline; | ||
|
||
import org.eclipse.jface.viewers.IContentProvider; | ||
import org.eclipse.jface.viewers.ITreeContentProvider; | ||
import org.eclipse.jface.viewers.Viewer; | ||
|
||
public class LuaOutlineContentProvider implements ITreeContentProvider { | ||
|
||
public void dispose() { | ||
} | ||
|
||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { | ||
// TODO Auto-generated method stub | ||
System.out.println(oldInput.toString() + '>'+ newInput.toString()); | ||
} | ||
|
||
public Object[] getChildren(Object parentElement) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
public Object getParent(Object element) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
public boolean hasChildren(Object element) { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
public Object[] getElements(Object inputElement) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...rproject.ldt.ui/src/org/keplerproject/ldt/ui/editors/outline/LuaOutlineLabelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.keplerproject.ldt.ui.editors.outline; | ||
|
||
import org.eclipse.jface.viewers.IBaseLabelProvider; | ||
import org.eclipse.jface.viewers.ILabelProviderListener; | ||
|
||
public class LuaOutlineLabelProvider implements IBaseLabelProvider { | ||
|
||
public void addListener(ILabelProviderListener listener) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
public void dispose() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
public boolean isLabelProperty(Object element, String property) { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
public void removeListener(ILabelProviderListener listener) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters