Search in sources :

Example 1 with PeriodGroup

use of com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup in project cubrid-manager by CUBRID.

the class EditQueryPlanDialog method createDialogArea.

/**
	 * Create the dialog area
	 *
	 * @param parent the parent composite
	 * @return the composite
	 */
protected Control createDialogArea(Composite parent) {
    Composite parentComp = (Composite) super.createDialogArea(parent);
    final Composite composite = new Composite(parentComp, SWT.RESIZE);
    final GridData gdComposite = new GridData(SWT.FILL, SWT.FILL, true, true);
    gdComposite.widthHint = 500;
    composite.setLayoutData(gdComposite);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    gridLayout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    gridLayout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    gridLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(gridLayout);
    final Group queryGroup = new Group(composite, SWT.NONE);
    final GridData gdQueryGroup = new GridData(SWT.FILL, SWT.CENTER, true, false);
    queryGroup.setLayoutData(gdQueryGroup);
    queryGroup.setLayout(new GridLayout());
    queryGroup.setText(Messages.msgQryBasicGroupName);
    createBasicGroup(queryGroup);
    periodGroup = new PeriodGroup(this, isEditable);
    periodGroup.addObserver(this);
    boolean isSupportPeriodic = CompatibleUtil.isSupportPeriodicAutoJob(database.getServer().getServerInfo());
    periodGroup.setSupportPeriodic(isSupportPeriodic);
    periodGroup.setMsgPeriodGroup(Messages.msgQryPeriodGroup);
    periodGroup.setMsgPeriodTimeLbl(Messages.msgQryPeriodTimeLbl);
    periodGroup.setTimeSplitByColon(true);
    if (operation == AddEditType.EDIT) {
        // Sets the edit title and message
        setMessage(Messages.editQryPlanMsg);
        setTitle(Messages.editQryPlanTitle);
        getShell().setText(Messages.editQryPlanTitle);
        periodGroup.setTypeValue((queryPlanInfo.getPeriod()));
        periodGroup.setDetailValue(queryPlanInfo.getDetail());
        if (isSupportPeriodic && queryPlanInfo.isPeriodic()) {
            periodGroup.setIntervalValue(queryPlanInfo.getInterval());
        } else {
            periodGroup.setTimeValue(queryPlanInfo.getTime());
        }
        isEnabledOkButton[0] = true;
        isEnabledOkButton[1] = true;
    } else {
        setMessage(Messages.addQryPlanMsg);
        setTitle(Messages.addQryPlanTitle);
        getShell().setText(Messages.addQryPlanTitle);
    }
    periodGroup.createPeriodGroup(composite);
    createStatementGroup(composite);
    if (operation == AddEditType.EDIT) {
        statementText.setFocus();
    }
    if (!isEditable) {
        statementText.setEditable(false);
        idText.setEditable(false);
        userText.setEditable(false);
        pwdTxt.setEditable(false);
    }
    return parentComp;
}
Also used : PeriodGroup(com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) PeriodGroup(com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Example 2 with PeriodGroup

use of com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup in project cubrid-manager by CUBRID.

the class EditBackupPlanDialog method createDialogArea.

/**
	 * Create the dialog area
	 *
	 * @param parent the parent composite
	 * @return the composite
	 */
protected Control createDialogArea(Composite parent) {
    this.isBkNumSupports = CompatibleUtil.isBackupNumSupports(database.getDatabaseInfo());
    Composite parentComp = (Composite) super.createDialogArea(parent);
    final Composite composite = new Composite(parentComp, SWT.RESIZE);
    final GridData gdComposite = new GridData(SWT.FILL, SWT.CENTER, true, false);
    composite.setLayoutData(gdComposite);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    gridLayout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    gridLayout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    gridLayout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(gridLayout);
    createBasicGroup(composite);
    periodGroup = new PeriodGroup(this, isEditAble);
    periodGroup.addObserver(this);
    final boolean isSupportPeriodic = CompatibleUtil.isSupportPeriodicAutoJob(database.getServer().getServerInfo());
    periodGroup.setSupportPeriodic(isSupportPeriodic);
    periodGroup.setTimeSplitByColon(false);
    if (operation == AddEditType.EDIT) {
        // Sets the edit title and message
        setMessage(Messages.editBackupPlanMsg);
        setTitle(Messages.editBackupPlanTitle);
        getShell().setText(Messages.editBackupPlanTitle);
        // Sets the initial value in periodGroup
        periodGroup.setTypeValue((backupPlanInfo.getPeriod_type()));
        periodGroup.setDetailValue(backupPlanInfo.getPeriod_date());
        String time = backupPlanInfo.getTime();
        if (!time.startsWith("i")) {
            periodGroup.setTimeValue(time);
        } else {
            int interval = Integer.parseInt(time.substring(1));
            periodGroup.setIntervalValue(interval);
        }
        isOkenable[0] = true;
    } else {
        setMessage(Messages.addBackupPlanMsg);
        setTitle(Messages.addBackupPlanTitle);
        getShell().setText(Messages.addBackupPlanTitle);
        isOkenable[0] = false;
    }
    periodGroup.createPeriodGroup(composite);
    createOptionsGroup(composite);
    if (!isEditAble) {
        leverCombo.setEnabled(false);
        idText.setEditable(false);
        pathText.setEditable(false);
        if (isBkNumSupports) {
            numKeepBackups.setEnabled(false);
        } else {
            storeButton.setEnabled(false);
        }
        deleteButton.setEnabled(false);
        updateButton.setEnabled(false);
        checkingButton.setEnabled(false);
        useCompressButton.setEnabled(false);
        numThreadspinner.setEnabled(false);
        onlineButton.setEnabled(false);
        offlineButton.setEnabled(false);
    }
    return parentComp;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) PeriodGroup(com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData)

Aggregations

PeriodGroup (com.cubrid.cubridmanager.ui.cubrid.jobauto.control.PeriodGroup)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Group (org.eclipse.swt.widgets.Group)1