Examples of IPropertySource


Examples of org.apache.tapestry.engine.IPropertySource

@Test
public class TestLocalizedPropertySource extends BaseComponentTestCase
{
    public void testFound()
    {
        IPropertySource ps = newMock(IPropertySource.class);

        expect(ps.getPropertyValue("property-name_en")).andReturn(null);

        expect(ps.getPropertyValue("property-name")).andReturn("fred");

        replay();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

        verify();
    }

    public void testNotFound()
    {
        IPropertySource ps = newMock(IPropertySource.class);

        expect(ps.getPropertyValue("property-name_fr")).andReturn(null);

        expect(ps.getPropertyValue("property-name")).andReturn(null);

        replay();

        LocalizedPropertySource lps = new LocalizedPropertySource(ps);
View Full Code Here

Examples of org.apache.tapestry.engine.IPropertySource

    private IPropertySource getSourceForNamespace(INamespace namespace)
    {
        Resource key = namespace.getSpecificationLocation();

        IPropertySource result = (IPropertySource) _namespaceSources.get(key);

        if (result == null)
        {
            result = createSourceForNamespace(namespace);
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

    };
  }
 
  private static IPropertySource createSpreadsheetPropertySource(final SpreadsheetEntry spreadsheet)
  {
    return new IPropertySource() {
      public IPropertyDescriptor[] getPropertyDescriptors()
      {
        return new IPropertyDescriptor[] {
          new PropertyDescriptor("author", "Author"),
          new PropertyDescriptor("document", "Document"),
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

    };
  }
 
  private static IPropertySource createDocumentPropertySource(final DocumentListEntry document)
  {
    return new IPropertySource() {
      public IPropertyDescriptor[] getPropertyDescriptors()
      {
        return new IPropertyDescriptor[] {
          new PropertyDescriptor("author", "Author"),
          new PropertyDescriptor("document", "Document"),
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

            if (value instanceof IPropertySource){
                return createChildren((IPropertySource) value);
            }
        } else if (Platform.getAdapterManager().hasAdapter(parentElement,
                "org.eclipse.ui.views.properties.IPropertySource")) { //$NON-NLS-1$
            IPropertySource source = (IPropertySource) Platform.getAdapterManager().getAdapter(
                    parentElement, "org.eclipse.ui.views.properties.IPropertySource"); //$NON-NLS-1$
            return createChildren(source);
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

        super.dispose();
    }

    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
        this.sourcePart = part;
        IPropertySource newSource = getSource(selection);
        if (areObjectsEqual(source, newSource)) {
            return;
        }
        if (source instanceof GraphElement) {
            ((GraphElement) source).removePropertyChangeListener(this);
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

            ((GraphElement) source).addPropertyChangeListener(this);
        }
        updateChildren();
    }
    private IPropertySource getSource(ISelection selection) {
        IPropertySource source = null;
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = (IStructuredSelection) selection;
            if (!structuredSelection.isEmpty()) {
                Object sel = structuredSelection.getFirstElement();
                if (sel instanceof IPropertySource) {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

    //
  }

  public IPropertySource getPropertySource(Object object) {
    Element model = null;
    IPropertySource source = null;

    if ((model = DesignerPropertyTool.getElementNode(object)) != null) {
      source = (IPropertySource) ((INodeNotifier) (model))
          .getAdapterFor(IPropertySource.class);
      if (source == null) {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertySource

      final PropertySheetPage propertySheet = new PropertySheetPage();
      propertySheet.createControl(annotationsComposite);
      propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
        public IPropertySource getPropertySource(Object object) {
          if (object instanceof Annotation) {
            IPropertySource annotationPropertySource = new AnnotationPropertySource(((Annotation) object));
            return annotationPropertySource;
          }
          return null;
        }
      });
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.