Examples of ExpansionAdapter


Examples of org.eclipse.ui.forms.events.ExpansionAdapter

        otherMatchSection.setText( Messages.getString( "AttributeTypeDescriptionDetailsPage.OtherMatchingRules" ) ); //$NON-NLS-1$
        otherMatchSection.marginWidth = 0;
        otherMatchSection.marginHeight = 0;
        otherMatchSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( otherMatchSection );
        otherMatchSection.addExpansionListener( new ExpansionAdapter()
        {
            public void expansionStateChanged( ExpansionEvent e )
            {
                detailForm.reflow( true );
            }
        } );

        // create used as must section
        usedAsMustSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
        usedAsMustSection.setText( Messages.getString( "AttributeTypeDescriptionDetailsPage.UsedAsMust" ) ); //$NON-NLS-1$
        usedAsMustSection.marginWidth = 0;
        usedAsMustSection.marginHeight = 0;
        usedAsMustSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( usedAsMustSection );
        usedAsMustSection.addExpansionListener( new ExpansionAdapter()
        {
            public void expansionStateChanged( ExpansionEvent e )
            {
                detailForm.reflow( true );
            }
        } );

        // create used as may section
        usedAsMaySection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
        usedAsMaySection.setText( Messages.getString( "AttributeTypeDescriptionDetailsPage.UsedAsMay" ) ); //$NON-NLS-1$
        usedAsMaySection.marginWidth = 0;
        usedAsMaySection.marginHeight = 0;
        usedAsMaySection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( usedAsMaySection );
        usedAsMaySection.addExpansionListener( new ExpansionAdapter()
        {
            public void expansionStateChanged( ExpansionEvent e )
            {
                detailForm.reflow( true );
            }
        } );

        // create supertype section
        supertypeSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
        supertypeSection.setText( Messages.getString( "AttributeTypeDescriptionDetailsPage.Supertype" ) ); //$NON-NLS-1$
        supertypeSection.marginWidth = 0;
        supertypeSection.marginHeight = 0;
        supertypeSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( supertypeSection );
        supertypeSection.addExpansionListener( new ExpansionAdapter()
        {
            public void expansionStateChanged( ExpansionEvent e )
            {
                detailForm.reflow( true );
            }
        } );

        // create subtypes section
        subtypesSection = toolkit.createSection( detailForm.getBody(), Section.TWISTIE );
        subtypesSection.setText( Messages.getString( "AttributeTypeDescriptionDetailsPage.Subtypes" ) ); //$NON-NLS-1$
        subtypesSection.marginWidth = 0;
        subtypesSection.marginHeight = 0;
        subtypesSection.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
        toolkit.createCompositeSeparator( subtypesSection );
        subtypesSection.addExpansionListener( new ExpansionAdapter()
        {
            public void expansionStateChanged( ExpansionEvent e )
            {
                detailForm.reflow( true );
            }
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

        toolkit.decorateFormHeading(form.getForm());
       
        final Section section = toolkit.createSection(form.getBody(), SECTION_STYLE);
        section.setText("Country Details");
        section.setDescription("Update country details below.");
        section.addExpansionListener(new ExpansionAdapter(){
            public void expansionStateChanged( ExpansionEvent e ) {
                // Nothing
            }
        });
        final Composite client = toolkit.createComposite(section, SWT.NONE);
        GridLayout sectionLayout = new GridLayout();
        sectionLayout.numColumns = 4;
        client.setLayout(sectionLayout);
        section.setClient(client);

        // SWT Widgets
        Label label = toolkit.createLabel(client, NAME_FORMA_LBL, LABEL_STYLE);
        FormTextCellEditor nameFormalEditor = new FormTextCellEditor(client, form.getMessageManager());
        nameFormal = (Text) nameFormalEditor.getControl();
        nameFormal.setData(NAME_FORMA_LBL);
        nameFormal.addKeyListener(this);
        GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        nameFormal.setLayoutData(layoutData);

        label = toolkit.createLabel(client, NAME_SORT_LBL, LABEL_STYLE);
        FormTextCellEditor nameSortEditor = new FormTextCellEditor(client, form.getMessageManager());
        nameSort = (Text) nameSortEditor.getControl();
        nameSort.setData(NAME_SORT_LBL);
        nameSort.addKeyListener(this);
        layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        nameSort.setLayoutData(layoutData);

        label = toolkit.createLabel(client, POP_EST_LBL, LABEL_STYLE);
        FormTextCellEditor populationEditor = new FormTextCellEditor(client, form.getMessageManager());
        population = (Text) populationEditor.getControl();
        population.setData(POP_EST_LBL);
        population.addKeyListener(this);
        layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        population.setLayoutData(layoutData);
       
        label = toolkit.createLabel(client, TYPE_LBL, LABEL_STYLE);
        FormComboBoxCellEditor typeEditor = new FormComboBoxCellEditor(client, TYPE_OPTS, form.getMessageManager());
        type = (CCombo) typeEditor.getControl();
        type.addSelectionListener(new SelectionAdapter(){
            @Override
            public void widgetSelected( SelectionEvent e ) {
                setEnabled(true);
            }
        });
        layoutData = new GridData();
        layoutData.horizontalSpan = 3;
        type.setLayoutData(layoutData);
       
        // JFace Viewer
        label = toolkit.createLabel(client, COLOR_MAP_LBL, LABEL_STYLE);
        FormComboBoxCellEditor colorEditor = new FormComboBoxCellEditor(client, new String[]{}, form.getMessageManager());
        CCombo colorCombo = (CCombo) colorEditor.getControl();
        colorMap = new ComboViewer(colorCombo);
        colorMap.addSelectionChangedListener(this);
        layoutData = new GridData();
        layoutData.horizontalSpan = 3;
        colorMap.getControl().setLayoutData(layoutData);

        // hook up to data
        colorMap.setContentProvider(new IStructuredContentProvider(){
            public Object[] getElements( Object inputElement ) {
                if (inputElement instanceof Object[]) {
                    return (Object[]) inputElement;
                }
                return null;
            }
            public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
                // For dynamic content we would register listeners here
            }
            public void dispose() {
                // Nothing
            }
        });
        colorMap.setLabelProvider(new LabelProvider(){
            public String getText( Object element ) {
                return " " + element + " color";
            }
        });
        colorMap.setInput(COLOR_MAP_OPTS);

        // Other sample section - to try out ColumnLayout
        final Section sectionOther = toolkit.createSection(form.getBody(), SECTION_STYLE);
        sectionOther.setText("Others");
        sectionOther
                .setDescription("Sample section to demo ColumnLayout, make the view width smaller to force it to relayout.");
        sectionOther.addExpansionListener(new ExpansionAdapter(){
            public void expansionStateChanged( ExpansionEvent e ) {
                // Nothing
            }
        });
        final Composite clientOther = toolkit.createComposite(sectionOther, SWT.NONE);
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

        toolkit.decorateFormHeading(form.getForm());

        final Section section = toolkit.createSection(form.getBody(), SECTION_STYLE);
        section.setText("Country Details");
        section.setDescription("Update country details below.");
        section.addExpansionListener(new ExpansionAdapter(){
            public void expansionStateChanged( ExpansionEvent e ) {
                // Nothing
            }
        });
        final Composite client = toolkit.createComposite(section, SWT.NONE);
        GridLayout sectionLayout = new GridLayout();
        sectionLayout.numColumns = 4;
        client.setLayout(sectionLayout);
        section.setClient(client);

        // SWT Widgets
        Label label = toolkit.createLabel(client, NAME_FORMA_LBL, LABEL_STYLE);
        nameFormal = toolkit.createText(client, "", FIELD_STYLE);
        nameFormal.setData(NAME_FORMA_LBL);
        nameFormal.addFocusListener(this);
        nameFormal.addKeyListener(this);
        GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        nameFormal.setLayoutData(layoutData);

        label = toolkit.createLabel(client, NAME_SORT_LBL, LABEL_STYLE);
        nameSort = toolkit.createText(client, "", FIELD_STYLE);
        nameSort.setData(NAME_SORT_LBL);
        nameSort.addFocusListener(this);
        nameSort.addKeyListener(this);
        layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        nameSort.setLayoutData(layoutData);

        label = toolkit.createLabel(client, POP_EST_LBL, LABEL_STYLE);
        population = toolkit.createText(client, "", FIELD_STYLE);
        population.setData(POP_EST_LBL);
        population.addFocusListener(this);
        population.addKeyListener(this);
        layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        population.setLayoutData(layoutData);

        label = toolkit.createLabel(client, "", LABEL_STYLE);
        type = toolkit.createButton(client, TYPE_SOV_LBL, SWT.CHECK);
        type.addMouseListener(this);
        layoutData = new GridData(GridData.FILL_HORIZONTAL);
        layoutData.horizontalSpan = 3;
        type.setLayoutData(layoutData);
       
        // JFace Viewer
        label = toolkit.createLabel(client, "Color Map:", LABEL_STYLE);
        colorMap = new ComboViewer(client, FIELD_STYLE);
        colorMap.addSelectionChangedListener(this);
        layoutData = new GridData();
        layoutData.horizontalSpan = 3;
        colorMap.getControl().setLayoutData(layoutData);

        // hook up to data
        colorMap.setContentProvider(new IStructuredContentProvider(){
            public Object[] getElements( Object inputElement ) {
                if (inputElement instanceof Object[]) {
                    return (Object[]) inputElement;
                }
                return null;
            }
            public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
                // for dynamic content we would register listeners here
            }
            public void dispose() {
            }
        });
        colorMap.setLabelProvider(new LabelProvider(){
            public String getText( Object element ) {
                return " " + element + " color";
            }
        });
        colorMap.setInput(COLOR_MAP_OPTS);

        // Other sample section - to try out ColumnLayout
        final Section sectionOther = toolkit.createSection(form.getBody(), SECTION_STYLE);
        sectionOther.setText("Others");
        sectionOther
                .setDescription("Sample section to demo ColumnLayout, make the view width smaller to force it to relayout.");
        sectionOther.addExpansionListener(new ExpansionAdapter(){
            public void expansionStateChanged( ExpansionEvent e ) {
                // Nothing
            }
        });
        final Composite clientOther = toolkit.createComposite(sectionOther, SWT.NONE);
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

    ExpandableComposite expandItem = new ExpandableComposite(container, SWT.NONE);
    expandItem.setExpanded(false);
    expandItem.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    expandItem.setText("Custom Component");
    expandItem.addExpansionListener(new ExpansionAdapter() {
     
      public void expansionStateChanged(ExpansionEvent e) {
        updateScrolledComposite();
      }
    });
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

        sExpanded = "true";
      expandItem.setExpanded(sExpanded.equals("true"));
      expandItem.setFont(JFaceResources.getFontRegistry().getBold(
          JFaceResources.DIALOG_FONT));
      expandItem.setText(displayName);
      expandItem.addExpansionListener(new ExpansionAdapter() {
       
        public void expansionStateChanged(ExpansionEvent e) {
          updateScrolledComposite();
        }
      });
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

            Messages.DDE_OverviewPage_General_Section_Title,
            Messages.DDE_OverviewPage_General_Section_Description, 10, 3, TableWrapData.FILL_GRAB,
            TableWrapData.FILL_GRAB, 1, 1);

    section.setExpanded(true);
    section.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        form.reflow(true);
      }
    });
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

    Section section = FormSection.createTableWrapDataSection(toolkit, parent, Section.TREE_NODE
            | Section.DESCRIPTION, Messages.DDE_OverviewPage_Service_Section_Title,
            Messages.DDE_OverviewPage_Service_Section_Description, 10, 3, TableWrapData.FILL_GRAB,
            TableWrapData.FILL_GRAB, 1, 1);
    section.setExpanded(true);
    section.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        form.reflow(true);
      }
    });
    Composite sectionClient = toolkit.createComposite(section);
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

        clientArea.setLayoutData(gridData);

        GridLayout layout = new GridLayout(numColumns, false);
        layout.marginBottom = 2;
        clientArea.setLayout(layout);
        section.addExpansionListener(new ExpansionAdapter() {

            @Override
            public void expansionStateChanged(ExpansionEvent e) {
                if (e.getState()) {
                    for (ISwimlaneElementListener listener : listeners) {
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

         Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
    searchParamSection.setText(Messages.getString("SearchView.SearchParametersSectionTitle")); //$NON-NLS-1$
    GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    searchParamSection.setLayoutData(gd);
   
    searchParamSection.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        reflowDisplay();
      }
    });

   
    Composite searchParamClient = toolkit.createComposite(searchParamSection);
    searchParamClient.setLayout(new GridLayout(4, false));
   
    searchTermLabel = toolkit.createLabel(searchParamClient, Messages.getString("SearchView.SearchTermLabel")); //$NON-NLS-1$
    searchText = toolkit.createText(searchParamClient, ""); //$NON-NLS-1$
    gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    gd.horizontalSpan = 3;
    searchText.setLayoutData(gd);
   
    searchText.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if (e.keyCode == SWT.CR) {
          doSearch();
        }     
      }
    });
   
    searchScopeExpComposite = toolkit.createExpandableComposite(searchParamClient,
           ExpandableComposite.TREE_NODE|
           ExpandableComposite.CLIENT_INDENT);
    searchScopeExpComposite.setText(Messages.getString("SearchView.SearchScope")); //$NON-NLS-1$
   
    gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    gd.horizontalSpan = 4;
    searchScopeExpComposite.setLayoutData(gd);
   
    Composite searchScopeComposite = toolkit.createComposite(searchScopeExpComposite);
    searchScopeComposite.setLayout(new GridLayout(5, false));
   
    searchInTitle = toolkit.createButton(searchScopeComposite, Messages.getString("SearchView.SearchInTitleCheck"), SWT.CHECK); //$NON-NLS-1$
    searchInArtist = toolkit.createButton(searchScopeComposite, Messages.getString("SearchView.SearchInArtistCheck"), SWT.CHECK); //$NON-NLS-1$
    searchInAlbum = toolkit.createButton(searchScopeComposite, Messages.getString("SearchView.SearchInAlbumCheck"), SWT.CHECK); //$NON-NLS-1$
    searchInGenre = toolkit.createButton(searchScopeComposite, Messages.getString("SearchView.SearchInGenreCheck"), SWT.CHECK);     //$NON-NLS-1$
    searchInYear = toolkit.createButton(searchScopeComposite, Messages.getString("SearchView.SearchInYearCheck"), SWT.CHECK); //$NON-NLS-1$
   
    toolkit.paintBordersFor(searchScopeComposite);
    searchScopeExpComposite.setClient(searchScopeComposite);
   
    searchScopeExpComposite.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        reflowDisplay();
      }
    });
   
    searchOptionsExpComposite = toolkit.createExpandableComposite(searchParamClient,
           ExpandableComposite.TREE_NODE|
           ExpandableComposite.CLIENT_INDENT);
    searchOptionsExpComposite.setText(Messages.getString("SearchView.SearchOptions")); //$NON-NLS-1$
   
    gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    gd.horizontalSpan = 4;
    searchOptionsExpComposite.setLayoutData(gd);
   
    Composite searchOptionsComposite = toolkit.createComposite(searchOptionsExpComposite);
    searchOptionsComposite.setLayout(new GridLayout(2, false));
   
    searchCaseSensitive = toolkit.createButton(searchOptionsComposite, Messages.getString("SearchView.SearchCaseSensitive"), SWT.CHECK); //$NON-NLS-1$
    searchWholeWord = toolkit.createButton(searchOptionsComposite, Messages.getString("SearchView.SearchWholeWord"), SWT.CHECK); //$NON-NLS-1$
   
    toolkit.paintBordersFor(searchOptionsComposite);
    searchOptionsExpComposite.setClient(searchOptionsComposite);
   
    searchOptionsExpComposite.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {               
        reflowDisplay();
      }
    });
   
    advancedSearchExpComposite = toolkit.createExpandableComposite(searchParamClient,
           ExpandableComposite.TREE_NODE|
           ExpandableComposite.CLIENT_INDENT);
    advancedSearchExpComposite.setText(Messages.getString("SearchView.AdvancedSearchTitle")); //$NON-NLS-1$

    gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    gd.horizontalSpan = 4;
    advancedSearchExpComposite.setLayoutData(gd);
   
    Composite advancedSearchComposite = toolkit.createComposite(advancedSearchExpComposite);
    advancedSearchComposite.setLayout(new GridLayout(2, false));

    toolkit.createLabel(advancedSearchComposite, Messages.getString("SearchView.AdvancedSearchQueryLabel")); //$NON-NLS-1$
    queryText = toolkit.createText(advancedSearchComposite, ""); //$NON-NLS-1$
    queryText.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
   
    queryText.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent e) {
        if (e.keyCode == SWT.CR) {
          doSearch();
        }     
      }
    });
   
    toolkit.paintBordersFor(advancedSearchComposite);
    advancedSearchExpComposite.setClient(advancedSearchComposite);
   
    UpdateEnableState(true);
   
    advancedSearchExpComposite.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        UpdateEnableState(!advancedSearchExpComposite.isExpanded());
       
        reflowDisplay();
      }
View Full Code Here

Examples of org.eclipse.ui.forms.events.ExpansionAdapter

                | ExpandableComposite.CLIENT_INDENT);
        serverOptionsExpandableComposite.setLayoutData(GridDataFactory
            .fillDefaults().grab(true, true).minSize(SWT.DEFAULT, 50).create());
        serverOptionsExpandableComposite.setText("Server Options");
        serverOptionsExpandableComposite
            .addExpansionListener(new ExpansionAdapter() {
                @Override
                public void expansionStateChanged(ExpansionEvent e) {
                    getParent().layout();
                }
            });
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.