Skip to content

Commit a3e8a4b

Browse files
committed
Fixed some warnings; changed to arduino perspective
1 parent 7685ad8 commit a3e8a4b

File tree

5 files changed

+62
-46
lines changed

5 files changed

+62
-46
lines changed

it.baeyens.arduino.application/src/it/baeyens/arduino/application/Application.java

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,42 @@
1111
*/
1212
public class Application implements IApplication {
1313

14-
/* (non-Javadoc)
15-
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
16-
*/
17-
public Object start(IApplicationContext context) throws Exception {
18-
Display display = PlatformUI.createDisplay();
19-
try {
20-
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
21-
if (returnCode == PlatformUI.RETURN_RESTART)
22-
return IApplication.EXIT_RESTART;
23-
else
24-
return IApplication.EXIT_OK;
25-
} finally {
26-
display.dispose();
27-
}
28-
14+
/*
15+
* (non-Javadoc)
16+
*
17+
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
18+
*/
19+
@Override
20+
public Object start(IApplicationContext context) throws Exception {
21+
Display display = PlatformUI.createDisplay();
22+
try {
23+
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
24+
if (returnCode == PlatformUI.RETURN_RESTART)
25+
return IApplication.EXIT_RESTART;
26+
return IApplication.EXIT_OK;
27+
} finally {
28+
display.dispose();
2929
}
3030

31-
/* (non-Javadoc)
32-
* @see org.eclipse.equinox.app.IApplication#stop()
33-
*/
34-
public void stop() {
35-
if (!PlatformUI.isWorkbenchRunning())
36-
return;
37-
final IWorkbench workbench = PlatformUI.getWorkbench();
38-
final Display display = workbench.getDisplay();
39-
display.syncExec(new Runnable() {
40-
public void run() {
41-
if (!display.isDisposed())
42-
workbench.close();
43-
}
44-
});
45-
}
31+
}
32+
33+
/*
34+
* (non-Javadoc)
35+
*
36+
* @see org.eclipse.equinox.app.IApplication#stop()
37+
*/
38+
@Override
39+
public void stop() {
40+
if (!PlatformUI.isWorkbenchRunning())
41+
return;
42+
final IWorkbench workbench = PlatformUI.getWorkbench();
43+
final Display display = workbench.getDisplay();
44+
display.syncExec(new Runnable() {
45+
@Override
46+
public void run() {
47+
if (!display.isDisposed())
48+
workbench.close();
49+
}
50+
});
51+
}
4652
}

it.baeyens.arduino.application/src/it/baeyens/arduino/application/ApplicationActionBarAdvisor.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
99

1010
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
11-
super(configurer);
11+
super(configurer);
1212
}
1313

14+
@Override
1415
protected void makeActions(IWorkbenchWindow window) {
16+
// Not sure wether something is needed here JABA
1517
}
1618

19+
@Override
1720
protected void fillMenuBar(IMenuManager menuBar) {
21+
// Not sure wether something is needed here JABA
1822
}
19-
23+
2024
}

it.baeyens.arduino.application/src/it/baeyens/arduino/application/ApplicationWorkbenchAdvisor.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
88

9-
private static final String PERSPECTIVE_ID = "it.baeyens.arduino.application.perspective"; //$NON-NLS-1$
9+
private static final String PERSPECTIVE_ID = "it.baeyens.arduino.application.perspective"; //$NON-NLS-1$
1010

11+
@Override
1112
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
12-
return new ApplicationWorkbenchWindowAdvisor(configurer);
13+
return new ApplicationWorkbenchWindowAdvisor(configurer);
1314
}
1415

15-
public String getInitialWindowPerspectiveId() {
16-
return PERSPECTIVE_ID;
17-
}
16+
@Override
17+
public String getInitialWindowPerspectiveId() {
18+
return PERSPECTIVE_ID;
19+
}
1820
}

it.baeyens.arduino.application/src/it/baeyens/arduino/application/ApplicationWorkbenchWindowAdvisor.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
1010

1111
public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
12-
super(configurer);
12+
super(configurer);
1313
}
1414

15+
@Override
1516
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
16-
return new ApplicationActionBarAdvisor(configurer);
17+
return new ApplicationActionBarAdvisor(configurer);
1718
}
18-
19+
20+
@Override
1921
public void preWindowOpen() {
20-
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
21-
configurer.setInitialSize(new Point(400, 300));
22-
configurer.setShowCoolBar(true);
23-
configurer.setShowStatusLine(true);
22+
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
23+
configurer.setInitialSize(new Point(400, 300));
24+
configurer.setShowCoolBar(true);
25+
configurer.setShowStatusLine(true);
2426
}
2527
}

it.baeyens.arduino.application/src/it/baeyens/arduino/application/Perspective.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
public class Perspective implements IPerspectiveFactory {
77

8-
public void createInitialLayout(IPageLayout layout) {
9-
}
8+
@Override
9+
public void createInitialLayout(IPageLayout layout) {
10+
// TODO add scope and serial monitor
11+
}
1012
}

0 commit comments

Comments
 (0)