Package com.cedarsoft.lookup

Examples of com.cedarsoft.lookup.Lookup


   * @param struct the struct
   * @return the presentation that has been created
   */
  @NotNull
  public T present( @NotNull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here


   * Creates the presentation for the given struct. This method should not be overridden.
   */
  @Override
  @Nonnull
  public T present( @Nonnull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

    topPanel.repaint();
  }

  @NotNull
  protected JComponent createTitleComponent( @NotNull TitleProvider<Object> provider, @NotNull Object selectedObject ) {
    Lookup details = provider.getTitle( selectedObject );

    //Insert the component
    JComponent component;
    DetailsComponentFactory componentFactory = details.lookup( DetailsComponentFactory.class );
    if ( componentFactory != null ) {
      component = componentFactory.createComponent();
    } else {
      component = details.lookup( JComponent.class );
      if ( component == null ) {
        throw new IllegalStateException( "No componentFactory and no component provided for " + selectedObject );
      }
    }
View Full Code Here

   * @param selectedObject the selected object
   * @return the details component for the given provider and selected object
   */
  @NotNull
  private Component createDetailsComponent( @NotNull DetailsProvider<Object> provider, @NotNull Object selectedObject ) {
    Lookup details = provider.getDetails( selectedObject );

    //Delegate the view
    PageComponentContextAware pageComponentContextAware = details.lookup( PageComponentContextAware.class );
    if ( pageComponentContextAware != null ) {
      pageComponentContextAware.updateContext( getContext() );
    }

    //When a form is available, set the title pane as messagable
    Form form = details.lookup( Form.class );
    if ( form != null ) {
      form.newSingleLineResultsReporter( titlePane );
    }

    //Register delegating listener
    delegatingApplicationListener = details.lookup( ApplicationListener.class );

    //Insert the component
    Component component;
    DetailsComponentFactory componentFactory = details.lookup( DetailsComponentFactory.class );
    if ( componentFactory != null ) {
      component = componentFactory.createComponent();
    } else {
      component = details.lookup( Component.class );
      if ( component == null ) {
        throw new IllegalStateException( "No componentFactory and no component provided for " + selectedObject );
      }
    }
    return component;
View Full Code Here

    //    log.debug( "--> new application event occured from " + event.getSource() + " of type: " + event.getClass().getName() );
    //    log.debug( "\t " + event.toString() );

    if ( event instanceof LifecycleApplicationEvent ) {
      if ( event instanceof SelectionEvent ) {
        Lookup lookup = ( ( SelectionEvent ) event ).getObjects();
        //        log.debug( "\t --- SelectionEvent --- with elements.size: " + lookup.lookups().size() );
        //
        //        for ( Map.Entry<Class<?>, Object> entry : lookup.lookups().entrySet() ) {
        //          log.debug( "\t\t" + entry.getKey().getName() + ": " + entry.getValue() );
        //        }
View Full Code Here

   * @return the presentation that has been created
   */
  @Override
  @NotNull
  public T present( @NotNull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

   * @return the presentation that has been created
   */
  @Override
  @NotNull
  public T present( @NotNull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

   * Creates the presentation for the given struct. This method should not be overridden.
   */
  @Override
  @NotNull
  public T present( @NotNull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

   * @return the presentation that has been created
   */
  @Override
  @NotNull
  public T present( @NotNull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

   * Creates the presentation for the given struct. This method should not be overridden.
   */
  @Override
  @Nonnull
  public T present( @Nonnull StructPart struct ) {
    Lookup lookup = struct.getLookup();
    T presentation = createPresentation();

    //Only hold the presentation as weak reference
    final WeakReference<T> weakPresentationReference = new WeakReference<T>( presentation );

View Full Code Here

TOP

Related Classes of com.cedarsoft.lookup.Lookup

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.