Java 类org.eclipse.swt.widgets.ExpandBar 实例源码

项目:Hydrograph    文件:ExpressionCompositeFactory.java   
/**
   * @param parent
   * @param mappingSheetRow
   * @param component
   * @param widgetConfig
   * @return ExpressionComposite object on the basis of component name
   */
  public AbstractExpressionComposite getComposite(ExpandBar parent,MappingSheetRow mappingSheetRow,Component component
,WidgetConfig widgetConfig )
  {
 if(Constants.NORMALIZE.equalsIgnoreCase(component.getComponentName()))
 {
return new NormalizeExpressionComposite(parent, SWT.None, mappingSheetRow, component, widgetConfig);
 }
 else if(Constants.TRANSFORM.equalsIgnoreCase(component.getComponentName()))
 {
return new TransformExpressionComposite(parent, SWT.None, mappingSheetRow, component, widgetConfig);
 }
 else if(Constants.AGGREGATE.equalsIgnoreCase(component.getComponentName())||
    Constants.CUMULATE.equalsIgnoreCase(component.getComponentName()))
 {
return new AggregateCumulateExpressionComposite(parent, SWT.None, mappingSheetRow, component, widgetConfig);
 }
 else if(Constants.GROUP_COMBINE.equalsIgnoreCase(component.getComponentName()))
  {
    return new GroupCombineExpressionComposite(parent, SWT.None, mappingSheetRow, component, widgetConfig);
  }
    return null;
 }
项目:atdl4j    文件:SWTStrategyUI.java   
/**
 * @param aStrategyPanelList
 * @return
 * @throws Atdl4jClassLoadException 
 */
protected void buildAtdl4jWidgetMap( List<StrategyPanelT> aStrategyPanelList )
{
    Map<String, SWTWidget<?>> tempSWTWidgetMap = new HashMap<String, SWTWidget<?>>();

    setExpandBarList( new ArrayList<ExpandBar>() );

    // build panels and widgets recursively
    for ( StrategyPanelT panel : aStrategyPanelList )
    {
        tempSWTWidgetMap.putAll( SWTStrategyPanelFactory.createStrategyPanelAndWidgets( getParent(), panel, getParameterMap(), SWT.NONE, getExpandBarList(), getAtdl4jWidgetFactory() ) );
    }

    // 3/13/2010 John Shields HACK: make the first panel take the full width of the window
    Composite c = getParent();
    for ( Control child : c.getChildren() )
    {
        if (child instanceof Composite) 
        {
          Composite composite = (Composite) child;
          composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
        }
    }

    setSWTWidgetMap( tempSWTWidgetMap );
}
项目:Hydrograph    文件:JoinMapDialog.java   
private void populateInputFieldExpandBarSection(ExpandBar expandBar) {
    List<FilterProperties> inputPortFieldList = null;
    String count=(String)component.getProperties().get(Constants.INPUT_PORT_COUNT_PROPERTY);
    inputPortValue=Integer.valueOf(count);
    for (int i = 0; i < inputPortValue; i++) {
        if (joinMappingGrid != null) {
            if (joinMappingGrid.getLookupInputProperties() != null
                    && !joinMappingGrid.getLookupInputProperties()
                            .isEmpty()) {
                if (i < joinMappingGrid.getLookupInputProperties().size())
                    inputPortFieldList = joinMappingGrid
                            .getLookupInputProperties().get(i);
                else
                    inputPortFieldList = new ArrayList<>();
            } else {
                inputPortFieldList = new ArrayList<>();
            }
        }
        if (inputPorts != null) {
            inputPorts.add(inputPortFieldList);
            if (inputPortFieldList != null) {
                for (FilterProperties inputField : inputPortFieldList) {
                    allInputFields.add(INPUT_PORT_ID_PREFIX + i + "." + inputField.getPropertyname());
                }
            }

        }

        addExpandItem(expandBar, inputPortFieldList, i);
    }
}
项目:Hydrograph    文件:OperationClassDeleteDialog.java   
/**
 * @param parentShell
 * @param transformMapping
 * @param expandBar
 */
public OperationClassDeleteDialog(Shell parentShell, TransformMapping transformMapping, ExpandBar expandBar,Component component) {
    super(parentShell);
    this.mappingSheetRowList =transformMapping.getMappingSheetRows();
    this.expandBar = expandBar;
    this.outerOutputList=transformMapping.getOutputFieldList();
    this.component=component;
}
项目:tlaplus    文件:ProblemView.java   
/**
 * Creates the layout and fill it with data 
 */
public void createPartControl(Composite parent)
{
    bar = new ExpandBar(parent, SWT.V_SCROLL | SWT.BORDER);
    bar.setSpacing(8);
    UIHelper.setHelp(bar, "ProblemView");
    fillData(Activator.getSpecManager().getSpecLoaded());
}
项目:tlaplus    文件:ObligationsView.java   
public void createPartControl(Composite parent)
{
    /*
     * Create the expand bar that will contain
     * a list of ExpandItems with interesting information
     * about obligations. The items for each obligation are created
     * in the method newMarker().
     */
    bar = new ExpandBar(parent, SWT.V_SCROLL | SWT.BORDER);
    bar.setSpacing(8);

    fillFromCurrentSpec();
}
项目:atdl4j    文件:SWTStrategyPanelHelper.java   
/**
 * Navigates through aWidget's getParent() looking for ExpandBar with ExpandItems not-yet-expanded and expands those
 * @param aWidget
 * @return boolean indicating whether any ExpandBar ExpandItems were adjusted
 */
public boolean expandAtdl4jWidgetParentStrategyPanel( Atdl4jWidget<?> aWidget )
{
    boolean tempAdjustedFlag = false;
    if ( ( aWidget.getParent() != null ) && ( aWidget.getParent() instanceof Composite ) )
    {
        Composite tempParent = (Composite) aWidget.getParent();

        while ( tempParent != null ) 
        {
            // -- Expand if necessary --
            if ( tempParent instanceof ExpandBar )
            {
                ExpandBar tempExpandBar = (ExpandBar) tempParent;
                for ( ExpandItem tempExpandItem : tempExpandBar.getItems() )
                {
                    if ( ! tempExpandItem.getExpanded() )
                    {
                        tempExpandItem.setExpanded( true );
                        // -- (relayoutParents=false) --
                        relayoutExpandBar( tempExpandBar, false );
                        tempAdjustedFlag = true;
                    }
                }
            }

            // -- Iterate to next parent --
            if ( ( tempParent.getParent() != null ) && ( ( tempParent.getParent() instanceof Composite ) ) )
            {
                tempParent = (Composite) tempParent.getParent();
            }
            else
            {
                break;
            }
        }
    }

    return tempAdjustedFlag;
}
项目:atdl4j    文件:SWTStrategyUI.java   
public void relayoutCollapsibleStrategyPanels()
{
    // -- avoid lots of 'thrash' during initial build/load of the various Strategy panels containing one or more collapsible panels --      
    for ( ExpandBar tempExpandBar : getExpandBarList() )
    {
        // -- Force re-sizing (to support non-collapsed, collapsible ExpandBar components) --
        if ( tempExpandBar.getItem( 0 ).getExpanded() )
        {
            SWTStrategyPanelHelper.relayoutExpandBar( tempExpandBar, false );
        }
    }
}
项目:atdl4j    文件:SWTRelayoutExpandBarThread.java   
public SWTRelayoutExpandBarThread( ExpandBar anExpandBar )
{
    expandBar = anExpandBar;

    Display.getCurrent().asyncExec(new Runnable()
    {
        public void run()
        {
            SWTStrategyPanelHelper.relayoutExpandBar( expandBar );
        }
    });
}
项目:convertigo-eclipse    文件:EnginePreferenceComposite.java   
public ExpandBar getExpandBar(){
    return bar;
}
项目:Hydrograph    文件:JoinMapDialog.java   
private void createInputFieldExpandBarSection(Composite composite) {
    Composite composite_1 = new Composite(composite, SWT.NONE);
    GridLayout gl_composite_1 = new GridLayout(1, false);
    gl_composite_1.horizontalSpacing = 0;
    gl_composite_1.verticalSpacing = 0;
    gl_composite_1.marginWidth = 0;
    gl_composite_1.marginHeight = 0;
    composite_1.setLayout(gl_composite_1);
    GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, false, true,
            1, 1);
    gd_composite_1.widthHint = 276;
    composite_1.setLayoutData(gd_composite_1);
    composite_1.setBounds(0, 0, 64, 64);

    final ScrolledComposite scrolledComposite_1 = new ScrolledComposite(
            composite_1, SWT.BORDER | SWT.V_SCROLL );
    scrolledComposite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
            true, true, 1, 1));
    scrolledComposite_1.setExpandHorizontal(true);
    scrolledComposite_1.setExpandVertical(true);

    Composite composite_7 = new Composite(scrolledComposite_1, SWT.NONE);
    composite_7.setLayout(new GridLayout(1, false));

    final ExpandBar expandBar = new ExpandBar(composite_7, SWT.H_SCROLL);
    expandBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1,
            1));

    expandBar.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 240, 240, 240));
    populateInputFieldExpandBarSection(expandBar);

    expandBar.getItem(0).setExpanded(true);

    scrolledComposite_1.setContent(composite_7);
    scrolledComposite_1.setMinSize(composite_7.computeSize(SWT.DEFAULT,
            SWT.DEFAULT));


    composite_7.addControlListener(new ControlAdapter() {
        @Override
        public void controlResized(ControlEvent e) {

            for(ExpandItem expandItem:expandBar.getItems()){
                ((TableColumn)expandItem.getData("TableColumn")).setWidth(scrolledComposite_1.getSize().x);
            }
        }
    });
}
项目:TranskribusSwtGui    文件:ExpandBarControlsAdding.java   
public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new FillLayout());
    shell.setText("ExpandBar Example");
    ExpandBar bar = new ExpandBar(shell, SWT.V_SCROLL);
//    Image image = new Image(display, "yourFile.gif");

    // First item
    Composite composite = new Composite(bar, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginLeft = layout.marginTop = layout.marginRight = layout.marginBottom = 10;
    layout.verticalSpacing = 10;
    composite.setLayout(layout);
    Button button = new Button(composite, SWT.PUSH);
    button.setText("SWT.PUSH");
    button = new Button(composite, SWT.RADIO);
    button.setText("SWT.RADIO");
    button = new Button(composite, SWT.CHECK);
    button.setText("SWT.CHECK");
    button = new Button(composite, SWT.TOGGLE);
    button.setText("SWT.TOGGLE");
    ExpandItem item0 = new ExpandItem(bar, SWT.NONE, 0);
    item0.setText("What is your favorite button");
    item0.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    item0.setControl(composite);


    ExpandItem item1 = new ExpandItem(bar, SWT.NONE, 0);
    item1.setText("What is your favorite button2");
    item1.setHeight(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    Button btn = new Button(bar, SWT.PUSH);
    btn.setText("hello");
    item1.setControl(btn);    


//    item0.setImage(image);

    item0.setExpanded(true);

    bar.setSpacing(8);
    shell.setSize(400, 350);
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
//    image.dispose();
    display.dispose();
  }
项目:TranskribusSwtGui    文件:StructuralMetadataWidget.java   
public StructuralMetadataWidget(Composite parent, int style) {
        super(parent, style);
        this.setLayout(new GridLayout(2, false));
        this.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1));

        if (USE_EXPAND_BAR) {
            bar = new ExpandBar(this, SWT.V_SCROLL);
        }

        Composite container = USE_EXPAND_BAR ? bar : this;

        initPageMd();

        Label l0 = new Label(this, 0);
        l0.setText("Selected element type: ");

//      selectedShapeTypeText = new Text(this, SWT.SINGLE | SWT.BORDER);
//      selectedShapeTypeText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        shapeTypeCombo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
        shapeTypeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

        shapeTypeCombo.setItems(RegionTypeUtil.ALL_REGIONS.toArray(new String[0]));

//      regionTypeText.setText("whatever");

        structureGroup = new Group(container, SWT.NONE);
//      structureGroup = new Composite(expandBar, SWT.NONE);
        structureGroup.setText("Structure Type");
        structureGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
        GridLayout structureGl = new GridLayout(2, false);
        structureGl.verticalSpacing = 0;
        structureGl.marginWidth = 1;
        structureGroup.setLayout(structureGl);

//      Label l1 = new Label(structureGroup, SWT.NONE);
//      l1.setText("Structure: ");
        structureText = new Text(structureGroup, SWT.SINGLE | SWT.BORDER);
        structureText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
        structureText.setToolTipText("The structure type of the selected element - you can edit this field to change the type or choose any of the predifined types below. Clear this text to remove a previously defined structure type.");
        structModifyListener = new ModifyListener() {
            @Override public void modifyText(ModifyEvent e) {
                setStructureType(structureText.getText());
            }
        };
        structureText.addModifyListener(structModifyListener);

        for (final TextTypeSimpleType t : TextTypeSimpleType.values()) {
            final Button btn = createButton(structureGroup, SWT.RADIO, t.value(), 1, false);
            btn.addSelectionListener(new SelectionAdapter() {
                @Override public void widgetSelected(SelectionEvent e) {
                    setStructureType(t.value());
                }
            });
            structureRadios.add(btn);
        }

        new Label(structureGroup, 0); // needed to align following button correctly!


        applyStructBtn = new Button(structureGroup, SWT.PUSH);
        applyStructBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        applyStructBtn.setText("Apply");
        applyStructBtn.setToolTipText("Applies the structure to all selected elements (note: if multiple elements are selected, the metadata is not applied automatically but with this button)");

        applyStructRecBtn = new Button(structureGroup, SWT.PUSH);
        applyStructRecBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
        applyStructRecBtn.setText("Apply down");
        applyStructRecBtn.setToolTipText("Applies the structure to all selected elements and its child elements, e.g. for a region and all its line and word elements!");

        structureGroup.pack();

//      initTaggingWidget(container);

//      initTextStyleMd(container);

        if (USE_EXPAND_BAR)
            initExpandItmes();
    }
项目:Archie-Smart-IDE    文件:GraphView.java   
/*******************************************************
 * Creates the left control panel of the graph view
 * 
 * @param parent
 *            The {@link SashForm} parent of this panel
 *******************************************************/
private void createLeftControlPanel(Composite parent)
{
    // The expand bar
    ExpandBar bar = new ExpandBar(parent, SWT.V_SCROLL);

    // Create the composites of the Macro/Micro Expand Items:

    // --- 1 - The Macro composite
    Composite macroComp = new Composite(bar, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
    macroComp.setLayout(new GridLayout(1, true));
    macroComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    // The enable button of the macro graph
    mEnableMacroGraph = new Button(macroComp, SWT.RADIO);
    mEnableMacroGraph.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
    mEnableMacroGraph.setText("Enable Macro Graph");

    // The list of tactics for the macro graph: contains check boxes
    mMacroTactics = new Group(macroComp, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
    mMacroTactics.setLayout(new GridLayout(1, true));
    mMacroTactics.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    mMacroTactics.setText("Select Tactics");

    // --- 2 - The Micro composite
    Composite microComp = new Composite(bar, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
    microComp.setLayout(new GridLayout(1, true));
    microComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    // The enable button of the micro graph
    mEnableMicroGraph = new Button(microComp, SWT.RADIO);
    mEnableMicroGraph.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
    mEnableMicroGraph.setText("Enable Micro Graph");

    // The list of tactics for the macro graph: contains check boxes
    mMicroTactics = new Group(microComp, SWT.BORDER | SWT.SHADOW_ETCHED_IN);
    mMicroTactics.setLayout(new GridLayout(1, true));
    mMicroTactics.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    mMicroTactics.setText("Select a Tactic");

    // Create the expand items:

    // 1 - The Macro Graph Expand Item
    mMacroExpandItem = new ExpandItem(bar, SWT.NONE);
    mMacroExpandItem.setText("Macro Graph");
    mMacroExpandItem.setImage(mImageRegistry.getImage("timIcon"));
    // Set the control of the expand item
    mMacroExpandItem.setHeight(macroComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    mMacroExpandItem.setControl(macroComp);

    // 2 - The Macro Graph Expand Item
    mMicroExpandItem = new ExpandItem(bar, SWT.NONE);
    mMicroExpandItem.setText("Micro Graph");
    mMicroExpandItem.setImage(mImageRegistry.getImage("timIcon"));
    // Set the control of the expand item
    mMicroExpandItem.setHeight(microComp.computeSize(SWT.DEFAULT, SWT.DEFAULT).y);
    mMicroExpandItem.setControl(microComp);

    // Expand the macro item by default
    mMacroExpandItem.setExpanded(true);
    mMicroExpandItem.setExpanded(false);
}
项目:collabthings.swt    文件:ObjectContextView.java   
/**
 * Create the composite.
 * 
 * @param parent
 * @param style
 */
public ObjectContextView(CTApp app, AppWindow window, Composite parent, int style) {
    super(parent, style);

    this.app = app;

    setLayout(new GridLayout(1, false));

    ctools = new CTComposite(this, SWT.NONE);
    ctools.setBackground(CTResourceManagerFactory.instance().getActiontitle2Background());
    ctools.setForeground(CTResourceManagerFactory.instance().getActionTitle2Color());

    GridLayout ctoolslayout = new GridLayout();
    ctoolslayout.numColumns = 10;
    ctools.setLayout(ctoolslayout);
    ctools.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    CTLabel ltitle = new CTLabel(ctools, SWT.NONE);

    scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL);
    scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    scrolledComposite.setExpandHorizontal(true);
    scrolledComposite.setExpandVertical(true);
    scrolledComposite.addListener(SWT.Resize, new Listener() {
        @Override
        public void handleEvent(Event arg0) {
            updateLayout();
        }
    });

    expandBar = new ExpandBar(scrolledComposite, SWT.NONE);
    expandBar.setBackground(CTResourceManagerFactory.instance().getControlBg());

    ExpandItem xpndtmUsedIn = new ExpandItem(expandBar, SWT.NONE);
    xpndtmUsedIn.setExpanded(true);
    xpndtmUsedIn.setText("Used in");

    cusedin = new CTComposite(expandBar, SWT.NONE);

    xpndtmUsedIn.setControl(cusedin);
    xpndtmUsedIn.setHeight(xpndtmUsedIn.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT).y);

    xpndtmProperties = new ExpandItem(expandBar, SWT.NONE);
    xpndtmProperties.setExpanded(true);
    xpndtmProperties.setText("Properties");

    propertiesview = new ObjectViewer(app, window, expandBar);
    xpndtmProperties.setControl(propertiesview);

    xpndtmChildren = new ExpandItem(expandBar, SWT.NONE);
    xpndtmChildren.setExpanded(true);
    xpndtmChildren.setText("children");

    createSubpartsTable();

    scrolledComposite.setContent(expandBar);
    scrolledComposite.setMinSize(expandBar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    ltitle.setText("Tree");
    ltitle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    propertiesview.addObjectChangeListener((e) -> {
        updateLayout();
    });
}
项目:redmine.rap    文件:PlanView.java   
private void setReleaseIterations(Map<Integer, Iteration> iterations) {
        // 
        List<TableViewer>
            iterationsViewers = new ArrayList<TableViewer>();
        Rectangle bounds      = iterationsComposite.getBounds();
/*
        for (Control control : iterationsComposite.getChildren()) {
              control.dispose();
        }
*/
        if (iterationsComposite.getChildren().length > 0) {

            iterationsComposite.dispose();      
            iterationsComposite = toolkit.createComposite(planComposite, SWT.NULL);
            iterationsComposite.setLayout(new GridLayout(1, Boolean.TRUE));
            iterationsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));
        }

        ExpandBar expandBar = new ExpandBar(iterationsComposite, SWT.NONE);
        expandBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));

        Composite expandBarComposite = toolkit.createComposite(expandBar, SWT.NULL);
//      expandBarComposite.setLayout((new CustomLayout(1, Boolean.TRUE)).getLayout());
        expandBarComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));

//      iterationsComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));     // TODO

        // For each iteration, paint User Stories
        for (Iteration iteration : iterations.values()) {

            ExpandItem expandItem = new ExpandItem (expandBar, SWT.NONE);
            expandItem.setText(iteration.getName());
            expandItem.setHeight(200);      
            expandItem.setExpanded(Boolean.TRUE);

            Composite iterationComposite = new Composite(expandBar, SWT.NONE);
//          iterationComposite.setLayout(new CustomLayout(1, Boolean.TRUE).getLayout());
            iterationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));
            expandItem.setControl(iterationComposite);

            iterationComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));      // TODO

            TableViewer iterationUserStoriesViewer = new TableViewer(iterationComposite, SWT.BORDER
                                                                                    | SWT.FULL_SELECTION);
            customizeViewer(iterationUserStoriesViewer);

            iterationUserStoriesViewer.setContentProvider(new USContentProvider());
            iterationUserStoriesViewer.setInput(iteration.getUserStories());
            iterationUserStoriesViewer.setItemCount(iteration.getUserStories().size());

            iterationUserStoriesViewer.getTable().setData(iteration.getId());
            iterationUserStoriesViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, Boolean.TRUE, Boolean.TRUE));
            iterationUserStoriesViewer.getTable().setHeaderVisible(Boolean.TRUE);
            iterationUserStoriesViewer.getTable().setSize(iterationComposite.getSize().x,
                                                          iterationComposite.getSize().y);
            iterationUserStoriesViewer.getTable().setLinesVisible(Boolean.TRUE);
            iterationUserStoriesViewer.refresh(Boolean.TRUE);

            iterationsViewers.add(iterationUserStoriesViewer);

            iterationsComposite.setBounds(bounds);
        }

        // DND controls
        setDragControls();
        setDropControls(iterationsViewers);

        // DND Source/Target
        setDragSource();
        setDropTarget();
    }
项目:atdl4j    文件:SWTStrategyPanelHelper.java   
public static void relayoutExpandBar(ExpandBar expandBar, boolean relayoutParents)
{
    Composite c = expandBar;
    int tempMaxControlX = 0;

    logger.debug( "----- relayoutExpandBar (relayoutParents: " + relayoutParents + " expandBar: " + expandBar + " -----" );

    do
    {
        logger.debug( "c: " + c.getClass() + " c.getParent(): " + c.getParent().getClass() );

        if ( c instanceof ExpandBar )
        {
            ExpandBar eb = (ExpandBar) c;

            logger.debug( "ExpandBar.getSize(): " + eb.getSize() );

            for ( ExpandItem expandItem : eb.getItems() )
            {
                logger.debug( "expandItem: " + expandItem + " text: " + expandItem.getText() + " control: " + expandItem.getControl() + " controlLocation: " + expandItem.getControl().getLocation());                  
                logger.debug( "before pack(): expandItem.getControl().getSize(): " + expandItem.getControl().getSize() );

                expandItem.getControl().pack();

                if ( expandItem.getControl().getSize().x > tempMaxControlX )
                {
                    tempMaxControlX = expandItem.getControl().getSize().x;
                }

                logger.debug( "before: expandItem.getHeight(): " + expandItem.getHeight() + " expandItem.getControl().getSize(): " + expandItem.getControl().getSize() );

                expandItem.setHeight( expandItem.getControl().computeSize( eb.getSize().x, SWT.DEFAULT, true ).y );
            }

            // -- Need to set ExpandBar's GridData.widthHint to the width of the widest control within it -- 
            GridData tempGridData2 = (GridData) expandBar.getLayoutData();
            tempGridData2.widthHint = tempMaxControlX;
            // do not set height as ExpandBar handles this tempGridData2.heightHint = expandBar.getSize().y;
            expandBar.setLayoutData( tempGridData2 );


            if ( relayoutParents )
            {
                Control p = c.getParent();

                if ( p instanceof ScrolledComposite )
                {
                    ScrolledComposite scrolledComposite = (ScrolledComposite) p;
                    if ( scrolledComposite.getExpandHorizontal() || scrolledComposite.getExpandVertical() )
                    {
                        scrolledComposite.setMinSize( scrolledComposite.getContent().computeSize( SWT.DEFAULT, SWT.DEFAULT, true ) );
                    }
                    else
                    {
                        scrolledComposite.getContent().pack( true );
                    }
                }

                if ( p instanceof Composite )
                {
                    Composite composite = (Composite) p;
                    composite.layout();
                }
            }
            else
            {
                // -- this (or relayoutParents=true) is needed (otherwise ExampleStrategyPanelTests2.xml with 2 "columns" of StrategyPanels may not draw all of the ExpandBars initially) --
                expandBar.getParent().layout();
            }

        }
        c = c.getParent();
    }
    while ( c != null && c.getParent() != null && !( c instanceof ScrolledComposite ) );


    // -- Needed to ensure that strategy panel is expanded vertically as panels go from collapsed to expanded
    expandBar.getShell().layout();
    expandBar.getShell().pack();
}
项目:atdl4j    文件:SWTStrategyUI.java   
/**
 * @return the expandBarList
 */
protected List<ExpandBar> getExpandBarList()
{
    return this.expandBarList;
}
项目:atdl4j    文件:SWTStrategyUI.java   
/**
 * @param aExpandBarList the expandBarList to set
 */
protected void setExpandBarList(List<ExpandBar> aExpandBarList)
{
    this.expandBarList = aExpandBarList;
}
项目:atdl4j    文件:SWTExpandBarResizer.java   
public void itemCollapsed(ExpandEvent aE)
{
    SWTStrategyPanelHelper.revalidateLayoutAsync( (ExpandBar)composite.getParent() );
}
项目:atdl4j    文件:SWTExpandBarResizer.java   
public void itemExpanded(ExpandEvent aE)
{
    SWTStrategyPanelHelper.revalidateLayoutAsync( (ExpandBar)composite.getParent() );
}
项目:atdl4j    文件:SWTStrategyPanelHelper.java   
/**
 * Helper method contributed on web:
 * http://stackoverflow.com/questions/586414
 * /why-does-an-swt-composite-sometimes
 * -require-a-call-to-resize-to-layout-correctl
 * 
 * @author http://stackoverflow.com/users/63293/peter-walser
 * @param control
 */
// 3/13/2010 John Shields
// streamlined method to increase speed; previously was doing too much
// layout work which made the app very slow.

public static void relayoutExpandBar(ExpandBar expandBar)
{
    relayoutExpandBar( expandBar, true );
}
项目:atdl4j    文件:SWTStrategyPanelHelper.java   
/**
 * Invokes revalidateLayout() within Display.getCurrent().asyncExec(new
 * Runnable() ... )
 * 
 * @param aControl
 */
public static void revalidateLayoutAsync(ExpandBar anExpandBar)
{
    SWTRelayoutExpandBarThread tempRevalidateLayoutThread = new SWTRelayoutExpandBarThread( anExpandBar );
    tempRevalidateLayoutThread.start();
}