Examples of FormToolkit


Examples of org.eclipse.ui.forms.widgets.FormToolkit

    private String[]                     selectedPath    = null;

    public JARContentTreePart(final Composite parent, final IManagedForm managedForm) {
        this.managedForm = managedForm;

        FormToolkit toolkit = managedForm.getToolkit();
        Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);

        section.setText("Content Tree");
        tree = toolkit.createTree(section, SWT.FULL_SELECTION | SWT.SINGLE);
        tree.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
        section.setClient(tree);
        toolkit.paintBordersFor(section);

        viewer = new TreeViewer(tree);
        viewer.setContentProvider(contentProvider);
        viewer.setLabelProvider(new JARTreeLabelProvider());
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

    public PkgPatternsDetailsPage(String title) {
        this.title = title;
    }

    public void createContents(Composite parent) {
        FormToolkit toolkit = getManagedForm().getToolkit();

        FieldDecoration assistDecor = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
        KeyStroke assistKeyStroke = null;
        try {
            assistKeyStroke = KeyStroke.getInstance("Ctrl+Space");
        } catch (ParseException x) {
            // Ignore
        }

        Section mainSection = toolkit.createSection(parent, Section.TITLE_BAR);
        mainSection.setText(title);

        mainComposite = toolkit.createComposite(mainSection);
        mainSection.setClient(mainComposite);

        toolkit.createLabel(mainComposite, "Pattern:");
        txtName = toolkit.createText(mainComposite, "", SWT.BORDER);
        ControlDecoration decPattern = new ControlDecoration(txtName, SWT.LEFT | SWT.TOP, mainComposite);
        decPattern.setImage(assistDecor.getImage());
        if (assistKeyStroke == null) {
            decPattern.setDescriptionText("Content assist is available. Start typing to activate");
        } else {
            decPattern.setDescriptionText(MessageFormat.format("Content assist is available. Press {0} or start typing to activate", assistKeyStroke.format()));
        }
        decPattern.setShowHover(true);
        decPattern.setShowOnlyOnFocus(true);

        PkgPatternsProposalProvider proposalProvider = new PkgPatternsProposalProvider(new FormPartJavaSearchContext(this));
        ContentProposalAdapter patternProposalAdapter = new ContentProposalAdapter(txtName, new TextContentAdapter(), proposalProvider, assistKeyStroke, UIConstants.autoActivationCharacters());
        patternProposalAdapter.addContentProposalListener(proposalProvider);
        patternProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_IGNORE);
        patternProposalAdapter.setAutoActivationDelay(1000);
        patternProposalAdapter.setLabelProvider(new PkgPatternProposalLabelProvider());
        patternProposalAdapter.addContentProposalListener(new IContentProposalListener() {
            public void proposalAccepted(IContentProposal proposal) {
                PkgPatternProposal patternProposal = (PkgPatternProposal) proposal;
                String toInsert = patternProposal.getContent();
                int currentPos = txtName.getCaretPosition();
                txtName.setSelection(patternProposal.getReplaceFromPos(), currentPos);
                txtName.insert(toInsert);
                txtName.setSelection(patternProposal.getCursorPosition());
            }
        });

        toolkit.createLabel(mainComposite, "Version:");
        txtVersion = toolkit.createText(mainComposite, "", SWT.BORDER);

        /*
         * Section attribsSection = toolkit.createSection(parent, Section.TITLE_BAR | Section.TWISTIE);
         * attribsSection.setText("Extra Attributes"); Composite attribsComposite =
         * toolkit.createComposite(attribsSection);
 
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

        // Layout
        body.setLayout(new FillLayout());
    }

    void createLeftPanel(IManagedForm mform, Composite parent) {
        FormToolkit toolkit = mform.getToolkit();

        GeneralInfoPart infoPart = new GeneralInfoPart(parent, toolkit, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
        mform.addPart(infoPart);

        privPkgsPart = new PrivatePackagesPart(parent, toolkit, Section.TITLE_BAR | Section.EXPANDED);
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        exportPatternListPart.getSection().setLayoutData(gd);
    }

    void createMiddlePanel(IManagedForm mform, Composite parent) {
        FormToolkit toolkit = mform.getToolkit();

        SaneDetailsPart detailsPart = new SaneDetailsPart();
        mform.addPart(detailsPart);

        exportDetailsPage = new ExportPackagesDetailsPage();
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

            label.setLayoutData(gd);
        }
    }

    void createRightPanel(IManagedForm mform, final Composite parent) {
        FormToolkit toolkit = mform.getToolkit();

        BundleCalculatedImportsPart importsPart = new BundleCalculatedImportsPart(parent, toolkit, Section.TITLE_BAR | Section.EXPANDED);
        mform.addPart(importsPart);

        importPatternListPart = new ImportPatternsListPart(parent, toolkit, Section.TITLE_BAR | Section.EXPANDED);
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

    public void createContents(Composite parent) {
        super.createContents(parent);

        Composite mainComposite = getMainComposite();

        FormToolkit toolkit = getManagedForm().getToolkit();
        toolkit.createLabel(mainComposite, ""); // Spacer
        btnOptional = toolkit.createButton(mainComposite, "Optional", SWT.CHECK);

        btnOptional.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                if (!modifyLock.isUnderModification()) {
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

    class NoSelectionPage extends AbstractFormPart implements IDetailsPage {
        public void selectionChanged(IFormPart part, ISelection selection) {}

        public void createContents(Composite parent) {
            FormToolkit toolkit = getManagedForm().getToolkit();
            // toolkit.createLabel(parent, "Nothing is selected");

            Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);
            section.setText("Selection Details");

            section.setTitleBarBackground(greyTitleBarColour);
            // section.setTitleBarBorderColor(greyTitleBarColour);

            Composite composite = toolkit.createComposite(section);
            Label label = toolkit.createLabel(composite, "Select one or more items to view or edit their details.", SWT.WRAP);
            section.setClient(composite);

            GridLayout layout = new GridLayout();
            parent.setLayout(layout);
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

    private String[] selectedPath = null;

    public JARContentTreePart(Composite parent, IManagedForm managedForm) {
        this.managedForm = managedForm;

        FormToolkit toolkit = managedForm.getToolkit();
        Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);

        section.setText("Content Tree");
        tree = toolkit.createTree(section, SWT.FULL_SELECTION | SWT.SINGLE);
        tree.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
        section.setClient(tree);
        toolkit.paintBordersFor(section);

        viewer = new TreeViewer(tree);
        viewer.setContentProvider(contentProvider);
        viewer.setLabelProvider(new JARTreeLabelProvider());
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

     * @param parent the parent composite
     * @return the created composite.
     */
    Control createControl( Composite parent )
    {
        this.toolkit = new FormToolkit( parent.getDisplay() );
        this.form = this.toolkit.createForm( parent );
        this.form.getBody().setLayout( new FillLayout() );

        this.sashForm = new SashForm( this.form.getBody(), SWT.HORIZONTAL );
        this.sashForm.setLayout( new FillLayout() );
View Full Code Here

Examples of org.eclipse.ui.forms.widgets.FormToolkit

    @Override
    protected void createFormContent(IManagedForm managedForm) {
        managedForm.setInput(model);

        FormToolkit tk = managedForm.getToolkit();
        ScrolledForm form = managedForm.getForm();
        form.setText("Project Build");
        tk.decorateFormHeading(form.getForm());
        form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));

        GridLayout layout;
        GridData gd;

        // Create Controls
        Composite body = form.getBody();
        body.setLayout(new FillLayout());

        MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
        sashForm.setSashWidth(6);
        tk.adapt(sashForm, false, false);
        sashForm.hookResizeListener();

        Composite leftPanel = tk.createComposite(sashForm);
        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        leftPanel.setLayoutData(gd);

        layout = new GridLayout(1, false);
        leftPanel.setLayout(layout);

        SubBundlesPart subBundlesPart = new SubBundlesPart(leftPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
        managedForm.addPart(subBundlesPart);
        gd = new GridData(SWT.FILL, SWT.FILL, true, false);
        subBundlesPart.getSection().setLayoutData(gd);

        BuildPathPart buildPathPart = new BuildPathPart(leftPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
        managedForm.addPart(buildPathPart);
        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.widthHint = 50;
        gd.heightHint = 50;
        buildPathPart.getSection().setLayoutData(gd);

        Composite rightPanel = tk.createComposite(sashForm);
        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        rightPanel.setLayoutData(gd);

        BuildOperationsPart buildOpsPart = new BuildOperationsPart(rightPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
        managedForm.addPart(buildOpsPart);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.