Created
November 15, 2013 13:20
-
-
Save DinisCruz-Dev/7484223 to your computer and use it in GitHub Desktop.
Misc SWTBot scripts
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
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.browser.Browser; | |
import org.eclipse.swt.widgets.*; | |
import org.eclipse.swt.graphics.Rectangle; | |
import org.eclipse.jface.action.Action; | |
import org.eclipse.ui.internal.about.*; | |
def panel = eclipseAPI.panels.add_Panel("asd_2 123"); | |
for (def control : panel.composite.getChildren()) { | |
control.dispose(); | |
} | |
//action.setImageDescriptor(Activator.getImageDescriptor("icons/bomb.png")); | |
eclipseAPI.display.asyncExec(new Runnable() { public void run() | |
{ | |
def toolBarManager = panel.getViewSite().getActionBars().getToolBarManager(); | |
AboutAction action = new AboutAction(eclipseAPI.workbench); | |
action.setText("Open Dialog Box"); | |
panel.getViewSite().getActionBars().getMenuManager().add(action) | |
toolBarManager.add(action) | |
panel.composite.layout(); | |
}}); | |
return "before browser"; | |
browser = new Browser(panel.composite,SWT.BORDER); | |
browser.setUrl("https://www.google.com") | |
return "done"; |
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
import tm.eclipse.ui.editors.*; | |
import org.eclipse.ui.internal.part.* | |
import org.eclipse.ui.part.*; | |
//def temp = File.createTempFile('temp', '.txt') | |
def file = (IFile)new File("/var/folders/zh/qgm2kkxx5cvb9rm2fcvz4h4r0000gp/T/temp5549342615964988814.txt"); | |
return new FileEditorInput(file); | |
return temp; | |
def editorInput = new NullEditorInput(); | |
//return new MyEditor(); | |
def myEditor = new MyEditor(); | |
//return myEditor; | |
return eclipseAPI.activePage().openEditor(editorInput, myEditor.ID); | |
———— | |
import tm.eclipse.ui.editors.*; | |
import org.eclipse.ui.internal.part.* | |
import org.eclipse.ui.part.*; | |
def filePath = "/var/folders/zh/qgm2kkxx5cvb9rm2fcvz4h4r0000gp/T/temp5549342615964988814.txt"; | |
def file = new File(filePath); | |
def fileEditorInput = eclipseAPI.files.to_FileStoreEditorInput(filePath); | |
def myEditor = new MyEditor(); | |
//return myEditor; | |
return eclipseAPI.activePage().openEditor(fileEditorInput, myEditor.ID); | |
return fileEditorInput |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment