Java SWT文本组件水平对齐

Java SWT文本组件水平对齐,java,swt,Java,Swt,我需要目录的文本区域和组右侧的继续按钮,但我无法获得它…这方面的任何帮助对我来说都是非常好的。。。。 我在右端(即browserbutton)仍然有一些空间…我需要去掉这个空间,不知道我哪里出错了 代码: Label label = new Label(DGroup, SWT.NONE); final GridData gd_Label = new GridData(); gd_L

我需要目录的文本区域和组右侧的继续按钮,但我无法获得它…这方面的任何帮助对我来说都是非常好的。。。。 我在右端(即browserbutton)仍然有一些空间…我需要去掉这个空间,不知道我哪里出错了

代码:

                                          Label label = new Label(DGroup, SWT.NONE);
    final GridData gd_Label = new GridData();
            gd_Label.horizontalIndent = 20;
            label .setLayoutData(gd_Label);
            label.setText("Directory:");
            label.setToolTipText("The directory to write files to");

            directoryText = new StyledText(DGroup, SWT.BORDER );

            directoryText.addSelectionListener(new SelectionAdapter()
            {
                @Override
                public void widgetSelected(final SelectionEvent e)
                {
                    enableDisableControls();
                }
            });



    GridData gd_DirectoryText = new GridData();
    gd_DirectoryText.horizontalAlignment = SWT.FILL;
    gd_DirectoryText.grabExcessHorizontalSpace = true;
    gd_DirectoryText.horizontalSpan = 1;
    directoryText.setLayoutData(gd_DirectoryText);

    directoryText .setLayoutData(gd_DirectoryText );



            final Button browseDirectoryButton = new Button(DGroup, SWT.NONE);
            browseDirectoryButton.setToolTipText("Select the directory the connector will write files to.");
                                               final GridData gd_browseDirectoryButton = new GridData();
            browseDirectoryButton.setLayoutData(gd_browseDirectoryButton );
            browseDirectoryButton.setText("...");
整个街区:

protected void setControls(Composite parent)
{
    OptionGroup = new Group(this, SWT.None);
    OptionGroup.setLayout(new GridLayout(1,false));
    GridData gridData=new GridData(GridData.FILL_HORIZONTAL);
    gridData.heightHint=400;
    OptionGroup.setLayoutData(gridData);

    ScrolledComposite scrolledPane=new ScrolledComposite(OptionGroup,SWT.V_SCROLL);
    scrolledPane.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite projectPane=new Composite(scrolledPane,SWT.NONE);
    projectPane.setLayout(new GridLayout(2,false)); 

    DGroup = new Group(projectPane, SWT.None);
    DGroup.setLayout(new GridLayout(3,true));
    GridData gData=new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
    DGroup.setLayoutData(gData);




    Label label = new Label(DGroup, SWT.NONE);
    final GridData gd_Label = new GridData();
            gd_Label.horizontalIndent = 20;
            label .setLayoutData(gd_Label);
            label.setText("Directory:");
            label.setToolTipText("The directory to write files to");

            directoryText = new StyledText(DGroup, SWT.BORDER );

            directoryText.addModifyListener(modifyListener);

            try
            {
                directoryNameProposal = new ParameterProposals(directoryText);
            }
            catch (Exception e1)
            {

            }

            directoryText.addSelectionListener(new SelectionAdapter()
            {
                @Override
                public void widgetSelected(final SelectionEvent e)
                {
                    enableDisableControls();
                }
            });


    GridData gd_DirectoryText = new GridData();
    gd_DirectoryText.horizontalAlignment = SWT.FILL;
    gd_DirectoryText.grabExcessHorizontalSpace = true;
    gd_DirectoryText.horizontalSpan = 1;
    directoryText.setLayoutData(gd_DirectoryText);

    directoryText .setLayoutData(gd_DirectoryText );



            final Button browseDirectoryButton = new Button(DGroup, SWT.NONE);
            browseDirectoryButton.setToolTipText("Select the directory the connector will write files to.");
                                               final GridData gd_browseDirectoryButton = new GridData();
            browseDirectoryButton.setLayoutData(gd_browseDirectoryButton );
            browseDirectoryButton.setText("...");

            browseDirectoryButton.addSelectionListener(new SelectionAdapter()
            {
                @Override
                public void widgetSelected(final SelectionEvent e)
                {
                    String dir = doBrowse(browseDirectoryButton.getToolTipText(), "Select Directory");
                    if (dir != null)
                    {
                        directoryText.setText(dir);
                    }
                }
            });


    createDirectory = new Button(projectPane, SWT.CHECK);
    createDirectory.setToolTipText("Indicates whether directoty will be created if it does not exist.");
    createDirectory.setText("Create Directory");
    createDirectory.setSelection(false);
    createDirectory.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
        }
    });



    label = new Label(projectPane, SWT.NULL);
    label.setText("File Name:");
    label.setToolTipText("The name of the file to write to");

    fileNameText = new StyledText(projectPane, SWT.BORDER | SWT.SINGLE);
    fileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    fileNameText.addModifyListener(modifyListener);

    try
    {
        fileNameProposal = new ParameterProposals(fileNameText);
    }
    catch (Exception e1)
    {

    }

    new Label(this, SWT.NONE);

    label = new Label(projectPane, SWT.NULL);
    label.setText("Username:");

    fileUsername = new StyledText(projectPane, SWT.BORDER | SWT.SINGLE);
    fileUsername.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    fileUsername.addModifyListener(modifyListener);
    fileUsername.setToolTipText("The username to access the file.");    

    new Label(this, SWT.NONE);

    label = new Label(projectPane, SWT.NULL);
    label.setText("Encoding:");

    encodingCombo = new CharsetCombo(projectPane, SWT.READ_ONLY);
    encodingCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    encodingCombo.addModifyListener(modifyListener);
    encodingCombo.setToolTipText("The character set used to encode data.");
    new Label(this, SWT.NONE);

    appendButton = new Button(projectPane, SWT.CHECK);
    appendButton.setToolTipText("Indicates whether data is to be appended to the file.  If the file exists, and Append is false, the file is overwritten.  If the file exists and Append is true, the data is appended to the file.  Otherwise, a new file is created.");
    appendButton.setText("Append to file");
    appendButton.setSelection(false);
    appendButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {

            if (appendButton.getSelection() && useTempFileButton.getSelection())
            {
                useTempFileButton.setSelection(false);
            }
            enableDisableControls();
        }
    });
    new Label(this, SWT.NONE);
    new Label(this, SWT.NONE);



    fileOptionGroup = new Group(projectPane, SWT.NONE);
    fileOptionGroup.setText("If the file exists");
    fileOptionGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

    fileOptionGroup.setLayout(new GridLayout());

    final GridLayout gl_fileOptionGroup = new GridLayout();
    gl_fileOptionGroup.numColumns = 3;
    fileOptionGroup.setLayout(gl_fileOptionGroup);

    btnOverwrite = new Button(fileOptionGroup, SWT.RADIO);
    btnOverwrite.setLayoutData(new GridData());
    btnOverwrite.setToolTipText("Overwirte to an existing file");
    btnOverwrite.setText("Overwrite");
    btnOverwrite.setSelection(true);

    btnSkip = new Button(fileOptionGroup, SWT.RADIO);
    btnSkip.setLayoutData(new GridData());
    btnSkip.setToolTipText("Skip to save the file");
    btnSkip.setText("Skip");
    btnSkip.setSelection(false);

    btnRetry = new Button(fileOptionGroup, SWT.RADIO);
    btnRetry.setLayoutData(new GridData());
    btnRetry.setToolTipText("Retry to get the file");
    btnRetry.setText("Retry");
    btnRetry.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
        }
    });

    retryOptionGroup = new Group(projectPane, SWT.NONE);
    retryOptionGroup.setText("Retry options");
    final GridData gd_retryOptionGroup = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    retryOptionGroup.setLayoutData(gd_retryOptionGroup);
    retryOptionGroup.setLayout(new GridLayout());
    final GridLayout gl_retryOptionGroup = new GridLayout();
    gl_retryOptionGroup.numColumns = 2;
    retryOptionGroup.setLayout(gl_retryOptionGroup);

    sendRetriesLabel = new Label(retryOptionGroup, SWT.NULL);
    final GridData gd_sendRetriesLabel = new GridData();
    gd_sendRetriesLabel.horizontalIndent = 20;
    gd_sendRetriesLabel.horizontalAlignment = SWT.FILL;
    sendRetriesLabel.setLayoutData(gd_sendRetriesLabel);
    sendRetriesLabel.setText("Send Attempts:");

    sendRetriesSpin = new Spinner(retryOptionGroup, SWT.BORDER | SWT.SINGLE);
    sendRetriesSpin.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    sendRetriesSpin.setToolTipText("The number of times to attempt to send a message to the external resource before failing with an error.");

    sendRetriesSpin.setValues(5, 1, Spinner.LIMIT, 0, 1, 10);

    retryIntervalLabel = new Label(retryOptionGroup, SWT.NULL);
    retryIntervalLabel.setText("Interval between Attempts (ms):");
    final GridData gd_retryIntervalText = new GridData();
    gd_retryIntervalText.horizontalIndent = 20;
    gd_retryIntervalText.horizontalAlignment = SWT.FILL;
    retryIntervalLabel.setLayoutData(gd_retryIntervalText);

    sendRetryIntervalText = new StyledText(retryOptionGroup, SWT.BORDER | SWT.SINGLE);
    sendRetryIntervalText.setToolTipText("The time interval in milliseconds the connector waits between message send attempts.");
    sendRetryIntervalText.setText("10000");
    sendRetryIntervalText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    new Label(this, SWT.NONE);


    useTempFileButton = new Button(projectPane, SWT.CHECK);
    useTempFileButton.setToolTipText("Indicates if the data is to be gathered in a temporary file first and renamed when writing is complete.");
    useTempFileButton.setText("Use temporary file");
    useTempFileButton.setSelection(false);
    useTempFileButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
        }
    });
    new Label(this, SWT.NONE);

    useTemporaryFileGroup = new Group(projectPane, SWT.NONE);
    final GridData gd_useTemporaryFileGroup = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
    useTemporaryFileGroup.setLayoutData(gd_useTemporaryFileGroup);
    useTemporaryFileGroup.setLayout(new GridLayout());
    final GridLayout gl_useTemporaryFileGroup = new GridLayout();
    gl_useTemporaryFileGroup.numColumns = 2;
    useTemporaryFileGroup.setLayout(gl_useTemporaryFileGroup);

    tempFilePrefixLabel = new Label(useTemporaryFileGroup, SWT.NULL);
    final GridData gd_tempFilePrefixLabel = new GridData();
    gd_tempFilePrefixLabel.horizontalIndent = 20;
    gd_tempFilePrefixLabel.horizontalAlignment = SWT.FILL;
    tempFilePrefixLabel.setLayoutData(gd_tempFilePrefixLabel);
    tempFilePrefixLabel.setText("Temp file prefix:");

    tempFilePrefixText = new StyledText(useTemporaryFileGroup, SWT.BORDER | SWT.SINGLE);
    tempFilePrefixText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    tempFilePrefixText.addModifyListener(modifyListener);
    tempFilePrefixText.setToolTipText("The prefix string to be used in generating the temp file's name; must be at least three characters long");
    tempFilePrefixText.setText(IFileConnectorProfileConstants.DEFAULT_TEMPFILE_PREFIX);
    try
    {
        tempFilePrefixProposal = new ParameterProposals(tempFilePrefixText);
    }
    catch (Exception e1)
    {

    }
    tempFileSuffixLabel = new Label(useTemporaryFileGroup, SWT.NULL);
    tempFileSuffixLabel.setText("Temp file suffix:");
    final GridData gd_tempFileSuffixLabel = new GridData();
    gd_tempFileSuffixLabel.horizontalIndent = 20;
    gd_tempFileSuffixLabel.horizontalAlignment = SWT.FILL;
    tempFileSuffixLabel.setLayoutData(gd_tempFileSuffixLabel);

    tempFileSuffixText = new StyledText(useTemporaryFileGroup, SWT.BORDER | SWT.SINGLE);
    tempFileSuffixText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    tempFileSuffixText.addModifyListener(modifyListener);
    tempFileSuffixText.setToolTipText("The suffix string to be used in generating the temp file's name");
    tempFileSuffixText.setText(IFileConnectorProfileConstants.DEFAULT_TEMPFILE_SUFFIX);
    try
    {
        tempFileSuffixProposal = new ParameterProposals(tempFileSuffixText);
    }
    catch (Exception e1)
    {

    }
    new Label(this, SWT.NONE);
    fileContentsLabel = new Label(projectPane, SWT.NULL);
    fileContentsLabel.setText("Replace an empty message with:");
    fileContentsLabel.setLayoutData(new GridData());
    fileContentsText = new StyledText(projectPane, SWT.BORDER | SWT.SINGLE);
    fileContentsText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    fileContentsText.setToolTipText("The default contents to be used when receiving contents is null");

    final Group archiveModeGroup = new Group(projectPane, SWT.NONE);
    archiveModeGroup.setText("Archive Selection");
    final GridData gd_archiveModeGroup = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
    gd_archiveModeGroup.heightHint = 141;
    archiveModeGroup.setLayoutData(gd_archiveModeGroup);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    archiveModeGroup.setLayout(gridLayout);
    noneButton = new Button(archiveModeGroup, SWT.RADIO);
    noneButton.setSelection(true);
    noneButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
        }
    });
    noneButton.setToolTipText("Only use this mode to test the configuration.  This is not suitable for production operation.");
    final GridData gd_noneButton = new GridData();
    gd_noneButton.horizontalIndent = 10;
    noneButton.setLayoutData(gd_noneButton);
    noneButton.setText("None");
    new Label(archiveModeGroup, SWT.NONE);
    new Label(archiveModeGroup, SWT.NONE);

    deleteButton = new Button(archiveModeGroup, SWT.RADIO);
    deleteButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
        }
    });
    deleteButton.setToolTipText("Delete a file after it is processed.");
    final GridData gd_deleteButton = new GridData();
    gd_deleteButton.horizontalIndent = 10;
    deleteButton.setLayoutData(gd_deleteButton);
    deleteButton.setText("Delete");
    new Label(archiveModeGroup, SWT.NONE);
    new Label(archiveModeGroup, SWT.NONE);

    backupButton = new Button(archiveModeGroup, SWT.RADIO);
    backupButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            enableDisableControls();
            handleValidationListeners(null);
        }
    });

    backupButton.setToolTipText("Move a file to the Archive directory after it is processed.");
    final GridData gd_backupButton = new GridData();
    gd_backupButton.horizontalIndent = 10;
    backupButton.setLayoutData(gd_backupButton);
    backupButton.setText("Backup");
    new Label(archiveModeGroup, SWT.NONE);
    new Label(archiveModeGroup, SWT.NONE);

    archiveDirectoryLabel = new Label(archiveModeGroup, SWT.NONE);
    final GridData gd_archiveDirectoryLabel = new GridData();
    gd_archiveDirectoryLabel.horizontalIndent = 20;
    archiveDirectoryLabel.setLayoutData(gd_archiveDirectoryLabel);
    archiveDirectoryLabel.setText("Archive Directory:");

    archiveDirectoryText = new StyledText(archiveModeGroup, SWT.BORDER);
    archiveDirectoryText.addModifyListener(modifyListener);
    try
    {
        archiveDirectoryProposal = new ParameterProposals(archiveDirectoryText);
    }
    catch (Exception e1)
    {

    }
    archiveDirectoryText.setToolTipText("The directory to move files to after they are processed.");
    final GridData gd_archiveDirectoryText = new GridData(SWT.FILL, SWT.CENTER, true, false);
    archiveDirectoryText.setLayoutData(gd_archiveDirectoryText);
    browseArchiveDirectoryButton = new Button(archiveModeGroup, SWT.NONE);
    browseArchiveDirectoryButton.setToolTipText("Select the directory the listener will move files to after they are processed.");
    final GridData gd_browseArchiveDirectoryButton = new GridData();
    browseArchiveDirectoryButton.setLayoutData(gd_browseArchiveDirectoryButton);
    browseArchiveDirectoryButton.setText("...");        

    new Label(this, SWT.NONE);
    browseArchiveDirectoryButton.addSelectionListener(new SelectionAdapter()
    {
        @Override
        public void widgetSelected(final SelectionEvent e)
        {
            String dir = doBrowse(browseArchiveDirectoryButton.getToolTipText(), "Select Archive Directory");
                if (dir != null)
                {
                    archiveDirectoryText.setText(dir);
                }

        }
    });

    archiveFileNameLabel = new Label(archiveModeGroup, SWT.NULL);
    archiveFileNameLabel.setText("Archieve FileName:");
    archiveFileNameLabel.setToolTipText("The name of the file to write to");

    archivefileNameText = new StyledText(archiveModeGroup, SWT.BORDER | SWT.SINGLE);
    archivefileNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    archivefileNameText.addModifyListener(modifyListener);

    try
    {
        archivefileNameProposal = new ParameterProposals(archivefileNameText);
    }
    catch (Exception e1)
    {

    }

    enableDisableControls();

    new Label(this, SWT.NONE);
    recordDelimiterLabel = new Label(projectPane, SWT.NONE);
    recordDelimiterLabel.setText("Record Delimiter:");
    recordDelimiterLabel.setLayoutData(new GridData());

    recordDelimiterText = new Text(projectPane, SWT.BORDER | SWT.SINGLE);
    // recordDelimiterText.setText("<CR><LF>");
    recordDelimiterText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    recordDelimiterText.setToolTipText("Put delimiter if needed, <CR><LF> for carriage return.");
    new Label(this, SWT.NONE);

    recordLengthLabel = new Label(projectPane, SWT.NONE);
    recordLengthLabel.setText("Record Length:");
    recordLengthLabel.setLayoutData(new GridData());

    recordLengthSpinner = new Spinner(projectPane, SWT.BORDER);
    recordLengthSpinner.setMaximum(Integer.MAX_VALUE);
    recordLengthSpinner.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    recordLengthSpinner.setToolTipText("Delimited by a specified length");
    new Label(this, SWT.NONE);
    scrolledPane.setContent(projectPane);
    scrolledPane.setExpandVertical(true);
    scrolledPane.setExpandHorizontal(true);
    scrolledPane.setMinSize(projectPane.computeSize(SWT.DEFAULT,SWT.DEFAULT));
    enableDisableControls();
}
受保护的void setControls(复合父级)
{
OptionGroup=新组(此为SWT.None);
OptionGroup.setLayout(新的GridLayout(1,false));
GridData GridData=新的GridData(GridData.FILL\u HORIZONTAL);
gridData.heightHint=400;
OptionGroup.setLayoutData(网格数据);
ScrolledComposite scrolledPane=新的ScrolledComposite(OptionGroup,SWT.V_SCROLL);
setLayoutData(新的GridData(GridData.FILL_BOTH));
组合项目窗格=新组合(滚动窗格,SWT.NONE);
setLayout(新的GridLayout(2,false));
DGroup=新组(projectPane,SWT.None);
setLayout(新的GridLayout(3,true));
GridData gData=新的GridData(SWT.FILL,SWT.FILL,true,false,2,1);
DGroup.setLayoutData(gData);
标签=新标签(DGroup,SWT.NONE);
最终GridData gd_标签=新GridData();
gd_Label.horizontalIndent=20;
label.setLayoutData(gd_标签);
label.setText(“目录:”);
label.setToolTipText(“要将文件写入的目录”);
directoryText=新样式文本(DGroup,SWT.BORDER);
addModifyListener(modifyListener);
尝试
{
directoryNameProposal=新参数解释建议(directoryText);
}
捕获(异常e1)
{
}
directoryText.addSelectionListener(新的SelectionAdapter()
{
@凌驾
公共无效WidgeSelected(最终选择事件e)
{
启用禁用控件();
}
});
GridData gd_DirectoryText=新GridData();
gd_DirectoryText.horizontalAlignment=SWT.FILL;
gd_DirectoryText.grabeExcessHorizontalSpace=true;
gd_DirectoryText.horizontalSpan=1;
setLayoutData(gd_directoryText);
setLayoutData(gd_directoryText);
final Button browseDirectoryButton=新按钮(DGroup,SWT.NONE);
setToolTipText(“选择连接器将向其写入文件的目录”);
final GridData gd_browseDirectoryButton=new GridData();
setLayoutData(gd_browseDirectoryButton);
browseDirectoryButton.setText(“…”);
browseDirectoryButton.addSelectionListener(新建SelectionAdapter())
{
@凌驾
公共无效WidgeSelected(最终选择事件e)
{
String dir=doBrowse(browseDirectoryButton.getToolTipText(),“选择目录”);
if(dir!=null)
{
directoryText.setText(dir);
}
}
});
createDirectory=new按钮(projectPane,SWT.CHECK);
setToolTipText(“指示如果directoty不存在,是否将创建它”);
setText(“创建目录”);
createDirectory.setSelection(false);
createDirectory.addSelectionListener(新的SelectionAdapter()
{
@凌驾
公共无效WidgeSelected(最终选择事件e)
{
启用禁用控件();
}
});
标签=新标签(projectPane,SWT.NULL);
label.setText(“文件名:”);
label.setToolTipText(“要写入的文件的名称”);
fileNameText=newstyledtext(projectPane,SWT.BORDER | SWT.SINGLE);
setLayoutData(新的GridData(SWT.FILL、SWT.CENTER、true、false));
fileNameText.addModifyListener(modifyListener);
尝试
{
fileNameProposal=新参数解释方案(fileNameText);
}
捕获(异常e1)
{
}
新标签(此,SWT.NONE);
标签=新标签(projectPane,SWT.NULL);
label.setText(“用户名:”);
fileUsername=newstyledtext(projectPane,SWT.BORDER | SWT.SINGLE);
setLayoutData(新的GridData(SWT.FILL、SWT.CENTER、true、false));
fileUsername.addModifyListener(modifyListener);
setToolTipText(“访问文件的用户名”);
新标签(此,SWT.NONE);
标签=新标签(projectPane,SWT.NULL);
label.setText(“编码:”);
encodingCombo=新的CharsetCombo(projectPane,SWT.READ_ONLY);
encodingCombo.setLayoutData(新的GridData(SWT.FILL,SWT.CENTER,true,false));
encodingCombo.addModifyListener(modifyListener);
setToolTipText(“用于编码数据的字符集”);
新标签(此,SWT.NONE);
appendButton=新按钮(项目窗格,SWT.CHECK);
appendButton.setToolTipText(“指示是否将数据追加到文件中。如果文件存在,且Append为false,则覆盖文件。如果文件存在且Append为true,则将数据追加到文件中。否则,将创建新文件。”);
setText(“追加到文件”);
appendButton.setSelection(false);
addSelectionListener(新的SelectionAdapter()
{
@凌驾
公共无效WidgeSelected(最终选择事件e)
{
if(appendButton.getSelection()&&useTempFileButton.getSelection())
{
useTempFileButton.setSelection(false);
}
启用禁用控件();
}
});
新标签(此,SWT.NONE);
新标签(此,SWT.NONE);
fileOptionGroup=新组(projectPane,SWT.NONE);
fileOptionGroup.setText(“如果文件存在”);
fileOptionGroup.setLayoutData(新的GridData(SWT.FILL,SWT.CENTER,true,false,2,1));
fileOptionGroup.setLayout(新网格