Package org.apache.felix.sigil.eclipse.ui.internal.form

Examples of org.apache.felix.sigil.eclipse.ui.internal.form.IFormValueConverter


                description = nullIfEmpty((String) form.getValue());
                checkDirty();
            }
        });

        IFormValueConverter converter = new IFormValueConverter()
        {
            public String getLabel(Object value)
            {
                Version v = (Version) value;
                return v.toString();
            }

            public Object getValue(String label)
            {
                return VersionTable.getVersion(label);
            }
        };

        versionEntry = new SigilFormEntry(body, toolkit, "Version", null, converter);
        versionEntry.setFormEntryListener(new SigilFormEntryAdapter()
        {
            @Override
            public void textValueChanged(SigilFormEntry form)
            {
                version = (Version) form.getValue();
                checkDirty();
            }
        });

        providerEntry = new SigilFormEntry(body, toolkit, "Provider");
        providerEntry.setFormEntryListener(new SigilFormEntryAdapter()
        {
            @Override
            public void textValueChanged(SigilFormEntry form)
            {
                provider = nullIfEmpty((String) form.getValue());
                checkDirty();
            }
        });

        activatorEntry = new SigilFormEntry(body, toolkit, "Bundle Activator",
            "Browse...", null);
        activatorEntry.setFormEntryListener(new SigilFormEntryAdapter()
        {
            @Override
            public void textValueChanged(SigilFormEntry form)
            {
                activator = (String) form.getValue();
                checkDirty();
            }

            @Override
            public void browseButtonSelected(SigilFormEntry form)
            {
                BackgroundLoadingSelectionDialog<String> dialog = ResourcesDialogHelper.createClassSelectDialog(
                    getShell(), "Add Bundle Activator", getProjectModel(), activator,
                    BundleActivator.class.getName());

                if (dialog.open() == Window.OK)
                {
                    form.setValue(dialog.getSelectedElement());
                }
            }
        });

        converter = new IFormValueConverter()
        {
            public String getLabel(Object value)
            {
                IRequiredBundle b = (IRequiredBundle) value;
                return b == null ? null : b.getSymbolicName() + " " + b.getVersions();
View Full Code Here

TOP

Related Classes of org.apache.felix.sigil.eclipse.ui.internal.form.IFormValueConverter

Copyright © 2018 www.massapicom. 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.