1

我想要一个对话框,我可以在其中显示类似 Eclipse 进度条的进度条。但我不想要信息图标。在那个地方我想放置一个小部件。所以我正在扩展进度条对话框类。但我的问题是如何删除图标。

包查看器演示;

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);
    }

}
4

1 回答 1

1

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

于 2013-05-09T06:25:47.717 回答