use of org.eclipse.ui.statushandlers.StatusManager in project arduino-eclipse-plugin by Sloeber.
the class Common method log.
/**
* Logs the status information
*
* @param status
* the status information to log
*/
public static void log(IStatus status) {
if (status.getSeverity() == IStatus.ERROR) {
int style = StatusManager.LOG | StatusManager.SHOW | StatusManager.BLOCK;
StatusManager stMan = StatusManager.getManager();
stMan.handle(status, style);
} else {
Activator.getDefault().getLog().log(status);
}
}
use of org.eclipse.ui.statushandlers.StatusManager in project arduino-eclipse-plugin by Sloeber.
the class InternalPackageManager method startup_Pluging.
/**
* Loads all stuff needed and if this is the first time downloads the avr boards
* and needed tools
*
* @param monitor
*/
public static void startup_Pluging(IProgressMonitor monitor) {
loadJsons(ConfigurationPreferences.getUpdateJasonFilesFlag());
List<Board> allBoards = getInstalledBoards();
if (!LibraryManager.libsAreInstalled()) {
LibraryManager.InstallDefaultLibraries(monitor);
}
if (allBoards.isEmpty()) {
// If boards are installed do nothing
// $NON-NLS-1$
MyMultiStatus mstatus = new MyMultiStatus("Failed to configer Sloeber");
// Download sample programs
mstatus.addErrors(downloadAndInstall(Defaults.EXAMPLES_URL, Defaults.EXAMPLE_PACKAGE, ConfigurationPreferences.getInstallationPathExamples(), false, monitor));
if (mstatus.isOK()) {
// if successfully installed the examples: add the boards
Package pkg = getPackageIndices().get(0).getPackages().get(0);
if (pkg != null) {
ArduinoPlatform platform = pkg.getLatestPlatform(Defaults.PLATFORM_NAME, false);
if (platform == null) {
ArduinoPlatform[] platformList = new ArduinoPlatform[pkg.getLatestPlatforms().size()];
pkg.getLatestPlatforms().toArray(platformList);
platform = platformList[0];
}
if (platform != null) {
mstatus.addErrors(downloadAndInstall(platform, false, monitor));
}
}
}
if (!mstatus.isOK()) {
StatusManager stMan = StatusManager.getManager();
stMan.handle(mstatus, StatusManager.LOG | StatusManager.SHOW | StatusManager.BLOCK);
}
}
myIsReady = true;
}
use of org.eclipse.ui.statushandlers.StatusManager in project arduino-eclipse-plugin by Sloeber.
the class BoardsManager method startup_Pluging.
/**
* Loads all stuff needed and if this is the first time downloads the avr boards
* and needed tools
*
* @param monitor
*/
public static synchronized void startup_Pluging(IProgressMonitor monitor) {
loadJsons(ConfigurationPreferences.getUpdateJasonFilesFlag());
if (!LibraryManager.libsAreInstalled()) {
LibraryManager.InstallDefaultLibraries(monitor);
}
IPath examplesPath = ConfigurationPreferences.getInstallationPathExamples();
if (!examplesPath.toFile().exists()) {
// examples are not installed
// Download arduino IDE example programs
Common.log(PackageManager.downloadAndInstall(Defaults.EXAMPLES_URL, Defaults.EXAMPLE_PACKAGE, examplesPath, false, monitor));
}
if (!areThereInstalledBoards()) {
IStatus status = null;
// if successfully installed the examples: add the boards
ArduinoPlatform platform = getPlatform(Defaults.DEFAULT_INSTALL_MAINTAINER, Defaults.DEFAULT_INSTALL_ARCHITECTURE);
// we failed to find arduino avr platform. Take the fiorst one
if (platform == null) {
try {
platform = getPlatforms().get(0);
} catch (@SuppressWarnings("unused") Exception e) {
// no need to do anything
}
}
if (platform == null) {
status = new Status(IStatus.ERROR, Activator.getId(), Messages.No_Platform_available);
} else {
status = install(platform.getNewestVersion(), monitor);
}
if (!status.isOK()) {
StatusManager stMan = StatusManager.getManager();
stMan.handle(status, StatusManager.LOG | StatusManager.SHOW | StatusManager.BLOCK);
}
}
myIsReady = true;
}
use of org.eclipse.ui.statushandlers.StatusManager in project arduino-eclipse-plugin by Sloeber.
the class Activator method log.
/**
* Logs the status information
*
* @param status
* the status information to log
*/
public static void log(IStatus status) {
int style;
if (status.getSeverity() == IStatus.ERROR) {
style = StatusManager.LOG | StatusManager.SHOW | StatusManager.BLOCK;
StatusManager stMan = StatusManager.getManager();
stMan.handle(status, style);
} else {
Activator.getDefault().getLog().log(status);
}
}
Aggregations