FileDocCategorySizeDatePackage
OverviewExportPart.javaAPI DocAndroid 1.5 API3679Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.manifest.pages

OverviewExportPart

public final class OverviewExportPart extends com.android.ide.eclipse.editors.ui.SectionHelper.ManifestSectionPart
Export section part for overview page.

Fields Summary
private final OverviewPage
mOverviewPage
Constructors Summary
public OverviewExportPart(OverviewPage overviewPage, org.eclipse.swt.widgets.Composite body, org.eclipse.ui.forms.widgets.FormToolkit toolkit, com.android.ide.eclipse.editors.manifest.ManifestEditor editor)

        super(body, toolkit, Section.TWISTIE | Section.EXPANDED, true /* description */);
        mOverviewPage = overviewPage;
        Section section = getSection();
        section.setText("Exporting");
        section.setDescription("To export the application for distribution, you have the following options:");

        Composite table = createTableLayout(toolkit, 2 /* numColumns */);
        
        StringBuffer buf = new StringBuffer();
        buf.append("<form><li><a href=\"wizard\">"); //$NON-NLS-1$
        buf.append("Use the Export Wizard");
        buf.append("</a>"); //$NON-NLS-1$
        buf.append(" to export and sign an APK");
        buf.append("</li>"); //$NON-NLS-1$
        buf.append("<li><a href=\"manual\">"); //$NON-NLS-1$
        buf.append("Export an unsigned APK");
        buf.append("</a>"); //$NON-NLS-1$
        buf.append(" and sign it manually");
        buf.append("</li></form>"); //$NON-NLS-1$

        FormText text = createFormText(table, toolkit, true, buf.toString(),
                false /* setupLayoutData */);
        text.addHyperlinkListener(new HyperlinkAdapter() {
            @Override
            public void linkActivated(HyperlinkEvent e) {
                // get the project from the editor
                IEditorInput input = mOverviewPage.mEditor.getEditorInput();
                if (input instanceof FileEditorInput) {
                    FileEditorInput fileInput = (FileEditorInput)input;
                    IFile file = fileInput.getFile();
                    IProject project = file.getProject();
                    
                    if ("manual".equals(e.data)) { //$NON-NLS-1$
                        // now we can export an unsigned apk for the project.
                        ExportHelper.exportProject(project);
                    } else {
                        // call the export wizard
                        ExportHelper.startExportWizard(project);
                    }
                }
            }
        });
        
        layoutChanged();
    
Methods Summary