diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2008-11-24 14:05:44 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2008-11-24 14:05:44 +0000 |
commit | 08caf9241027faf3b70478af6cb15928c6b4e8d3 (patch) | |
tree | 99ad05c2f9e4ef13763bebd5aa672142a118fb5f /org.rtems.cdt.toolchain2 | |
parent | Removed explicit version requirement. (diff) | |
download | rtems-eclipse-plug-in-08caf9241027faf3b70478af6cb15928c6b4e8d3.tar.bz2 |
First try of a new project wizard.
Diffstat (limited to 'org.rtems.cdt.toolchain2')
-rw-r--r-- | org.rtems.cdt.toolchain2/.classpath | 7 | ||||
-rw-r--r-- | org.rtems.cdt.toolchain2/.settings/org.eclipse.jdt.core.prefs | 7 | ||||
-rw-r--r-- | org.rtems.cdt.toolchain2/META-INF/MANIFEST.MF | 6 | ||||
-rw-r--r-- | org.rtems.cdt.toolchain2/build.properties | 5 | ||||
-rw-r--r-- | org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java | 206 | ||||
-rw-r--r-- | org.rtems.cdt.toolchain2/plugin.xml | 8 |
6 files changed, 233 insertions, 6 deletions
diff --git a/org.rtems.cdt.toolchain2/.classpath b/org.rtems.cdt.toolchain2/.classpath new file mode 100644 index 0000000..4d3ad09 --- /dev/null +++ b/org.rtems.cdt.toolchain2/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path=""/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.rtems.cdt.toolchain2/.settings/org.eclipse.jdt.core.prefs b/org.rtems.cdt.toolchain2/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..20eeb2e --- /dev/null +++ b/org.rtems.cdt.toolchain2/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +#Mon Nov 24 10:29:32 CET 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/org.rtems.cdt.toolchain2/META-INF/MANIFEST.MF b/org.rtems.cdt.toolchain2/META-INF/MANIFEST.MF index 604a86b..f60bbae 100644 --- a/org.rtems.cdt.toolchain2/META-INF/MANIFEST.MF +++ b/org.rtems.cdt.toolchain2/META-INF/MANIFEST.MF @@ -4,5 +4,9 @@ Bundle-Name: RTEMS CDT Plug-in Bundle-SymbolicName: org.rtems.cdt.toolchain2;singleton:=true Bundle-Version: 1.0.0 Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Require-Bundle: org.eclipse.cdt.managedbuilder.core +Require-Bundle: org.eclipse.cdt.managedbuilder.core, + org.eclipse.swt, + org.eclipse.ui;bundle-version="3.4.1" Bundle-Vendor: Embedded Brains GmbH +Import-Package: org.eclipse.cdt.managedbuilder.ui.wizards, + org.eclipse.jface.resource diff --git a/org.rtems.cdt.toolchain2/build.properties b/org.rtems.cdt.toolchain2/build.properties deleted file mode 100644 index e9863e2..0000000 --- a/org.rtems.cdt.toolchain2/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml diff --git a/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java b/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java new file mode 100644 index 0000000..896ca7d --- /dev/null +++ b/org.rtems.cdt.toolchain2/org/rtems/cdt/wizards/BasicSetup.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2008 + * Embedded Brains GmbH + * Obere Lagerstr. 30 + * D-82178 Puchheim + * Germany + * rtems@embedded-brains.de + * + * The license and distribution terms for this file may be found in the file + * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE. + */ + +package org.rtems.cdt.wizards; + +import java.util.*; +import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPage; +import org.eclipse.cdt.managedbuilder.ui.wizards.MBSCustomPageManager; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.events.*; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.*; +import org.eclipse.swt.SWT; + +public class BasicSetup extends MBSCustomPage +{ + private SortedMap<String, String> mTargetMap; + + private Composite mComposite; + + private Text mInstallationPath; + + private Text mVersion; + + private Combo mTarget; + + public BasicSetup() + { + pageID = "org.rtems.cdt.wizards.basicsetup"; + + mTargetMap = new TreeMap<String, String>(); + mTargetMap.put( new String( "PowerPC"), new String ("powerpc")); + mTargetMap.put( new String( "ARM"), new String ("arm")); + mTargetMap.put( new String( "SPARC"), new String ("sparc")); + mTargetMap.put( new String( "Motorola 68k or Freescale ColdFire"), new String ("m68k")); + mTargetMap.put( new String( "Intel i386"), new String ("i368")); + mTargetMap.put( new String( "Intel i686"), new String ("i668")); + mTargetMap.put( new String( "AVR"), new String ("avr")); + mTargetMap.put( new String( "Blackfin"), new String ("bfin")); + mTargetMap.put( new String( "Hitachi H8300"), new String ("h8300")); + mTargetMap.put( new String( "MIPS"), new String ("mips")); + mTargetMap.put( new String( "SuperH"), new String ("sh")); + } + + public boolean canFlipToNextPage() + { + return MBSCustomPageManager.getNextPage( pageID) != null; + } + + public String getName() + { + return "Basic Setup Page"; + } + + public void createControl( Composite parent) + { + mComposite = new Composite( parent, SWT.NULL); + + GridData gd = new GridData( GridData.FILL_BOTH); + mComposite.setLayoutData( gd); + + GridLayout layout = new GridLayout(); + layout.numColumns = 3; + mComposite.setLayout( layout); + + Label label = new Label( mComposite, SWT.LEFT); + label.setText( "Installation path:"); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + label.setLayoutData( gd); + + mInstallationPath = new Text( mComposite, SWT.LEFT | SWT.BORDER); + mInstallationPath.setText( "/opt/rtems-4.10"); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 2; + mInstallationPath.setLayoutData( gd); + + Button button = new Button( mComposite, SWT.PUSH); + button.setText( "Browse"); + button.addSelectionListener( + new SelectionAdapter() { + public void widgetSelected( SelectionEvent e) { + browseForInstallationPath(); + } + } + ); + + label = new Label( mComposite, SWT.LEFT); + label.setText( "Version:"); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + label.setLayoutData( gd); + + mVersion = new Text( mComposite, SWT.RIGHT | SWT.BORDER); + mVersion.setText( "4.10"); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 2; + mVersion.setLayoutData( gd); + + new Label( mComposite, SWT.NONE); + + label = new Label( mComposite, SWT.LEFT); + label.setText( "Target architecture:"); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 3; + label.setLayoutData( gd); + + mTarget = new Combo( mComposite, SWT.DROP_DOWN | SWT.READ_ONLY); + Iterator<String> targets = mTargetMap.keySet().iterator(); + while (targets.hasNext()) { + mTarget.add( (String) targets.next()); + } + mTarget.select( 0); + gd = new GridData( GridData.FILL_HORIZONTAL); + gd.horizontalSpan = 2; + mTarget.setLayoutData( gd); + + new Label( mComposite, SWT.NONE); + } + + public void dispose() + { + mComposite.dispose(); + } + + public Control getControl() + { + return mComposite; + } + + public String getDescription() + { + return "Select your desired RTEMS installation path, version and target architecture."; + } + + public String getErrorMessage() + { + return null; + } + + public Image getImage() + { + return wizard.getDefaultPageImage(); + } + + public String getMessage() + { + return null; + } + + public String getTitle() + { + return "Basic Setup"; + } + + public void performHelp() + { + // Do nothing + } + + public void setDescription( String description) + { + // Do nothing + } + + public void setImageDescriptor( ImageDescriptor image) + { + // Do nothing + } + + public void setTitle(String title) + { + // Do nothing + } + + public void setVisible( boolean visible) + { + mComposite.setVisible( visible); + } + + protected boolean isCustomPageComplete() + { + return true; + } + + private void browseForInstallationPath() + { + DirectoryDialog dialog = new DirectoryDialog( mComposite.getShell(), SWT.NONE); + dialog.setFilterPath( mInstallationPath.getText()); + String text = dialog.open(); + if (text != null) { + mInstallationPath.setText( text); + } + } +}
\ No newline at end of file diff --git a/org.rtems.cdt.toolchain2/plugin.xml b/org.rtems.cdt.toolchain2/plugin.xml index fd88a8a..0a8b673 100644 --- a/org.rtems.cdt.toolchain2/plugin.xml +++ b/org.rtems.cdt.toolchain2/plugin.xml @@ -237,4 +237,12 @@ </configuration> </projectType> </extension> + + <!-- New Project Wizards --> + <extension + point="org.eclipse.cdt.managedbuilder.ui.newWizardPages"> + <wizardPage + ID="org.rtems.cdt.wizards.basicsetup" + pageClass="org.rtems.cdt.wizards.BasicSetup"/> + </extension> </plugin> |