本文整理汇总了Java中org.insightech.er.util.Check类的典型用法代码示例。如果您正苦于以下问题:Java Check类的具体用法?Java Check怎么用?Java Check使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Check类属于org.insightech.er.util包,在下文中一共展示了Check类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDDL
import org.insightech.er.util.Check; //导入依赖的package包/类
@Override
protected String getDDL(final Tablespace tablespace) {
final PostgresTablespaceProperties tablespaceProperties = (PostgresTablespaceProperties) tablespace.getProperties(environment, getDiagram());
final StringBuilder ddl = new StringBuilder();
ddl.append("CREATE TABLESPACE ");
ddl.append(filterName(tablespace.getName()));
ddl.append(LF());
if (!Check.isEmpty(tablespaceProperties.getOwner())) {
ddl.append(" OWNER ");
ddl.append(tablespaceProperties.getOwner());
ddl.append(LF());
}
ddl.append(" LOCATION '");
ddl.append(tablespaceProperties.getLocation());
ddl.append("'" + LF());
if (semicolon) {
ddl.append(";");
}
return ddl.toString();
}
示例2: getDDL
import org.insightech.er.util.Check; //导入依赖的package包/类
protected String getDDL(Trigger trigger) {
StringBuilder ddl = new StringBuilder();
String description = trigger.getDescription();
if (this.semicolon && !Check.isEmpty(description)
&& this.ddlTarget.inlineTableComment) {
ddl.append("-- ");
ddl.append(replaceLF(description, LF() + "-- "));
ddl.append(LF());
}
ddl.append(this.getCreateOrReplacePrefix() + " TRIGGER ");
ddl.append(filterName(this.getNameWithSchema(trigger.getSchema(),
trigger.getName())));
ddl.append(" ");
ddl.append(filterName(trigger.getSql()));
if (this.semicolon) {
ddl.append(";");
}
return ddl.toString();
}
示例3: validate
import org.insightech.er.util.Check; //导入依赖的package包/类
@Override
public List<String> validate() {
final List<String> errorMessage = new ArrayList<String>();
if (Check.isEmptyTrim(getDataFile())) {
errorMessage.add("error.tablespace.data.file.empty");
}
if (Check.isEmptyTrim(getLogFileGroup())) {
errorMessage.add("error.tablespace.log.file.group.empty");
}
if (Check.isEmptyTrim(getEngine())) {
errorMessage.add("error.tablespace.storage.engine.empty");
}
return errorMessage;
}
示例4: setData
import org.insightech.er.util.Check; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @throws IOException
*/
@Override
protected void setData() {
ExportImageSetting exportImageSetting = settings.getExportSetting()
.getExportImageSetting();
String outputFile = Format.null2blank(exportImageSetting
.getOutputFilePath());
if (Check.isEmpty(outputFile)) {
outputFile = this.getDefaultOutputFilePath(DEFAULT_EXTENTION);
}
this.outputFileText.setText(FileUtils.getRelativeFilePath(
this.getBaseDir(), outputFile));
this.withCategoryImageButton.setSelection(exportImageSetting
.isWithCategoryImage());
this.openAfterSavedButton.setSelection(exportImageSetting
.isOpenAfterSaved());
this.setCategoryData(this.categoryLabel);
if (this.diagram.getCurrentCategory() != null) {
this.withCategoryImageButton.setEnabled(false);
}
}
示例5: getUniqueKeyDDL
import org.insightech.er.util.Check; //导入依赖的package包/类
@Override
protected String getUniqueKeyDDL(final ERTable table) {
final StringBuilder ddl = new StringBuilder();
for (final NormalColumn column : table.getExpandedColumns()) {
if (column.isUniqueKey()) {
ddl.append("," + LF());
ddl.append("\t");
if (!Check.isEmpty(column.getUniqueKeyName())) {
ddl.append("CONSTRAINT ");
ddl.append(column.getUniqueKeyName());
ddl.append(" ");
}
ddl.append("UNIQUE (");
ddl.append(filterName(column.getPhysicalName()));
ddl.append(")");
}
}
ddl.append(super.getUniqueKeyDDL(table));
return ddl.toString();
}
示例6: filterComment
import org.insightech.er.util.Check; //导入依赖的package包/类
protected String filterComment(String logicalName, String description,
boolean column) {
String comment = null;
if (this.ddlTarget.commentValueLogicalNameDescription) {
comment = Format.null2blank(logicalName);
if (!Check.isEmpty(description)) {
comment = comment + " : " + Format.null2blank(description);
}
} else if (this.ddlTarget.commentValueLogicalName) {
comment = Format.null2blank(logicalName);
} else {
comment = Format.null2blank(description);
}
if (ddlTarget.commentReplaceLineFeed) {
comment = replaceLF(comment, ddlTarget.commentReplaceString);
}
return comment;
}
示例7: getRelativeFilePath
import org.insightech.er.util.Check; //导入依赖的package包/类
public static String getRelativeFilePath(final File baseDir, final String absoluteFilePath) {
if (Check.isEmpty(absoluteFilePath)) {
return "";
}
final File file = new File(absoluteFilePath);
if (isInBaseDir(baseDir, file)) {
if (file.getAbsolutePath().length() > baseDir.getAbsolutePath().length()) {
return file.getAbsolutePath().substring(baseDir.getAbsolutePath().length() + 1);
} else {
return "";
}
}
return absoluteFilePath;
}
示例8: perfomeOK
import org.insightech.er.util.Check; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void perfomeOK() {
modelProperties.clear();
for (int i = 0; i < table.getItemCount(); i++) {
final TableItem item = table.getItem(i);
if (Check.isEmpty(item.getText(0)) && Check.isEmpty(item.getText(1))) {
continue;
}
final NameValue property = new NameValue(item.getText(0), item.getText(1));
modelProperties.addProperty(property);
}
}
示例9: setData
import org.insightech.er.util.Check; //导入依赖的package包/类
private void setData() {
changeTrackingTable.removeAll();
setButtonEnabled(false);
comparisonDisplayButton.setEnabled(false);
for (final ChangeTracking changeTracking : diagram.getChangeTrackingList().getList()) {
final TableItem tableItem = new TableItem(changeTrackingTable, SWT.NONE);
final String date = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(changeTracking.getUpdatedDate());
tableItem.setText(0, date);
if (!Check.isEmpty(changeTracking.getComment())) {
tableItem.setText(1, changeTracking.getComment());
} else {
tableItem.setText(1, "*** empty log message ***");
}
}
comparisonResetButton.setEnabled(diagram.getChangeTrackingList().isCalculated());
}
示例10: enableUseDefaultDriver
import org.insightech.er.util.Check; //导入依赖的package包/类
private void enableUseDefaultDriver() {
final String database = getDBSName();
if (!Check.isEmpty(database)) {
final DBManager dbManager = DBManagerFactory.getDBManager(database);
if (StandardSQLDBManager.ID.equals(dbManager.getId())) {
useDefaultDriverButton.setSelection(false);
useDefaultDriverButton.setEnabled(false);
} else {
useDefaultDriverButton.setSelection(true);
useDefaultDriverButton.setEnabled(true);
}
}
}
示例11: getNameWithSchema
import org.insightech.er.util.Check; //导入依赖的package包/类
protected String getNameWithSchema(String schema, String name) {
StringBuilder sb = new StringBuilder();
if (Check.isEmpty(schema)) {
schema = this.getDiagram().getDiagramContents().getSettings()
.getTableViewProperties().getSchema();
}
if (!Check.isEmpty(schema)) {
sb.append(schema);
sb.append(".");
}
sb.append(name);
return sb.toString();
}
示例12: getTableNameWithSchema
import org.insightech.er.util.Check; //导入依赖的package包/类
public String getTableNameWithSchema(String tableName, String schema,
boolean toUpperCase) {
String name = null;
if (Check.isEmpty(schema)) {
name = Format.null2blank(tableName);
} else {
DBManager dbManager = DBManagerFactory.getDBManager(this.dbsystem);
if (!dbManager.isSupported(DBManager.SUPPORT_SCHEMA)) {
name = Format.null2blank(tableName);
} else {
name = schema + "." + Format.null2blank(tableName);
}
}
if (toUpperCase) {
name = name.toUpperCase();
}
return name;
}
示例13: getErrorMessage
import org.insightech.er.util.Check; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected String getErrorMessage() {
if (autoIncrementCheck != null && autoIncrementCheck.getSelection()) {
final SqlType selectedType = SqlType.valueOf(diagram.getDatabase(), typeCombo.getText());
if (selectedType == null || !selectedType.isNumber()) {
return "error.no.auto.increment.column";
}
}
final String text = uniqueKeyNameText.getText().trim();
if (!Check.isAlphabet(text)) {
return "error.unique.key.name.not.alphabet";
}
return super.getErrorMessage();
}
示例14: changeFont
import org.insightech.er.util.Check; //导入依赖的package包/类
protected Font changeFont(final IFigure figure) {
final NodeElement nodeElement = (NodeElement) getModel();
String fontName = nodeElement.getFontName();
int fontSize = nodeElement.getFontSize();
if (Check.isEmpty(fontName)) {
final FontData fontData = Display.getCurrent().getSystemFont().getFontData()[0];
fontName = fontData.getName();
nodeElement.setFontName(fontName);
}
if (fontSize <= 0) {
fontSize = ViewableModel.DEFAULT_FONT_SIZE;
nodeElement.setFontSize(fontSize);
}
font = Resources.getFont(fontName, fontSize);
figure.setFont(font);
return font;
}
示例15: getSelectedTemplate
import org.insightech.er.util.Check; //导入依赖的package包/类
private InputStream getSelectedTemplate() throws FileNotFoundException {
if (!Check.isEmpty(this.exportExcelSetting.getExcelTemplatePath())) {
return new FileInputStream(FileUtils.getFile(this.projectDir,
this.exportExcelSetting.getExcelTemplatePath()));
}
String lang = this.exportExcelSetting.getUsedDefaultTemplateLang();
if ("en".equals(lang)) {
return TemplatePreferencePage.getDefaultExcelTemplateEn();
} else if ("ja".equals(lang)) {
return TemplatePreferencePage.getDefaultExcelTemplateJa();
}
String templateName = this.exportExcelSetting.getExcelTemplate();
File file = new File(
PreferenceInitializer.getTemplatePath(templateName));
return new FileInputStream(file);
}