/**
  * Refreshes the list of Volumes to display in the for the given
  *
  * @param selectedImage
  */
 public void setSelectedImage(final IDockerImage selectedImage) {
   if (this.selectedImage != selectedImage) {
     this.selectedImage = selectedImage;
     final WritableList newDataVolumes = new WritableList();
     if (selectedImage != null) {
       this.imageInfo = selectedImage.getConnection().getImageInfo(selectedImage.id());
       if (this.imageInfo.config() != null && this.imageInfo.config().volumes() != null) {
         for (String volume : this.imageInfo.config().volumes()) {
           newDataVolumes.add(new DataVolumeModel(volume));
         }
       }
     }
     setDataVolumes(newDataVolumes);
   }
 }
Exemplo n.º 2
0
  @Override
  public IObservableList getChildList(final Object element) {
    final WritableList list = new WritableList();
    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_ADDONS,
            APPLICATION__ADDONS,
            element,
            Messages.ApplicationEditor_Addons) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_ROOT_CONTEXTS,
            BINDING_TABLE_CONTAINER__ROOT_CONTEXT,
            element,
            Messages.ApplicationEditor_RootContexts) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_BINDING_TABLE,
            BINDING_CONTAINER__BINDINGS,
            element,
            Messages.ApplicationEditor_BindingTables) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_HANDLER,
            HANDLER_CONTAINER__HANDLERS,
            element,
            Messages.ApplicationEditor_Handlers) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_COMMAND,
            APPLICATION__COMMANDS,
            element,
            Messages.ApplicationEditor_Commands) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_CATEGORIES,
            APPLICATION__CATEGORIES,
            element,
            Messages.ApplicationEditor_Categories) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_APPLICATION_WINDOWS,
            ELEMENT_CONTAINER__CHILDREN,
            element,
            Messages.ApplicationEditor_Windows) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_PART_DESCRIPTORS,
            PART_DESCRIPTOR_CONTAINER__DESCRIPTORS,
            element,
            Messages.ApplicationEditor_PartDescriptors) {

          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_MENU_CONTRIBUTIONS,
            MENU_CONTRIBUTIONS,
            element,
            Messages.ApplicationEditor_MenuContributions) {
          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_TOOLBAR_CONTRIBUTIONS,
            TOOLBAR_CONTRIBUTIONS,
            element,
            Messages.ApplicationEditor_ToolBarContributions) {
          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });

    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_TRIM_CONTRIBUTIONS,
            TRIM_CONTRIBUTIONS,
            element,
            Messages.ApplicationEditor_TrimContributions) {
          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });
    list.add(
        new VirtualEntry<Object>(
            ModelEditor.VIRTUAL_SNIPPETS,
            APPLICATION__SNIPPETS,
            element,
            Messages.ApplicationEditor_Snippets) {
          @Override
          protected boolean accepted(Object o) {
            return true;
          }
        });
    //
    // MApplication application = (MApplication) element;
    // if (application.getRootContext() != null) {
    // list.add(0, application.getRootContext());
    // }

    // BINDING_TABLE_CONTAINER__ROOT_CONTEXT.observe(element).addValueChangeListener(new
    // IValueChangeListener() {
    //
    // public void handleValueChange(ValueChangeEvent event) {
    // if (event.diff.getOldValue() != null) {
    // list.remove(event.diff.getOldValue());
    // if (getMaster().getValue() == element) {
    // createRemoveRootContext.setSelection(false);
    // }
    // }
    //
    // if (event.diff.getNewValue() != null) {
    // list.add(0, event.diff.getNewValue());
    // if (getMaster().getValue() == element) {
    // createRemoveRootContext.setSelection(true);
    // }
    // }
    // }
    // });

    return list;
  }