[Esbox-commits] r109 - in trunk/org.indt.esbox.ui: .
src/org/indt/esbox/ui/properties
pauloromulo at garage.maemo.org
pauloromulo at garage.maemo.org
Tue Oct 9 01:13:41 EEST 2007
Author: pauloromulo
Date: 2007-10-09 01:13:40 +0300 (Tue, 09 Oct 2007)
New Revision: 109
Removed:
trunk/org.indt.esbox.ui/src/org/indt/esbox/ui/properties/ESboxProjectPropertyPage.java
Modified:
trunk/org.indt.esbox.ui/plugin.xml
Log:
the old ESbox properties page has been deleted (not necessary)
Modified: trunk/org.indt.esbox.ui/plugin.xml
===================================================================
--- trunk/org.indt.esbox.ui/plugin.xml 2007-10-08 20:58:54 UTC (rev 108)
+++ trunk/org.indt.esbox.ui/plugin.xml 2007-10-08 22:13:40 UTC (rev 109)
@@ -26,17 +26,7 @@
<extension
point="org.eclipse.ui.propertyPages">
<page
- class="org.indt.esbox.ui.properties.ESboxProjectPropertyPage"
- id="org.indt.esbox.ui.esboxProjectPropertyPage"
name="ESbox"
- nameFilter="*">
- <filter
- name="nature"
- value="org.indt.esbox.core.ESboxNature">
- </filter>
- </page>
- <page
- name="Targets"
category="sbpreferencepage"
class="org.indt.esbox.ui.properties.ESBoxTargetPropertyPage"
id="org.indt.esbox.ui.esboxProjectPropertyPage.targets">
Deleted: trunk/org.indt.esbox.ui/src/org/indt/esbox/ui/properties/ESboxProjectPropertyPage.java
===================================================================
--- trunk/org.indt.esbox.ui/src/org/indt/esbox/ui/properties/ESboxProjectPropertyPage.java 2007-10-08 20:58:54 UTC (rev 108)
+++ trunk/org.indt.esbox.ui/src/org/indt/esbox/ui/properties/ESboxProjectPropertyPage.java 2007-10-08 22:13:40 UTC (rev 109)
@@ -1,240 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 INdT.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Carolina Nogueira de Souza (carolina at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
- *******************************************************************************/
-
-
-package org.indt.esbox.ui.properties;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.indt.esbox.core.ESboxProjectProperties;
-import org.indt.esbox.core.maemosdk.MaemoSDKEngine;
-import org.indt.esbox.core.maemosdk.MaemoSDKInfo;
-import org.indt.esbox.core.platform.PlatformEngine;
-import org.indt.esbox.core.platform.PlatformInfo;
-
-/**
- * This class implements the properties page of a ESbox project
- */
-public class ESboxProjectPropertyPage extends PropertyPage {
-
-
- /**
- * Combo box with the list of known platforms
- */
- private Combo platforms;
-
- /**
- * Combo box with the list of known versions
- */
- private Combo maemoSDK;
-
- private Text sdk;
-
- private static final String SDK = "SDK";
-
- protected Control createContents(Composite parent) {
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- composite.setLayout(layout);
-
- Group groupTarget = new Group(composite, SWT.NONE);
- groupTarget.setText("Target Name");
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data = new GridData(GridData.FILL_HORIZONTAL);
- groupTarget.setLayoutData(data);
- layout = new GridLayout();
- layout.numColumns = 2;
- groupTarget.setLayout(layout);
-
- createLabel(groupTarget, "Target:", 1);
- sdk = new Text(groupTarget, SWT.READ_ONLY | SWT.BORDER | SWT.SINGLE);
- sdk.setText(SDK);
-
- createLabel(groupTarget, "Platform:", 1);
- platforms = createCombo(groupTarget, 3);
-
- createLabel(groupTarget, "Version:", 1);
- maemoSDK = createCombo2(groupTarget, 3);
-
- return composite;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- public boolean performOk() {
- performApply();
- return true;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performApply()
- */
-
- public void performApply() {
- IProject project = getProject();
-
- String platform = platforms.getItem(platforms.getSelectionIndex());
- String sdk = maemoSDK.getItem(maemoSDK.getSelectionIndex());
-
- //ESboxProjectProperties.setTargetName(project, SDK);
- ESboxProjectProperties.getInstance().setMaemoSDK(project, sdk);
- ESboxProjectProperties.getInstance().setPlatform(project, platform);
- }
-
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- protected void performDefaults() {
- platforms.select(0);
- maemoSDK.select(maemoSDK.getItemCount() - 1);
-
- IProject project = getProject();
- String platform = platforms.getItem(platforms.getSelectionIndex());
- String sdk = maemoSDK.getItem(maemoSDK.getSelectionIndex());
-
- //ESboxProjectProperties.setTargetName(project, SDK);
- ESboxProjectProperties.getInstance().setMaemoSDK(project, sdk);
- ESboxProjectProperties.getInstance().setPlatform(project, platform);
- }
-
- /**
- * Utility method that creates a label instance
- * and sets the default layout data.
- *
- * @param parent the parent for the new label
- * @param text the text for the new label
- * @return the new label
- */
- protected Label createLabel(Composite parent, String text, int span) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData data = new GridData();
- data.horizontalSpan = span;
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- return label;
- }
-
- /**
- * Create a text field specific for this application
- *
- * @param parent the parent of the new text field
- * @return the new text field
- */
- protected Text createTextField(Composite parent, int span) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- return layoutTextField(text, span);
- }
-
- /**
- * Layout a text field specific for this application
- *
- * @param parent the parent of the new text field
- * @return the new text field
- */
- protected Text layoutTextField(Text text, int span) {
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.verticalAlignment = GridData.CENTER;
- data.grabExcessVerticalSpace = false;
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- data.horizontalSpan = span;
- text.setLayoutData(data);
- return text;
- }
-
- /**
- * Utility method that creates a combo box
- *
- * @param parent the parent for the new label
- * @return the new widget
- */
- protected Combo createCombo2(Composite parent, int span) {
- Combo combo = new Combo(parent, SWT.READ_ONLY);
- GridData data = new GridData();
- combo.setLayoutData(data);
-
- List<MaemoSDKInfo> maemoSDKList = MaemoSDKEngine.getInstance().getMaemoSDKS();
-
-
- String selected = ESboxProjectProperties.getInstance().getMaemoSDK(getProject());
- if (selected != null)
- for(MaemoSDKInfo maemoSDKInfo: maemoSDKList) {
- combo.add(maemoSDKInfo.getVersion());
- if (maemoSDKInfo.getVersion() == selected)
- combo.select(combo.indexOf(maemoSDKInfo.getVersion()));
- }
- else
- for(MaemoSDKInfo maemoSDKInfo: maemoSDKList)
- combo.add(maemoSDKInfo.getVersion());
-
- return combo;
- }
-
-
-
- /**
- * Utility method that creates a combo box
- *
- * @param parent the parent for the new label
- * @return the new widget
- */
- protected Combo createCombo(Composite parent, int span) {
- Combo combo = new Combo(parent, SWT.READ_ONLY);
- GridData data = new GridData();
-
- combo.setLayoutData(data);
-
- List<PlatformInfo> platformList = PlatformEngine.getInstance().getPlatforms();
-
- String selected = ESboxProjectProperties.getInstance().getPlatform(getProject());
- if (selected != null)
- for(PlatformInfo platformInfo: platformList) {
- combo.add(platformInfo.getName());
- if (platformInfo.getName() == selected)
- combo.select(combo.indexOf(platformInfo.getName()));
- }
- else
- for(PlatformInfo platformInfo: platformList)
- combo.add(platformInfo.getName());
-
- return combo;
- }
-
- private IProject getProject() {
- IResource resource = (IResource)getElement().getAdapter(IResource.class);
- IProject project = (IProject)resource;
- return project;
- }
-}
-
-
More information about the Esbox-commits
mailing list