use of org.eclipse.swt.custom.StyledText in project cubrid-manager by CUBRID.
the class CheckQueryEditorTask method doSave.
public void doSave() {
ApplicationPersistUtil.getInstance().clearAllEditorStatus();
Display.getDefault().syncExec(new Runnable() {
public void run() {
Date createTime = new Date();
List<QueryEditorPart> editorPartList = QueryEditorUtil.getAllQueryEditorPart();
for (QueryEditorPart editor : editorPartList) {
ArrayList<RestorableQueryEditorInfo> sqlTabItemList = new ArrayList<RestorableQueryEditorInfo>();
for (CombinedQueryEditorComposite combinedQueryEditorComposite : editor.getAllCombinedQueryEditorComposite()) {
StyledText text = combinedQueryEditorComposite.getSqlEditorComp().getText();
if (text == null) {
LOGGER.warn("The editor.getSqlTextEditor() is a null.");
continue;
}
if (StringUtil.isEmpty(text.getText())) {
LOGGER.warn("The text.getText() is a null.");
continue;
}
CubridDatabase cubridDatabase = editor.getSelectedDatabase();
RestorableQueryEditorInfo editorStatus = new RestorableQueryEditorInfo();
if (cubridDatabase != null) {
DatabaseInfo dbInfo = cubridDatabase.getDatabaseInfo();
if (dbInfo != null) {
editorStatus.setDatabaseName(dbInfo.getDbName());
}
CubridServer cubridServer = cubridDatabase.getServer();
if (cubridServer != null) {
editorStatus.setServerName(cubridServer.getId());
}
}
editorStatus.setQueryContents(text.getText());
editorStatus.setCreatedTime(createTime);
sqlTabItemList.add(editorStatus);
}
ApplicationPersistUtil.getInstance().addEditorStatus(sqlTabItemList);
}
}
});
ApplicationPersistUtil.getInstance().save();
}
use of org.eclipse.swt.custom.StyledText in project cubrid-manager by CUBRID.
the class CubridBrokerConfEditAnnotationDialog method createDialogArea.
/**
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
* @param parent the parent composite to contain the dialog area
* @return the dialog area control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
{
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(1, true);
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
}
annotationText = new StyledText(composite, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
annotationText.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 2, 1, -1, 200));
annotationText.setText(annotation);
setTitle(Messages.cubridBrokerConfEditorTableMenuEditAnnotation);
setMessage(Messages.cubridBrokerConfEditorTableMenuEditAnnotation + parentString);
return parentComp;
}
use of org.eclipse.swt.custom.StyledText in project cubrid-manager by CUBRID.
the class DBSpaceLabelProvider method createServerInfoItem.
private void createServerInfoItem(ExpandBar bar, int index) {
/* Database server information */
ExpandItem dbServerInfoItem = new ExpandItem(bar, SWT.NONE, index);
dbServerInfoItem.setText(Messages.titleServerInfo);
Composite dbServerComposite = new Composite(bar, SWT.None);
dbServerComposite.setLayout(new FillLayout());
dbServerInfoText = new StyledText(dbServerComposite, SWT.MULTI);
dbServerInfoText.setEditable(false);
dbServerInfoItem.setControl(dbServerComposite);
dbServerInfoItem.setHeight(110);
dbServerInfoItem.setExpanded(true);
}
use of org.eclipse.swt.custom.StyledText in project cubrid-manager by CUBRID.
the class LoadDatabaseResultDialog method createDialogArea.
/**
* Create dialog area content
*
* @param parent the parent composite
* @return the control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
Label userNameLabel = new Label(composite, SWT.LEFT);
userNameLabel.setText(Messages.msgLoadDbResultDialog);
userNameLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
StyledText resultInfoText = new StyledText(composite, SWT.LEFT | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
CommonUITool.registerContextMenu(resultInfoText, false);
resultInfoText.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, 100, 300));
resultInfoText.setText(resultInfoStr);
resultInfoText.setEditable(false);
setTitle(Messages.titleLoadDbResultDialog);
setMessage(Messages.msgLoadDbResultDialog);
return parentComp;
}
use of org.eclipse.swt.custom.StyledText in project cubrid-manager by CUBRID.
the class ShowErrorTraceInfoDialog method createDialogArea.
/**
* Create dialog area content
*
* @param parent the parent composite
* @return the control
*/
protected Control createDialogArea(Composite parent) {
Composite parentComp = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(parentComp, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout();
layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
Label infoLabel = new Label(composite, SWT.LEFT);
infoLabel.setText(Messages.lblErrorTraceResultInfo);
infoLabel.setLayoutData(CommonUITool.createGridData(GridData.FILL_HORIZONTAL, 1, 1, -1, -1));
StyledText resultInfoText = new StyledText(composite, SWT.LEFT | SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
CommonUITool.registerContextMenu(resultInfoText, false);
resultInfoText.setLayoutData(CommonUITool.createGridData(GridData.FILL_BOTH, 1, 1, 100, 300));
resultInfoText.setText(resultInfoStr);
resultInfoText.setEditable(false);
setTitle(Messages.titleErrorTraceDialog);
if (resultInfoStr.trim().length() == 0) {
setErrorMessage(Messages.errCannotFindTraceLog);
} else {
setMessage(Messages.msgErrorTraceDialog);
}
return parentComp;
}
Aggregations