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
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * 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 {
    protected Image           imgCompleted;
    protected Label           lblTitle;
    protected HorizontalPanel container;
    interface WizardPageTitleViewBinder
        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 );
                                                                       context );
                                 ClickEvent.getType() );

Is the page complete

    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".

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