forked from bioclipse/bioclipse.qsar
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a QSAR perspective. Solves 1554.
- Loading branch information
Showing
2 changed files
with
101 additions
and
0 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
92 changes: 92 additions & 0 deletions
92
plugins/net.bioclipse.qsar.ui/src/net/bioclipse/qsar/ui/QSARPerspective.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,92 @@ | ||
package net.bioclipse.qsar.ui; | ||
|
||
import org.eclipse.ui.IFolderLayout; | ||
import org.eclipse.ui.IPageLayout; | ||
import org.eclipse.ui.IPerspectiveFactory; | ||
|
||
/** | ||
* | ||
* @author ola | ||
* | ||
*/ | ||
public class QSARPerspective implements IPerspectiveFactory { | ||
|
||
IPageLayout storedLayout; | ||
|
||
/** | ||
* This perspective's ID | ||
*/ | ||
public static final String ID_PERSPECTIVE = | ||
"net.bioclipse.qsar.ui.QSARPerspective"; | ||
|
||
public static final String ID_NAVIGATOR = | ||
"net.bioclipse.navigator"; | ||
|
||
public static final String ID_JAVSCRIPT_CONSOLE = | ||
"net.bioclipse.scripting.ui.views.JsConsoleView"; | ||
|
||
/** | ||
* Create initial layout | ||
*/ | ||
public void createInitialLayout(IPageLayout layout) { | ||
defineActions(layout); | ||
defineLayout(layout); | ||
} | ||
|
||
private void defineLayout( IPageLayout layout ) { | ||
|
||
String editorArea = layout.getEditorArea(); | ||
layout.setEditorAreaVisible(true); | ||
layout.setFixed(false); | ||
layout.addPerspectiveShortcut(ID_PERSPECTIVE); | ||
|
||
//Add layouts for views | ||
IFolderLayout left_folder_layout = | ||
layout.createFolder( | ||
"explorer", | ||
IPageLayout.LEFT, | ||
0.20f, | ||
editorArea); | ||
|
||
IFolderLayout bottom_folder_layout = | ||
layout.createFolder( | ||
"bottom", | ||
IPageLayout.BOTTOM, | ||
0.70f, | ||
editorArea); | ||
|
||
IFolderLayout right_bottom_folder_layout = | ||
layout.createFolder( | ||
"rightbottom", | ||
IPageLayout.RIGHT, | ||
0.70f, | ||
"bottom"); | ||
|
||
// IFolderLayout right_folder_layout = | ||
// layout.createFolder( | ||
// "right", | ||
// IPageLayout.RIGHT, | ||
// 0.70f, | ||
// editorArea); | ||
|
||
//Add views | ||
left_folder_layout.addView(ID_NAVIGATOR); | ||
bottom_folder_layout.addView(ID_JAVSCRIPT_CONSOLE); | ||
right_bottom_folder_layout.addView(IPageLayout.ID_PROGRESS_VIEW); | ||
// right_folder_layout.addView(IPageLayout.ID_OUTLINE); | ||
|
||
} | ||
|
||
private void defineActions( IPageLayout layout ) { | ||
|
||
|
||
//Add ShowView shortcuts | ||
layout.addShowViewShortcut(ID_NAVIGATOR); | ||
layout.addShowViewShortcut(ID_JAVSCRIPT_CONSOLE); | ||
layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); | ||
layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); | ||
layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); | ||
layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); | ||
|
||
} | ||
} |