org.jboss.tools.internal.deltacloud.ui.wizards.CustomWizardDialog.java Source code

Java tutorial

Introduction

Here is the source code for org.jboss.tools.internal.deltacloud.ui.wizards.CustomWizardDialog.java

Source

/*******************************************************************************
 * Copyright (c) 2010 Red Hat, Inc.
 * Distributed under license by Red Hat, Inc. All rights reserved.
 * This program is made available under the terms of the
 * Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat, Inc. - initial API and implementation
 ******************************************************************************/
package org.jboss.tools.internal.deltacloud.ui.wizards;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;

/**
 * @author Jeff Johnston
 */
public class CustomWizardDialog extends WizardDialog {

    private String finishText;

    public CustomWizardDialog(Shell parentShell, IWizard newWizard, String finishText) {
        super(parentShell, newWizard);
        this.finishText = finishText;
    }

    @Override
    protected void createButtonsForButtonBar(Composite parent) {
        super.createButtonsForButtonBar(parent);
        // All we want to do is override the text for the finish button
        Button finishButton = getButton(IDialogConstants.FINISH_ID);
        finishButton.setText(finishText);
    }

}