如何更改进度条对话框中的信息图标?

时间:2013-04-30 06:12:28

标签: java jface

我想要一个对话框,我可以在其中显示进度条,例如eclipse progressbar.But我不想要信息图标。在那个地方我想放置一个小部件。所以我正在扩展progressbardialogclass。但我的查询是如何删除图标。

package viewerdemo;

public class Imagesequencerdialog extends ProgressMonitorDialog {


/**
 * This  is a label for the warning image
 */
    private Label label;
    /**
     * This a reference of link class to provide the link to go to hex file
     */
    private Link link;

    /**
     * This is the warning message which will be displayed in dialog
     */
    private String warning_msg;
    /**This is the path to the hex files
     * 
     */
    private String linkpath;

    /**
     * This  is a constructor which initializes warning message of the dialog and path of the hexfile 
     * @param shell
     * @param warning_msg
     * @param linkpath
     */
    protected Imagesequencerdialog(Shell shell) {
        super(shell);



        // TODO Auto-generated constructor stub
    }


    /**
     * This  will create the dialog for the warning message
     * 
     * @param parent
     * @return Control
     */

    protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) {




        Composite container = (Composite) super.createDialogArea(parent);

        GridLayout gl_container = new GridLayout(2, false);
        gl_container.verticalSpacing = 0;
        gl_container.marginRight = 5;
        gl_container.marginLeft = 10;
        container.setLayout(gl_container);




ImageSequencer imageSequencer=new ImageSequencer(container, SWT.NONE, new Image[]{ 
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_1),
   SampleToolBoxImageRegistry.getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_2),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_3),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_4),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_5),
   SampleToolBoxImageRegistry.  getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_6),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_7),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_8), 
   SampleToolBoxImageRegistry.getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_9),
   SampleToolBoxImageRegistry.  getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_10),
   SampleToolBoxImageRegistry.  getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_11),
   SampleToolBoxImageRegistry. getImage(SampleToolBoxImageRegistry.IMG_INDICATOR_D_12),    
    },
    150,true);
imageSequencer.setLayoutData(new GridData(SWT.BEGINNING,SWT.BEGINNING,false,false));


Label label=new Label(container, SWT.NONE);
label.setText("Scanning..");




return parent;

    }
    /**
     * This  method creates the ok button in the dialog
     * @param parent
     */



    /**
     * This  method sets the title of the dialog
     * @param shell
     */
    protected void configureShell(Shell shell) {
        super.configureShell(shell);
        shell.setText("Initialization Status"); //$NON-NLS-1$
    }

    /** * Return the initial size of the dialog.
     *@return Point :size of the dialog 
     *  
     *
     */

    @Override
    protected Point getInitialSize() {
        return new Point(450, 140);
    }

}

1 个答案:

答案 0 :(得分:1)

您需要覆盖configureShell方法。然后你可以删除图像。