Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2011 JBoss Inc
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *       http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.drools.guvnor.client.widgets.wizards;
A widget containing the page title of a Wizard page, along with an indicator (a tick) that the page has been completed and whether it is the currently displayed page (title is made bold).
public class WizardPageTitle extends Composite {
    @UiField
    protected Image           imgCompleted;
    @UiField
    protected Label           lblTitle;
    @UiField
    protected HorizontalPanel container;
    interface WizardPageTitleViewBinder
        extends
        UiBinder<WidgetWizardPageTitle> {
    }
    private static WizardPageTitleViewBinder uiBinder = GWT.createWizardPageTitleViewBinder.class );
    public WizardPageTitle(final WizardContext context,
                           final EventBus eventBus,
                           final WizardPage page) {
        initWidget.createAndBindUithis ) );
        this..setTextpage.getTitle() );
        setCompletepage.isComplete() );
        .addDomHandlernew ClickHandler() {
                                     public void onClick(ClickEvent event) {
                                         WizardPageSelectedEvent wpse = new WizardPageSelectedEventpage );
                                         eventBus.fireEventFromSourcewpse,
                                                                       context );
                                     }
                                 },
                                 ClickEvent.getType() );
    }

    
Is the page complete

Parameters:
isComplete
    public void setComplete(boolean isComplete) {
        .setVisibleisComplete );
    }

    
Is the page the currently displayed page. Note WizardPageTitles are unaware of other WizardPageTitles and hence a mediator class needs to control the setting of the "current page" and de-selecting other previous "current pages".

Parameters:
isSelected
    public void setPageSelected(boolean isSelected) {
        .getElement().getStyle().setFontWeightisSelected ? . : . );
    }
New to GrepCode? Check out our FAQ X