use of io.sloeber.core.api.OtherDescription in project arduino-eclipse-plugin by Sloeber.
the class OtherProperties method updateScreen.
@Override
protected void updateScreen() {
OtherDescription otherDesc = (OtherDescription) getDescription(getConfdesc());
myOtherProperties.setSelection(otherDesc.IsVersionControlled());
}
use of io.sloeber.core.api.OtherDescription in project arduino-eclipse-plugin by Sloeber.
the class OtherProperties method updateSloeber.
@Override
protected void updateSloeber(ICConfigurationDescription confDesc) {
OtherDescription theObjectToStore = (OtherDescription) getDescription(confDesc);
mySloeberProject.setOtherDescription(confDesc.getName(), theObjectToStore);
}
use of io.sloeber.core.api.OtherDescription in project arduino-eclipse-plugin by Sloeber.
the class RegressionTest method openAndCloseUsesSavedSettings.
/**
* open and close a project should keep the compileDescription and
* BoardDescriotion
*
* @throws Exception
*/
@Test
public void openAndCloseUsesSavedSettings() throws Exception {
CodeDescription codeDesc = new CodeDescription(CodeDescription.CodeTypes.defaultCPP);
String proj1Name = "openModAndClose1";
BoardDescription proj1BoardDesc = Arduino.uno().getBoardDescriptor();
OtherDescription otherDesc = new OtherDescription();
otherDesc.setVersionControlled(true);
CompileDescription proj1CompileDesc = getBunkersCompileDescription();
IProject proj1 = SloeberProject.createArduinoProject(proj1Name, null, proj1BoardDesc, codeDesc, proj1CompileDesc, otherDesc, new NullProgressMonitor());
String proj2Name = "openModAndClose2";
BoardDescription proj2BoardDesc = Arduino.mega2560Board().getBoardDescriptor();
CompileDescription proj2CompileDesc = new CompileDescription();
IProject proj2 = SloeberProject.createArduinoProject(proj2Name, null, proj2BoardDesc, codeDesc, proj2CompileDesc, new NullProgressMonitor());
// Read the data we want to test
// for the indexer
Shared.waitForAllJobsToFinish();
SloeberProject proj1SloeberDesc = SloeberProject.getSloeberProject(proj1);
ICProjectDescription proj1Desc = CoreModel.getDefault().getProjectDescription(proj1);
ICConfigurationDescription proj1ConfDesc = proj1Desc.getActiveConfiguration();
BoardDescription proj1CreatedBoardDesc = proj1SloeberDesc.getBoardDescription(proj1ConfDesc.getName(), false);
CompileDescription proj1CreatedCompileDesc = proj1SloeberDesc.getCompileDescription(proj1ConfDesc.getName(), false);
SloeberProject proj2SloeberDesc = SloeberProject.getSloeberProject(proj2);
ICProjectDescription proj2Desc = CoreModel.getDefault().getProjectDescription(proj2);
ICConfigurationDescription proj2ConfDesc = proj2Desc.getActiveConfiguration();
BoardDescription proj2CreatedBoardDesc = proj2SloeberDesc.getBoardDescription(proj2ConfDesc.getName(), false);
CompileDescription proj2CreatedCompileDesc = proj2SloeberDesc.getCompileDescription(proj2ConfDesc.getName(), false);
// get the filenames to copy
IFile file = proj1.getFile(SLOEBER_CFG);
File proj1SloeberFile = file.getLocation().toFile();
file = proj2.getFile(SLOEBER_CFG);
File proj2SloeberFile = file.getLocation().toFile();
// close and reopen the project
proj2.close(null);
// just wait a while
Thread.sleep(1000);
Shared.waitForAllJobsToFinish();
// copy from proj1 to proj2
FileUtils.copyFile(proj1SloeberFile, proj2SloeberFile);
// reopen the project
proj2.open(null);
Thread.sleep(1000);
Shared.waitForAllJobsToFinish();
// reread project 2
proj2SloeberDesc = SloeberProject.getSloeberProject(proj2);
proj2Desc = CoreModel.getDefault().getProjectDescription(proj2);
proj2ConfDesc = proj2Desc.getActiveConfiguration();
BoardDescription proj2OpenedBoardDesc = proj2SloeberDesc.getBoardDescription(proj2ConfDesc.getName(), false);
CompileDescription proj2OpenedCompileDesc = proj2SloeberDesc.getCompileDescription(proj2ConfDesc.getName(), false);
// check the setup was done correctly
if (!proj1BoardDesc.equals(proj1CreatedBoardDesc)) {
fail("Project 1 not created properly.");
}
if (!proj2BoardDesc.equals(proj2CreatedBoardDesc)) {
fail("Project 2 not created properly.");
}
if (!proj1CompileDesc.equals(proj1CreatedCompileDesc)) {
fail("Project 1 not created properly.");
}
if (!proj2CompileDesc.equals(proj2CreatedCompileDesc)) {
fail("Project 2 not created properly.");
}
// check wether the file modification was taken into account
if (!proj1BoardDesc.equals(proj2OpenedBoardDesc)) {
fail("Project 2 not created properly.");
}
if (!proj1CompileDesc.equals(proj2OpenedCompileDesc)) {
fail("Project 2 not created properly.");
}
}
use of io.sloeber.core.api.OtherDescription in project arduino-eclipse-plugin by Sloeber.
the class OtherProperties method getFromScreen.
@Override
protected Object getFromScreen() {
OtherDescription otherDesc = (OtherDescription) getDescription(getConfdesc());
otherDesc.setVersionControlled(myOtherProperties.getSelection());
return otherDesc;
}
Aggregations