Search in sources :

Example 1 with Spinner

use of org.eclipse.swt.widgets.Spinner in project cubrid-manager by CUBRID.

the class QueryPropertyComposite method createContent.

/**
	 * create the content.
	 * 
	 */
private void createContent() {
    setLayout(new GridLayout());
    setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final Group autocommitGroup = new Group(this, SWT.NONE);
    final GridData gdAutocommitGroup = new GridData(SWT.FILL, SWT.CENTER, true, false);
    autocommitGroup.setLayoutData(gdAutocommitGroup);
    autocommitGroup.setLayout(new GridLayout());
    autocommitBtn = new Button(autocommitGroup, SWT.CHECK);
    final GridData gdAutocommitBtn = new GridData(SWT.FILL, SWT.CENTER, true, false);
    autocommitBtn.setLayoutData(gdAutocommitBtn);
    autocommitBtn.setText(Messages.autoCommitLabel);
    final Group groupFirst = new Group(this, SWT.NONE);
    groupFirst.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    groupFirst.setLayout(gridLayout);
    searchUnitBtn = new Button(groupFirst, SWT.CHECK);
    final GridData gdSearchUnitBtn = new GridData(SWT.LEFT, SWT.CENTER, true, false);
    searchUnitBtn.setLayoutData(gdSearchUnitBtn);
    searchUnitBtn.setText(Messages.searchUnitInstances);
    searchUnitBtn.addSelectionListener(new SelectionAdapter() {

        /**
			 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
			 * @param event an event containing information about the selection
			 */
        public void widgetSelected(SelectionEvent event) {
            unitCountSpinner.setEnabled(searchUnitBtn.getSelection());
        }
    });
    unitCountSpinner = new Spinner(groupFirst, SWT.BORDER);
    unitCountSpinner.setMaximum(2147483647);
    final GridData gdUnitCountSpinner = new GridData(SWT.RIGHT, SWT.CENTER, false, false);
    gdUnitCountSpinner.widthHint = 129;
    unitCountSpinner.setLayoutData(gdUnitCountSpinner);
    unitCountSpinner.setIncrement(100);
    final Label label = new Label(groupFirst, SWT.NONE);
    label.setText(Messages.pageUnitInstances);
    pageUnitCountSpinner = new Spinner(groupFirst, SWT.BORDER);
    pageUnitCountSpinner.setMaximum(2147483647);
    final GridData gdPageUnitSpinner = new GridData(SWT.RIGHT, SWT.CENTER, false, false);
    gdPageUnitSpinner.widthHint = 129;
    pageUnitCountSpinner.setLayoutData(gdPageUnitSpinner);
    pageUnitCountSpinner.setIncrement(10);
    final Label lobSizeLabel = new Label(groupFirst, SWT.NONE);
    lobSizeLabel.setText(Messages.lblLobLoadSize);
    loadSizeSpinner = new Spinner(groupFirst, SWT.BORDER);
    loadSizeSpinner.setMaximum(1024 * 1024);
    final GridData gdlobSizeSpinner = new GridData(SWT.RIGHT, SWT.CENTER, false, false);
    gdlobSizeSpinner.widthHint = 129;
    loadSizeSpinner.setLayoutData(gdPageUnitSpinner);
    loadSizeSpinner.setIncrement(8);
    multiPageConfirmBtn = new Button(groupFirst, SWT.CHECK);
    multiPageConfirmBtn.setText(Messages.showMultiPageConfirm);
    {
        final GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 2;
        multiPageConfirmBtn.setLayoutData(gd);
    }
    keywordLowerBtn = new Button(groupFirst, SWT.CHECK);
    keywordLowerBtn.setText(Messages.btnKeywordLowercase);
    final GridData gdKeywordBtn = new GridData(GridData.FILL_HORIZONTAL);
    gdKeywordBtn.horizontalSpan = 2;
    keywordLowerBtn.setLayoutData(gdKeywordBtn);
    autoNoUppercaseKeywordBtn = new Button(groupFirst, SWT.CHECK);
    autoNoUppercaseKeywordBtn.setText(Messages.btnNoAutoUppercase);
    final GridData gdAutoUppercaseKeywordBtn = new GridData(GridData.FILL_HORIZONTAL);
    gdAutoUppercaseKeywordBtn.horizontalSpan = 2;
    autoNoUppercaseKeywordBtn.setLayoutData(gdAutoUppercaseKeywordBtn);
    withoutPromptSaveBtn = new Button(groupFirst, SWT.CHECK);
    withoutPromptSaveBtn.setText(Messages.btnWithoutPromptSave);
    final GridData gdPromptSaveBtn = new GridData(GridData.FILL_HORIZONTAL);
    gdPromptSaveBtn.horizontalSpan = 2;
    withoutPromptSaveBtn.setLayoutData(gdPromptSaveBtn);
    useScientificNotationBtn = new Button(groupFirst, SWT.CHECK);
    useScientificNotationBtn.setText(Messages.btnUseScientificNotation);
    useScientificNotationBtn.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 2, 1, -1, -1));
    final Group changeFontGroup = new Group(this, SWT.NONE);
    changeFontGroup.setText(Messages.changeFont);
    final GridData gdChangeFontGroup = new GridData(SWT.FILL, SWT.FILL, true, true);
    changeFontGroup.setLayoutData(gdChangeFontGroup);
    changeFontGroup.setLayout(new GridLayout());
    final Group exampleGroup = new Group(changeFontGroup, SWT.NONE);
    exampleGroup.setText(Messages.fontExample);
    final GridData gdExmplaeGroup = new GridData(SWT.FILL, SWT.FILL, true, true);
    exampleGroup.setLayoutData(gdExmplaeGroup);
    exampleGroup.setLayout(new GridLayout());
    fontExampleTxt = new Text(exampleGroup, SWT.CENTER | SWT.BORDER);
    fontExampleTxt.setEditable(false);
    fontExampleTxt.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, -1, 30));
    fontExampleTxt.setText("CUBRID");
    Menu menu = new Menu(getShell(), SWT.POP_UP);
    fontExampleTxt.setMenu(menu);
    final Composite btnComposite = new Composite(changeFontGroup, SWT.NONE);
    btnComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
    final GridLayout gridLayoutBtnComposite = new GridLayout();
    gridLayoutBtnComposite.numColumns = 2;
    btnComposite.setLayout(gridLayoutBtnComposite);
    Button changeBtn = new Button(btnComposite, SWT.PUSH);
    final GridData gdChangeBtn = new GridData(SWT.RIGHT, SWT.CENTER, false, false);
    changeBtn.setLayoutData(gdChangeBtn);
    changeBtn.setText(Messages.change);
    changeBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            FontDialog dlg = new FontDialog(getShell());
            FontData fontdata = null;
            if (fontString == null || fontString.trim().length() == 0) {
                fontdata = new FontData();
                String[] fontStr = QueryOptions.getDefaultFont();
                fontdata.setName(fontStr[0]);
                fontdata.setHeight(Integer.parseInt(fontStr[1]));
                fontdata.setStyle(Integer.parseInt(fontStr[2]));
            } else {
                fontdata = new FontData(fontString);
            }
            FontData[] fontList = new FontData[1];
            fontList[0] = fontdata;
            dlg.setRGB(new RGB(fontColorRed, fontColorGreen, fontColorBlue));
            dlg.setFontList(fontList);
            fontdata = dlg.open();
            if (fontdata != null) {
                fontString = fontdata.toString();
                RGB rgb = dlg.getRGB();
                if (rgb != null) {
                    fontColorRed = rgb.red;
                    fontColorBlue = rgb.blue;
                    fontColorGreen = rgb.green;
                }
                changeExampleFont();
            }
        }
    });
    Button restoreBtn = new Button(btnComposite, SWT.PUSH);
    restoreBtn.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
    restoreBtn.setText(Messages.restoreDefault);
    restoreBtn.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            fontString = "";
            FontData[] fData = Display.getDefault().getSystemFont().getFontData();
            if (fData != null && fData.length > 0) {
                fontString = fData[0].toString();
            }
            fontColorRed = 0;
            fontColorGreen = 0;
            fontColorBlue = 0;
            changeExampleFont();
        }
    });
}
Also used : Group(org.eclipse.swt.widgets.Group) FontDialog(org.eclipse.swt.widgets.FontDialog) Composite(org.eclipse.swt.widgets.Composite) Spinner(org.eclipse.swt.widgets.Spinner) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) FontData(org.eclipse.swt.graphics.FontData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) RGB(org.eclipse.swt.graphics.RGB) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Menu(org.eclipse.swt.widgets.Menu)

Example 2 with Spinner

use of org.eclipse.swt.widgets.Spinner in project cubrid-manager by CUBRID.

the class BrokerLogTopMergeDialog method createDialogArea.

protected Control createDialogArea(Composite parent) {
    getShell().setText(Messages.brokerLogTopMergeDialogTitle);
    setTitle(Messages.brokerLogTopMergeDialogTitle);
    setMessage(Messages.brokerLogTopMergeDialogMessages);
    Composite comp = new Composite(parent, SWT.BORDER);
    comp.setLayoutData(new GridData(GridData.FILL_BOTH));
    comp.setLayout(new GridLayout(3, false));
    Label qLabel = new Label(comp, SWT.NONE);
    qLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    qLabel.setText(Messages.brokerLogTopMergeQLabel);
    qText = new Text(comp, SWT.BORDER | SWT.READ_ONLY);
    GridData text1Gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    text1Gd.grabExcessHorizontalSpace = true;
    qText.setLayoutData(text1Gd);
    Button qButton = new Button(comp, SWT.NONE);
    qButton.setText(Messages.brokerLogTopMergeOpenBtn);
    qButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            final FileDialog fileDialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.SINGLE);
            fileDialog.setFilterPath(qText.getText());
            fileDialog.setFilterExtensions(new String[] { "*.q" });
            fileDialog.setFilterNames(new String[] { "*.q" });
            final String fileTmp = fileDialog.open();
            if (fileTmp == null) {
                return;
            }
            qText.setText(fileTmp);
            validate();
        }
    });
    Label resLabel = new Label(comp, SWT.NONE);
    resLabel.setText(Messages.brokerLogTopMergeResLabel);
    resLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    resText = new Text(comp, SWT.BORDER | SWT.READ_ONLY);
    GridData resTextGd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    resTextGd.grabExcessHorizontalSpace = true;
    resText.setLayoutData(resTextGd);
    Button resButton = new Button(comp, SWT.NONE);
    resButton.setText(Messages.brokerLogTopMergeOpenBtn);
    resButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            final FileDialog fileDialog = new FileDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), SWT.SINGLE);
            fileDialog.setFilterPath(resText.getText());
            fileDialog.setFilterExtensions(new String[] { "*.res" });
            fileDialog.setFilterNames(new String[] { "*.res" });
            final String fileTmp = fileDialog.open();
            if (fileTmp == null) {
                return;
            }
            resText.setText(fileTmp);
            validate();
        }
    });
    Label exlPathLabel = new Label(comp, SWT.NONE);
    exlPathLabel.setText(Messages.brokerLogTopMergeExcelPathLabel);
    exlPathLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
    exlPathText = new Text(comp, SWT.BORDER | SWT.READ_ONLY);
    GridData exlTextGd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    exlTextGd.grabExcessHorizontalSpace = true;
    exlPathText.setLayoutData(exlTextGd);
    Button exlButton = new Button(comp, SWT.NONE);
    exlButton.setText(Messages.brokerLogTopMergeOpenBtn);
    exlButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(final SelectionEvent event) {
            DirectoryDialog dialog = new DirectoryDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell());
            dialog.setFilterPath(exlPathText.getText());
            String dir = dialog.open();
            if (dir != null) {
                if (!dir.endsWith(File.separator)) {
                    dir += File.separator;
                }
                exlPathText.setText(dir);
                excelFullPathText.setText(dir + exlNameText.getText() + ".xls");
            }
            validate();
        }
    });
    new Label(comp, SWT.NONE).setText(Messages.brokerLogTopMergeExcelNameLabel);
    exlNameText = new Text(comp, SWT.BORDER);
    exlNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    exlNameText.setText("log_top_merge");
    exlNameText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent event) {
            excelFullPathText.setText(exlPathText.getText() + exlNameText.getText() + ".xls");
            validate();
        }
    });
    new Label(comp, SWT.NONE);
    new Label(comp, SWT.NONE).setText(Messages.brokerLogTopMergeExcelFullNameLabel);
    excelFullPathText = new Text(comp, SWT.READ_ONLY | SWT.BORDER);
    excelFullPathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
    excelFullPathText.setText(exlPathText.getText() + exlNameText.getText() + ".xls");
    new Label(comp, SWT.NONE);
    new Label(comp, SWT.NONE).setText(com.cubrid.common.ui.cubrid.table.Messages.lblFileCharset);
    Composite paramComp = new Composite(comp, SWT.NONE);
    GridData paramCompGd = new GridData(GridData.FILL_HORIZONTAL);
    paramCompGd.horizontalSpan = 2;
    paramComp.setLayoutData(paramCompGd);
    paramComp.setLayout(new GridLayout(3, false));
    fileCharsetCombo = new Combo(paramComp, SWT.NONE);
    {
        GridData gridData = new GridData(GridData.BEGINNING);
        fileCharsetCombo.setLayoutData(gridData);
        fileCharsetCombo.setItems(QueryOptions.getAllCharset(null));
        fileCharsetCombo.select(0);
    }
    new Label(paramComp, SWT.NONE).setText(Messages.brokerLogTopMergePartionLineLabel);
    lineCountspinner = new Spinner(paramComp, SWT.BORDER | SWT.LEFT);
    lineCountspinner.setValues(3000, 1000, 10000, 0, 1000, 1000);
    lineCountspinner.setToolTipText(Messages.brokerLogTopMergePartionLineDescription);
    return parent;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) Spinner(org.eclipse.swt.widgets.Spinner) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileDialog(org.eclipse.swt.widgets.FileDialog) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 3 with Spinner

use of org.eclipse.swt.widgets.Spinner in project cubrid-manager by CUBRID.

the class RestoreDatabaseDialog method createDataTimeComp.

/**
	 * 
	 * Create restored date and time information composite
	 * 
	 * @param parent the parent composite
	 */
private void createDataTimeComp(Composite parent) {
    Composite dataTimeComp = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 9;
    layout.horizontalSpacing = 2;
    dataTimeComp.setLayout(layout);
    dataTimeComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    selectTimeButton = new Button(dataTimeComp, SWT.LEFT | SWT.CHECK);
    selectTimeButton.setText(Messages.btnSelectDateAndTime);
    selectTimeButton.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 9, 1, -1, -1));
    selectTimeButton.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent event) {
            if (selectTimeButton.getSelection()) {
                changeDateTimeBtnStatus(true);
            } else {
                changeDateTimeBtnStatus(false);
            }
        }
    });
    backupTimeButton = new Button(dataTimeComp, SWT.LEFT | SWT.RADIO);
    backupTimeButton.setText(Messages.btnBackupTime);
    backupTimeButton.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 9, 1, -1, -1));
    backupTimeButton.addSelectionListener(this);
    restoredDataTimeButton = new Button(dataTimeComp, SWT.LEFT | SWT.RADIO);
    restoredDataTimeButton.setText(Messages.btnRestoreDate);
    restoredDataTimeButton.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 9, 1, -1, -1));
    restoredDataTimeButton.addSelectionListener(this);
    Label dateLabel = new Label(dataTimeComp, SWT.LEFT);
    dateLabel.setText(Messages.lblDate);
    dateLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    yearSpn = new Spinner(dataTimeComp, SWT.BORDER);
    yearSpn.setMinimum(1);
    Calendar cal = Calendar.getInstance();
    yearSpn.setMaximum(cal.get(Calendar.YEAR));
    yearSpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    yearSpn.addSelectionListener(this);
    yearSpn.addModifyListener(this);
    monthSpn = new Spinner(dataTimeComp, SWT.BORDER);
    monthSpn.setMinimum(1);
    monthSpn.setMaximum(12);
    monthSpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    monthSpn.addSelectionListener(this);
    monthSpn.addModifyListener(this);
    daySpn = new Spinner(dataTimeComp, SWT.BORDER);
    daySpn.setMinimum(1);
    daySpn.setMaximum(31);
    daySpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    daySpn.addSelectionListener(this);
    daySpn.addModifyListener(this);
    Label timeLabel = new Label(dataTimeComp, SWT.LEFT);
    timeLabel.setText(Messages.lblTime);
    timeLabel.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    hourSpn = new Spinner(dataTimeComp, SWT.BORDER);
    hourSpn.setMinimum(0);
    hourSpn.setMaximum(23);
    hourSpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    hourSpn.addSelectionListener(this);
    hourSpn.addModifyListener(this);
    minuteSpn = new Spinner(dataTimeComp, SWT.BORDER);
    minuteSpn.setMinimum(0);
    minuteSpn.setMaximum(59);
    minuteSpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    minuteSpn.addSelectionListener(this);
    minuteSpn.addModifyListener(this);
    secondSpn = new Spinner(dataTimeComp, SWT.BORDER);
    secondSpn.setMinimum(0);
    secondSpn.setMaximum(59);
    secondSpn.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
    secondSpn.addSelectionListener(this);
    secondSpn.addModifyListener(this);
    Label label = new Label(dataTimeComp, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) Spinner(org.eclipse.swt.widgets.Spinner) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Calendar(java.util.Calendar) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Label(org.eclipse.swt.widgets.Label)

Example 4 with Spinner

use of org.eclipse.swt.widgets.Spinner in project cubrid-manager by CUBRID.

the class TimeSetDialog method createDataTimeGroup.

/**
	 *
	 * Create restored date and time information group
	 *
	 * @param parent Composite
	 */
private void createDataTimeGroup(Composite parent) {
    Group dataTimeGroupFrom = new Group(parent, SWT.NONE);
    dataTimeGroupFrom.setText("FROM:");
    GridLayout layoutFrom = new GridLayout();
    layoutFrom.numColumns = 9;
    layoutFrom.horizontalSpacing = 2;
    dataTimeGroupFrom.setLayout(layoutFrom);
    dataTimeGroupFrom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label dateLabelFrom = new Label(dataTimeGroupFrom, SWT.LEFT);
    dateLabelFrom.setText("Date:");
    dateLabelFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    yearSpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    yearSpnFrom.setMinimum(1);
    Calendar cal = Calendar.getInstance();
    yearSpnFrom.setMaximum(cal.get(Calendar.YEAR));
    yearSpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 60, -1));
    yearSpnFrom.addSelectionListener(this);
    yearSpnFrom.addModifyListener(this);
    monthSpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    monthSpnFrom.setMinimum(1);
    monthSpnFrom.setMaximum(12);
    monthSpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    monthSpnFrom.addSelectionListener(this);
    monthSpnFrom.addModifyListener(this);
    daySpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    daySpnFrom.setMaximum(31);
    daySpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    daySpnFrom.addSelectionListener(this);
    daySpnFrom.addModifyListener(this);
    Label timeLabel = new Label(dataTimeGroupFrom, SWT.LEFT);
    timeLabel.setText("Time:");
    timeLabel.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    hourSpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    hourSpnFrom.setMinimum(0);
    hourSpnFrom.setMaximum(23);
    hourSpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    hourSpnFrom.addSelectionListener(this);
    hourSpnFrom.addModifyListener(this);
    minuteSpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    minuteSpnFrom.setMinimum(0);
    minuteSpnFrom.setMaximum(59);
    minuteSpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    minuteSpnFrom.addSelectionListener(this);
    minuteSpnFrom.addModifyListener(this);
    secondSpnFrom = new Spinner(dataTimeGroupFrom, SWT.BORDER);
    secondSpnFrom.setMinimum(0);
    secondSpnFrom.setMaximum(59);
    secondSpnFrom.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    secondSpnFrom.addSelectionListener(this);
    secondSpnFrom.addModifyListener(this);
    Label label = new Label(dataTimeGroupFrom, SWT.NONE);
    label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Group dataTimeGroupTo = new Group(parent, SWT.NONE);
    dataTimeGroupTo.setText("TO:");
    GridLayout layoutTo = new GridLayout();
    layoutTo.numColumns = 9;
    layoutTo.horizontalSpacing = 2;
    dataTimeGroupTo.setLayout(layoutTo);
    dataTimeGroupTo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label dateLabelTo = new Label(dataTimeGroupTo, SWT.LEFT);
    dateLabelTo.setText("Date:");
    dateLabelTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    yearSpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    yearSpnTo.setMinimum(1);
    yearSpnTo.setMaximum(cal.get(Calendar.YEAR));
    yearSpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 60, -1));
    yearSpnTo.addSelectionListener(this);
    yearSpnTo.addModifyListener(this);
    monthSpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    monthSpnTo.setMinimum(1);
    monthSpnTo.setMaximum(12);
    monthSpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    monthSpnTo.addSelectionListener(this);
    monthSpnTo.addModifyListener(this);
    daySpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    daySpnTo.setMaximum(31);
    daySpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    daySpnTo.addSelectionListener(this);
    daySpnTo.addModifyListener(this);
    Label timeLabelTo = new Label(dataTimeGroupTo, SWT.LEFT);
    timeLabelTo.setText("Time:");
    timeLabelTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    hourSpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    hourSpnTo.setMinimum(0);
    hourSpnTo.setMaximum(23);
    hourSpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    hourSpnTo.addSelectionListener(this);
    hourSpnTo.addModifyListener(this);
    minuteSpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    minuteSpnTo.setMinimum(0);
    minuteSpnTo.setMaximum(59);
    minuteSpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    minuteSpnTo.addSelectionListener(this);
    minuteSpnTo.addModifyListener(this);
    secondSpnTo = new Spinner(dataTimeGroupTo, SWT.BORDER);
    secondSpnTo.setMinimum(0);
    secondSpnTo.setMaximum(59);
    secondSpnTo.setLayoutData(CommonUITool.createGridData(1, 1, 40, -1));
    secondSpnTo.addSelectionListener(this);
    secondSpnTo.addModifyListener(this);
    Label labelTo = new Label(dataTimeGroupTo, SWT.NONE);
    labelTo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Spinner(org.eclipse.swt.widgets.Spinner) Calendar(java.util.Calendar) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label)

Example 5 with Spinner

use of org.eclipse.swt.widgets.Spinner in project cubrid-manager by CUBRID.

the class CasRunnerConfigDialog method createGroup.

/**
	 * This method initializes group
	 *
	 */
private void createGroup() {
    GridData gridData17 = new GridData(GridData.FILL_HORIZONTAL);
    gridData17.horizontalSpan = 2;
    GridData gridData6 = new GridData(GridData.FILL_HORIZONTAL);
    gridData6.horizontalSpan = 2;
    GridData gridData13 = new GridData(GridData.FILL_HORIZONTAL);
    gridData13.horizontalSpan = 3;
    GridData gridData12 = new GridData(GridData.FILL_HORIZONTAL);
    gridData12.horizontalAlignment = GridData.FILL;
    GridData gridData11 = new GridData(GridData.FILL_HORIZONTAL);
    gridData11.horizontalAlignment = GridData.FILL;
    GridData gridData10 = new GridData(GridData.FILL_HORIZONTAL);
    gridData10.horizontalAlignment = GridData.FILL;
    gridData10.heightHint = 15;
    GridData gridData9 = new GridData(GridData.FILL_HORIZONTAL);
    gridData9.horizontalAlignment = GridData.FILL;
    gridData9.heightHint = 15;
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;
    group = new Group(composite, SWT.FILL);
    Label labelDBName = new Label(group, SWT.NONE);
    createComboDBName();
    group.setLayoutData(gridData13);
    group.setLayout(gridLayout);
    Label labelBrokerName = new Label(group, SWT.NONE);
    labelBrokerName.setText(Messages.labelBrokerName);
    createComboBrokerName();
    Label labelUserName = new Label(group, SWT.NONE);
    labelUserName.setText(Messages.labelUserId);
    textUserName = new Text(group, SWT.BORDER);
    textUserName.setLayoutData(gridData9);
    Label labelPassword = new Label(group, SWT.NONE);
    labelPassword.setText(Messages.labelPassword);
    textPassword = new Text(group, SWT.BORDER | SWT.PASSWORD);
    textPassword.setLayoutData(gridData10);
    Label labelNumThread = new Label(group, SWT.NONE);
    labelNumThread.setText(Messages.labelNumThread);
    spinnerNumThread = new Spinner(group, SWT.BORDER);
    spinnerNumThread.setMaximum(20);
    spinnerNumThread.setLayoutData(gridData11);
    spinnerNumThread.setMinimum(1);
    Label labelRepeatCount = new Label(group, SWT.NONE);
    labelRepeatCount.setText(Messages.labelNumRepeatCount);
    spinnerRepeatCount = new Spinner(group, SWT.BORDER);
    spinnerRepeatCount.setMaximum(1000);
    spinnerRepeatCount.setMinimum(1);
    spinnerRepeatCount.setLayoutData(gridData12);
    spinnerRepeatCount.setDigits(0);
    checkBoxShowQueryResult = new Button(group, SWT.CHECK);
    checkBoxShowQueryResult.setText(Messages.labelViewCasRunnerQueryResult);
    checkBoxShowQueryResult.setLayoutData(gridData6);
    checkBoxShowQueryResult.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {

        public void widgetSelected(org.eclipse.swt.events.SelectionEvent event) {
            checkBoxShowQueryPlan.setEnabled(checkBoxShowQueryResult.getSelection());
        }
    });
    checkBoxShowQueryPlan = new Button(group, SWT.CHECK);
    checkBoxShowQueryPlan.setEnabled(false);
    checkBoxShowQueryPlan.setLayoutData(gridData17);
    checkBoxShowQueryPlan.setText(Messages.labelViewCasRunnerQueryPlan);
    labelDBName.setText(Messages.labelDatabase);
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) Spinner(org.eclipse.swt.widgets.Spinner) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text)

Aggregations

Spinner (org.eclipse.swt.widgets.Spinner)163 Composite (org.eclipse.swt.widgets.Composite)110 GridData (org.eclipse.swt.layout.GridData)108 GridLayout (org.eclipse.swt.layout.GridLayout)106 Label (org.eclipse.swt.widgets.Label)106 Button (org.eclipse.swt.widgets.Button)88 SelectionEvent (org.eclipse.swt.events.SelectionEvent)59 Group (org.eclipse.swt.widgets.Group)59 Text (org.eclipse.swt.widgets.Text)46 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)40 ModifyListener (org.eclipse.swt.events.ModifyListener)34 ModifyEvent (org.eclipse.swt.events.ModifyEvent)31 SelectionListener (org.eclipse.swt.events.SelectionListener)31 Combo (org.eclipse.swt.widgets.Combo)28 SWT (org.eclipse.swt.SWT)19 Point (org.eclipse.swt.graphics.Point)12 FormLayout (org.eclipse.swt.layout.FormLayout)11 RowLayout (org.eclipse.swt.layout.RowLayout)11 LabeledText (org.netxms.ui.eclipse.widgets.LabeledText)11 FormAttachment (org.eclipse.swt.layout.FormAttachment)10