Skip to content

Instantly share code, notes, and snippets.

DinisCruz-Dev

Block or report user

Report or block DinisCruz-Dev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1. Eclipse - Groovy script to refresh browser on save.groovy
def editorTitle = "Firebase_Login.html"
import java.nio.file.*;
import com.sun.nio.file.*
def refreshBrowser = { path ->
eclipse.log("Opening browser with: " + path);
eclipse.views.create(path).clear().add.browser().open(path);
};
@DinisCruz-Dev
DinisCruz-Dev / 1. Get request with current data.groovy
Last active Oct 10, 2015
Misc Groovy Scripts that invoke the Firebase APIs
View 1. Get request with current data.groovy
def firebaseJsonData = "https://incandescent-fire-1320.firebaseio.com/.json?print=pretty"
def data = firebaseJsonData.toURL().getText()
return data;
@DinisCruz-Dev
DinisCruz-Dev / eclipse_karma_views.groovy
Last active Aug 29, 2015
Create a Eclipse views to show AngularJS tests executed with Karma
View eclipse_karma_views.groovy
eclipse.views.create("Karma Runner")
.clear()
.add.browser()
.open("http://localhost:9879/__karma/")
eclipse.views.create("Website")
.clear()
.add.browser()
.open("http://localhost:9879/index.html")
View 1.original sample code.html
<!DOCTYPE html>
<meta charset="utf-8" >
<title>WebSocket Test></title>
<script language="javascript" type="text/javascript">
var wsUri = "ws://echo.websocket.org/";
var output;
View 1. dynamically add a panel and a Browser.java
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()) {
@DinisCruz-Dev
DinisCruz-Dev / 1.a. execute groovy from Groovy Script.java
Last active Dec 28, 2015
SWTBot scritps (inside TeamMentor Eclipse Plugin)
View 1.a. execute groovy from Groovy Script.java
//run these first (so that the code below compiles)
eclipseAPI.extraGroovyJars =
[ "/Users/plugin/_Dev/eclipses/Kepler/plugins/org.eclipse.swtbot.eclipse.finder_2.1.2.201311041021.jar" ,
"/Users/plugin/_Dev/eclipses/Kepler/plugins/org.eclipse.swtbot.swt.finder_2.1.2.201311041021.jar" ,
"/Users/plugin/_Dev/eclipses/Kepler/plugins/org.apache.log4j_1.2.15.v201012070815.jar" ]
def groovyExecution = view.groovyExecution;
def groovyShell = groovyExecution.groovyShell;
//def jar = "asd";
You can’t perform that action at this time.