?? jadrequiredpropertieseditorpage.java
字號:
/**
* Copyright (c) 2003-2005 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.ui.internal.editor.jad;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.PlatformUI;
import eclipseme.core.internal.EclipseMECorePlugin;
import eclipseme.core.model.DescriptorPropertyDescription;
import eclipseme.core.model.IJADConstants;
import eclipseme.core.model.LibrarySpecification;
/**
* JAD editor page for handling the required properties.
* <p />
* Copyright (c) 2003-2005 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.10 $
* <br>
* $Date: 2006/02/11 21:27:36 $
* <br>
* @author Craig Setera
*/
public class JADRequiredPropertiesEditorPage extends JADPropertiesEditorPage {
public static final String ID = "required";
/**
* Required property descriptors.
*/
private static final DescriptorPropertyDescription[]
REQUIRED_DESCRIPTORS = new DescriptorPropertyDescription[] {
new DescriptorPropertyDescription(
IJADConstants.JAD_MIDLET_JAR_URL,
getResourceString("property.jad.midlet_jar_url"),
DescriptorPropertyDescription.DATATYPE_URL),
new DescriptorPropertyDescription(
IJADConstants.JAD_MIDLET_NAME,
getResourceString("property.jad.midlet_name"),
DescriptorPropertyDescription.DATATYPE_STRING),
new DescriptorPropertyDescription(
IJADConstants.JAD_MIDLET_VENDOR,
getResourceString("property.jad.midlet_vendor"),
DescriptorPropertyDescription.DATATYPE_STRING),
new DescriptorPropertyDescription(
IJADConstants.JAD_MIDLET_VERSION,
getResourceString("property.jad.midlet_version"),
DescriptorPropertyDescription.DATATYPE_STRING),
new ListDescriptorPropertyDescription(
IJADConstants.JAD_MICROEDITION_CONFIG,
getResourceString("property.jad.microedition_configuration"),
getConfigurationNamesAndValues()),
new ListDescriptorPropertyDescription(
IJADConstants.JAD_MICROEDITION_PROFILE,
getResourceString("property.jad.microedition_profile"),
getProfileNamesAndValues()),
};
/**
* Return the J2ME configuration names and values.
*
* @return
*/
private static String[][] getConfigurationNamesAndValues()
{
String[][] namesAndValues = null;
try {
LibrarySpecification[] specifications =
EclipseMECorePlugin.getConfigurationSpecifications();
namesAndValues = new String[specifications.length][];
for (int i = 0; i < specifications.length; i++) {
LibrarySpecification spec = specifications[i];
namesAndValues[i] = new String[2];
namesAndValues[i][0] = spec.getName();
namesAndValues[i][1] = spec.getIdentifier();
}
} catch (CoreException e) {
namesAndValues = new String[0][0];
EclipseMECorePlugin.log(IStatus.WARNING, e);
}
return namesAndValues;
}
/**
* Return the J2ME profile names and values.
*
* @return
*/
private static String[][] getProfileNamesAndValues()
{
String[][] namesAndValues = null;
try {
LibrarySpecification[] specifications =
EclipseMECorePlugin.getProfileSpecifications();
namesAndValues = new String[specifications.length][];
for (int i = 0; i < specifications.length; i++) {
LibrarySpecification spec = specifications[i];
namesAndValues[i] = new String[2];
namesAndValues[i][0] = spec.getName();
namesAndValues[i][1] = spec.getIdentifier();
}
} catch (CoreException e) {
namesAndValues = new String[0][0];
EclipseMECorePlugin.log(IStatus.WARNING, e);
}
return namesAndValues;
}
/**
* Constract a new required properties editor.
*
* @param editor
*/
public JADRequiredPropertiesEditorPage(JADEditor editor) {
super(editor, ID, "Required", REQUIRED_DESCRIPTORS);
}
/**
* @see eclipseme.ui.internal.editor.jad.AbstractJADEditorPage#getSectionTitle()
*/
protected String getSectionTitle() {
return "Required Properties";
}
/**
* @see eclipseme.ui.internal.editor.jad.AbstractJADEditorPage#getSectionDescription()
*/
protected String getSectionDescription() {
return "Required midlet suite properties must be specified on this page";
}
protected void addContextHelp(Composite c)
{
PlatformUI.getWorkbench().getHelpSystem().setHelp(c, "eclipseme.ui.help_JADRequiredPropertiesEditorPage");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -