OverviewPagepublic final class OverviewPage extends org.eclipse.ui.forms.editor.FormPage
Fields Summary |
---|
static final String | PAGE_IDPage id used for switching tabs programmatically | com.android.ide.eclipse.editors.manifest.ManifestEditor | mEditorContainer editor | private OverviewInfoPart | mOverviewPartOverview part (attributes for manifest) | private OverviewLinksPart | mOverviewLinkPartOverview link part | private com.android.ide.eclipse.editors.ui.tree.UiTreeBlock | mTreeBlock |
Methods Summary |
---|
private com.android.ide.eclipse.editors.descriptors.ElementDescriptor[] | computeManifestExtraFilters()
UiElementNode manifest = mEditor.getUiRootNode();
AndroidManifestDescriptors manifestDescriptor = mEditor.getManifestDescriptors();
if (manifestDescriptor == null) {
return null;
}
// get the elements we want to exclude
HashSet<ElementDescriptor> excludes = new HashSet<ElementDescriptor>();
excludes.add(manifestDescriptor.getApplicationElement());
excludes.add(manifestDescriptor.getInstrumentationElement());
excludes.add(manifestDescriptor.getPermissionElement());
excludes.add(manifestDescriptor.getPermissionGroupElement());
excludes.add(manifestDescriptor.getPermissionTreeElement());
excludes.add(manifestDescriptor.getUsesPermissionElement());
// walk through the known children of the manifest descriptor and keep what's not excluded
ArrayList<ElementDescriptor> descriptorFilters = new ArrayList<ElementDescriptor>();
for (ElementDescriptor child : manifest.getDescriptor().getChildren()) {
if (!excludes.contains(child)) {
descriptorFilters.add(child);
}
}
if (descriptorFilters.size() == 0) {
return null;
}
return descriptorFilters.toArray(new ElementDescriptor[descriptorFilters.size()]);
| 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");
form.setImage(AdtPlugin.getAndroidLogo());
Composite body = form.getBody();
FormToolkit toolkit = managedForm.getToolkit();
// Usually we would set a ColumnLayout on body here. However the presence of the
// UiTreeBlock forces a GridLayout with one column so we comply with it.
mOverviewPart = new OverviewInfoPart(body, toolkit, mEditor);
mOverviewPart.getSection().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
managedForm.addPart(mOverviewPart);
newManifestExtrasPart(managedForm);
OverviewExportPart exportPart = new OverviewExportPart(this, body, toolkit, mEditor);
exportPart.getSection().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
managedForm.addPart(exportPart);
mOverviewLinkPart = new OverviewLinksPart(body, toolkit, mEditor);
mOverviewLinkPart.getSection().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
managedForm.addPart(mOverviewLinkPart);
| private void | newManifestExtrasPart(org.eclipse.ui.forms.IManagedForm managedForm)
UiElementNode manifest = mEditor.getUiRootNode();
mTreeBlock = new UiTreeBlock(mEditor, manifest,
true /* autoCreateRoot */,
computeManifestExtraFilters(),
"Manifest Extras",
"Extra manifest elements");
mTreeBlock.createContent(managedForm);
| public void | refreshUiApplicationNode()Changes and refreshes the Application UI node handle by the sub parts.
if (mOverviewPart != null) {
mOverviewPart.onSdkChanged();
}
if (mOverviewLinkPart != null) {
mOverviewLinkPart.onSdkChanged();
}
if (mTreeBlock != null) {
UiElementNode manifest = mEditor.getUiRootNode();
mTreeBlock.changeRootAndDescriptors(manifest,
computeManifestExtraFilters(),
true /* refresh */);
}
|
|