Skip to content

Commit 0fb7a58

Browse files
committed
Removed warnings as much as I can.
Added a format file Changed readme to contain instructions for the format file.
1 parent de10f56 commit 0fb7a58

File tree

10 files changed

+252
-277
lines changed

10 files changed

+252
-277
lines changed

clientdb.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<com.ibm.magnolia.clientmodel:ClientModelRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:com.ibm.magnolia.clientmodel="http:///com/ibm/magnolia/clientmodel.ecore">
33
<workItemEditorHistory>
4+
<internalContents date="2013-10-22T23:35:24.189+0200" description="286: issue 26 on github Create new sketch and name start with numbers -> problematic" repository="https://clm.jkebanking.net/ccm/">
5+
<workItem itemId="_q5TQkDthEeOVS9Zte3uxGA"/>
6+
</internalContents>
47
<internalContents date="2013-10-22T23:24:44.074+0200" description="285: synck with github" repository="https://clm.jkebanking.net/ccm/">
58
<workItem itemId="_JX3WsDtgEeOVS9Zte3uxGA"/>
69
</internalContents>

it.baeyens.arduino.core/src/it/baeyens/arduino/tools/PdePreprocessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ protected static void writeProgram(PrintStream out, String program, List<String>
226226
* PrintStream to write it to.
227227
*/
228228
protected void writeFooter(PrintStream out) throws java.lang.Exception {
229+
// TODO write this code
229230
}
230231

231232
public List<String> getExtraImports() {
Lines changed: 49 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package it.baeyens.arduino.ui;
22

3-
import it.baeyens.arduino.common.ArduinoConst;
43
import it.baeyens.arduino.common.Common;
54

65
import org.eclipse.core.resources.IProject;
7-
import org.eclipse.core.runtime.IStatus;
8-
import org.eclipse.core.runtime.Status;
96
import org.eclipse.jface.dialogs.IDialogSettings;
107
import org.eclipse.jface.viewers.IStructuredSelection;
118
import org.eclipse.jface.viewers.StructuredSelection;
@@ -18,13 +15,9 @@
1815
import org.eclipse.ui.IWorkbench;
1916

2017
/**
21-
* Import_Arduino_Libraries class is the class linked to the GUI related to the
22-
* Arduino library import. It creates one page. There is an important processing
23-
* when opened and on the perform finish.
24-
* This import wizard uses 3 folders to import:
25-
* The arduino library folder
26-
* Your 3rd party library folder and the
27-
* Arduino library folder of your hardware
18+
* Import_Arduino_Libraries class is the class linked to the GUI related to the Arduino library import. It creates one page. There is an important
19+
* processing when opened and on the perform finish. This import wizard uses 3 folders to import: The arduino library folder Your 3rd party library
20+
* folder and the Arduino library folder of your hardware
2821
*
2922
* @author Jan Baeyens
3023
* @see performFinish
@@ -41,32 +34,30 @@ public class Import_Arduino_Libraries implements IImportWizard {
4134

4235
@Override
4336
public void init(IWorkbench arg0, IStructuredSelection selection) {
44-
//Entry point is here when right-click project and import -- as opposed to AddLibraryAction.execute() when done via Arduino menu
37+
// Entry point is here when right-click project and import -- as opposed to AddLibraryAction.execute() when done via Arduino menu
4538
}
4639

4740
@Override
4841
public void addPages() {
49-
50-
//Always create the pages like this at the last minute
51-
52-
IProject theProject = null;
53-
IProject SelectedProjects[] = Common.getSelectedProjects();
54-
55-
if (SelectedProjects.length > 0)
56-
{
57-
theProject = SelectedProjects[0];
58-
mProjectSelectionPage = new Wizard_Select_Libraries_Page(theProject,
59-
mPageName, StructuredSelection.EMPTY);
60-
mProjectSelectionPage.setWizard(this);
61-
mPages = new IWizardPage[1];
62-
mPages[0] = mProjectSelectionPage;
63-
mProjectSelectionPage.setImportProject(SelectedProjects[0]);
64-
}
42+
43+
// Always create the pages like this at the last minute
44+
45+
IProject theProject = null;
46+
IProject SelectedProjects[] = Common.getSelectedProjects();
47+
48+
if (SelectedProjects.length > 0) {
49+
theProject = SelectedProjects[0];
50+
mProjectSelectionPage = new Wizard_Select_Libraries_Page(theProject, mPageName, StructuredSelection.EMPTY);
51+
mProjectSelectionPage.setWizard(this);
52+
mPages = new IWizardPage[1];
53+
mPages[0] = mProjectSelectionPage;
54+
mProjectSelectionPage.setImportProject(SelectedProjects[0]);
55+
}
6556
}
6657

6758
@Override
6859
public boolean canFinish() {
69-
return mProjectSelectionPage.canFinish();
60+
return mProjectSelectionPage.canFinish();
7061
}
7162

7263
@Override
@@ -80,101 +71,100 @@ public void dispose() {// no code needed
8071

8172
@Override
8273
public IWizardContainer getContainer() {
83-
return mWizardContainer;
74+
return mWizardContainer;
8475
}
8576

8677
@Override
8778
public Image getDefaultPageImage() {
88-
return null;
79+
return null;
8980
}
9081

9182
@Override
9283
public IDialogSettings getDialogSettings() {
93-
return null;
84+
return null;
9485
}
9586

9687
@Override
9788
public IWizardPage getNextPage(IWizardPage arg0) {
98-
for (int i = 0; i < (mPages.length - 1); i++) {
99-
if (arg0 == mPages[i])
100-
{
101-
return mPages[i + 1];
102-
}
103-
}
104-
return null;
89+
for (int i = 0; i < (mPages.length - 1); i++) {
90+
if (arg0 == mPages[i]) {
91+
return mPages[i + 1];
92+
}
93+
}
94+
return null;
10595
}
10696

10797
@Override
10898
public IWizardPage getPage(String pageName) {
109-
for (int i = 0; i < mPages.length; i++) {
110-
if (pageName == mPages[i].getName())
111-
return mPages[i];
112-
}
113-
return null;
99+
for (int i = 0; i < mPages.length; i++) {
100+
if (pageName == mPages[i].getName())
101+
return mPages[i];
102+
}
103+
return null;
114104
}
115105

116106
@Override
117107
public int getPageCount() {
118-
return mPages.length;
108+
return mPages.length;
119109
}
120110

121111
@Override
122112
public IWizardPage[] getPages() {
123-
return mPages;
113+
return mPages;
124114
}
125115

126116
@Override
127117
public IWizardPage getPreviousPage(IWizardPage arg0) {
128-
for (int i = 1; i < mPages.length; i++) {
129-
if (arg0 == mPages[i])
130-
return mPages[i - 1];
131-
}
132-
return null;
118+
for (int i = 1; i < mPages.length; i++) {
119+
if (arg0 == mPages[i])
120+
return mPages[i - 1];
121+
}
122+
return null;
133123
}
134124

135125
@Override
136126
public IWizardPage getStartingPage() {
137-
return mPages[0];
127+
return mPages[0];
138128
}
139129

140130
@Override
141131
public RGB getTitleBarColor() {
142-
return null;
132+
return null;
143133
}
144134

145135
@Override
146136
public String getWindowTitle() {
147-
return mPageTitle;
137+
return mPageTitle;
148138
}
149139

150140
@Override
151141
public boolean isHelpAvailable() {
152-
return false;
142+
return false;
153143
}
154144

155145
@Override
156146
public boolean needsPreviousAndNextButtons() {
157-
return false;
147+
return false;
158148
}
159149

160150
@Override
161151
public boolean needsProgressMonitor() {
162-
return false;
152+
return false;
163153
}
164154

165155
@Override
166156
public boolean performCancel() {
167-
return true;
157+
return true;
168158
}
169159

170160
@Override
171161
public boolean performFinish() {
172-
return mProjectSelectionPage.PerformFinish();
162+
return mProjectSelectionPage.PerformFinish();
173163
}
174164

175165
@Override
176166
public void setContainer(IWizardContainer wizardContainer) {
177-
mWizardContainer = wizardContainer;
167+
mWizardContainer = wizardContainer;
178168
}
179169

180170
}

it.baeyens.arduino.core/src/it/baeyens/arduino/ui/Import_Source_Folder_Page.java

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
import it.baeyens.arduino.common.ArduinoConst;
44
import it.baeyens.arduino.common.ArduinoInstancePreferences;
5-
import it.baeyens.arduino.common.Common;
65

76
import org.eclipse.core.resources.IProject;
8-
import org.eclipse.core.runtime.IStatus;
9-
import org.eclipse.core.runtime.Status;
107
import org.eclipse.jface.viewers.IStructuredSelection;
118
import org.eclipse.jface.viewers.ITreeContentProvider;
129
import org.eclipse.swt.SWT;
@@ -26,46 +23,41 @@
2623
//TODO: Or Arduino_Source_Folder_Import_Page
2724

2825
/**
29-
* Import_Source_Folder_Page is the one and only page in the source folder import
30-
* wizard. It controls a text field and a browse button.
26+
* Import_Source_Folder_Page is the one and only page in the source folder import wizard. It controls a text field and a browse button.
3127
*
3228
* @author Jan Baeyens
3329
*
3430
*/
3531
public class Import_Source_Folder_Page extends WizardResourceImportPage {
3632
protected Text controlLibraryPath;
3733
private Button controlBrowseButton;
38-
34+
3935
private IProject mProject = null;
4036

41-
protected Import_Source_Folder_Page(IProject project, String name,
42-
IStructuredSelection selection) {
43-
44-
super(name, selection);
45-
46-
setImportProject(project);
47-
if (mProject == null) {
48-
setTitle("Error no project selected to import to");
49-
setDescription("As no project is selected it is not possible to import a source folder");
50-
} else {
51-
setTitle("Import Source Folder");
52-
setDescription("Use this page to select a source folder to import to project"
53-
+ mProject.getName());
54-
}
37+
protected Import_Source_Folder_Page(IProject project, String name, IStructuredSelection selection) {
38+
39+
super(name, selection);
40+
41+
setImportProject(project);
42+
if (mProject == null) {
43+
setTitle("Error no project selected to import to");
44+
setDescription("As no project is selected it is not possible to import a source folder");
45+
} else {
46+
setTitle("Import Source Folder");
47+
setDescription("Use this page to select a source folder to import to project" + mProject.getName());
48+
}
5549

5650
}
5751

5852
@Override
5953
protected void createSourceGroup(Composite parent) {
60-
61-
54+
6255
Composite composite = new Composite(parent, SWT.NONE);
6356
GridLayout theGridLayout = new GridLayout();
6457
GridData theGriddata;
6558
theGridLayout.numColumns = 3;
6659
composite.setLayout(theGridLayout);
67-
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
68-
| GridData.GRAB_HORIZONTAL));
60+
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
6961
composite.setFont(parent.getFont());
7062

7163
Label line = new Label(composite, SWT.HORIZONTAL | SWT.BOLD);
@@ -83,8 +75,7 @@ protected void createSourceGroup(Composite parent) {
8375
TheLabel.setLayoutData(theGriddata);
8476

8577
controlLibraryPath = new Text(composite, SWT.SINGLE | SWT.BORDER);
86-
theGriddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL
87-
| GridData.GRAB_HORIZONTAL);
78+
theGriddata = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
8879
theGriddata.widthHint = SIZING_TEXT_FIELD_WIDTH;
8980
// theGriddata.horizontalSpan = 1;
9081
controlLibraryPath.setLayoutData(theGriddata);
@@ -103,12 +94,8 @@ protected void createSourceGroup(Composite parent) {
10394
public void widgetSelected(SelectionEvent event) {
10495
final Shell shell = new Shell();
10596
DirectoryDialog theDialog = new DirectoryDialog(shell);
106-
if ((controlLibraryPath.getText() == null)
107-
|| (controlLibraryPath.getText() == "")) {
108-
theDialog.setFilterPath(ArduinoInstancePreferences
109-
.getArduinoPath()
110-
.append(ArduinoConst.LIBRARY_PATH_SUFFIX)
111-
.toString());
97+
if ((controlLibraryPath.getText() == null) || (controlLibraryPath.getText() == "")) {
98+
theDialog.setFilterPath(ArduinoInstancePreferences.getArduinoPath().append(ArduinoConst.LIBRARY_PATH_SUFFIX).toString());
11299
} else {
113100
theDialog.setFilterPath(controlLibraryPath.getText());
114101
}
@@ -131,36 +118,34 @@ public void widgetSelected(SelectionEvent event) {
131118

132119
@Override
133120
protected ITreeContentProvider getFileProvider() {
134-
return null;
121+
return null;
135122
}
136123

137124
@Override
138125
protected ITreeContentProvider getFolderProvider() {
139-
return null;
126+
return null;
140127
}
141128

142129
public boolean canFinish() {
143-
return !((controlLibraryPath.getText().equals("")) || (getContainerFullPath() == null));
130+
return !((controlLibraryPath.getText().equals("")) || (getContainerFullPath() == null));
144131
}
145132

146-
147133
public String GetLibraryFolder() {
148-
return controlLibraryPath.getText() == null ? "" : controlLibraryPath
149-
.getText().trim();
134+
return controlLibraryPath.getText() == null ? "" : controlLibraryPath.getText().trim();
150135
}
151136

152137
public void setImportProject(IProject project) {
153-
if (project != null) {
154-
mProject = project;
155-
setContainerFieldValue(project.getName());
156-
}
138+
if (project != null) {
139+
mProject = project;
140+
setContainerFieldValue(project.getName());
141+
}
157142
}
158-
143+
159144
public IProject getProject() {
160-
if (validateDestinationGroup()) {
161-
return getSpecifiedContainer().getProject();
162-
}
163-
return null;
145+
if (validateDestinationGroup()) {
146+
return getSpecifiedContainer().getProject();
147+
}
148+
return null;
164149
}
165150

166151
}

it.baeyens.arduino.core/src/it/baeyens/arduino/ui/Wizard_Select_Libraries_Page.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected Wizard_Select_Libraries_Page(IProject project, String name, IStructure
5757
}
5858
}
5959

60-
// @Override
60+
@Override
6161
protected void createSourceGroup(Composite parent) {
6262

6363
if (mProject == null)

0 commit comments

Comments
 (0)