ApplicationPagepublic final class ApplicationPage extends org.eclipse.ui.forms.editor.FormPage
Fields Summary |
---|
public static final String | PAGE_IDPage id used for switching tabs programmatically | com.android.ide.eclipse.editors.manifest.ManifestEditor | mEditorContainer editor | private ApplicationToggle | mTooglePartThe Application Toogle part | private ApplicationAttributesPart | mAttrPartThe Application Attributes part | private com.android.ide.eclipse.editors.ui.tree.UiTreeBlock | mTreeBlockThe tree view block |
Methods Summary |
---|
protected void | createFormContent(org.eclipse.ui.forms.IManagedForm managedForm)Creates the content in the form hosted in this page.
super.createFormContent(managedForm);
ScrolledForm form = managedForm.getForm();
form.setText("Android Manifest Application");
form.setImage(AdtPlugin.getAndroidLogo());
UiElementNode appUiNode = getUiApplicationNode();
Composite body = form.getBody();
FormToolkit toolkit = managedForm.getToolkit();
// We usually prefer to have a ColumnLayout here. However
// MasterDetailsBlock.createContent() below will reset the body's layout to a grid layout.
mTooglePart = new ApplicationToggle(body, toolkit, mEditor, appUiNode);
mTooglePart.getSection().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
managedForm.addPart(mTooglePart);
mAttrPart = new ApplicationAttributesPart(body, toolkit, mEditor, appUiNode);
mAttrPart.getSection().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
managedForm.addPart(mAttrPart);
mTreeBlock = new UiTreeBlock(mEditor, appUiNode,
false /* autoCreateRoot */,
null /* element filters */,
"Application Nodes",
"List of all elements in the application");
mTreeBlock.createContent(managedForm);
| private com.android.ide.eclipse.editors.uimodel.UiElementNode | getUiApplicationNode()Retrieves the application UI node. Since this is a mandatory node, it *always*
exists, even if there is no matching XML node.
AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors();
if (manifestDescriptor != null) {
ElementDescriptor desc = manifestDescriptor.getApplicationElement();
return mEditor.getUiRootNode().findUiChildNode(desc.getXmlName());
} else {
// return the ui root node, as a dummy application root node.
return mEditor.getUiRootNode();
}
| public void | refreshUiApplicationNode()Changes and refreshes the Application UI node handled by the sub parts.
UiElementNode appUiNode = getUiApplicationNode();
if (mTooglePart != null) {
mTooglePart.setUiElementNode(appUiNode);
}
if (mAttrPart != null) {
mAttrPart.setUiElementNode(appUiNode);
}
if (mTreeBlock != null) {
mTreeBlock.changeRootAndDescriptors(appUiNode,
null /* element filters */,
true /* refresh */);
}
|
|