本文整理汇总了Java中org.insightech.er.preference.PreferenceInitializer类的典型用法代码示例。如果您正苦于以下问题:Java PreferenceInitializer类的具体用法?Java PreferenceInitializer怎么用?Java PreferenceInitializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreferenceInitializer类属于org.insightech.er.preference包,在下文中一共展示了PreferenceInitializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performOk
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
public boolean performOk() {
PreferenceInitializer.clearJDBCDriverInfo();
for (int i = 0; i < table.getItemCount(); i++) {
final TableItem tableItem = table.getItem(i);
final String db = tableItem.getText(0);
final String driverClassName = tableItem.getText(1);
final String path = tableItem.getText(2);
PreferenceInitializer.addJDBCDriver(db, driverClassName, path);
}
return super.performOk();
}
示例2: createContents
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected Control createContents(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
final GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
final Composite buttonComposite = CompositeFactory.createChildComposite(composite, 2, 2);
createButtonComposite(buttonComposite);
CompositeFactory.fillLine(composite, Resources.PREFERENCE_PAGE_MARGIN_TOP);
fileListEditor = new TemplateFileListEditor(PreferenceInitializer.TEMPLATE_FILE_LIST, ResourceString.getResourceString("label.custom.tempplate"), composite);
fileListEditor.load();
CompositeFactory.fillLine(composite);
CompositeFactory.createLabel(composite, "dialog.message.template.file.store", 2);
return composite;
}
示例3: createContents
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected Control createContents(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
final GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
CompositeFactory.fillLine(composite, Resources.PREFERENCE_PAGE_MARGIN_TOP);
fileListEditor = new TranslationFileListEditor(PreferenceInitializer.TRANSLATION_FILE_LIST, ResourceString.getResourceString("label.custom.dictionary.for.translation"), composite);
fileListEditor.load();
CompositeFactory.fillLine(composite);
CompositeFactory.createLabel(composite, "dialog.message.translation.file.store", 2);
CompositeFactory.createLabel(composite, "dialog.message.translation.file.encode", 2);
return composite;
}
示例4: setData
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected void setData() {
dbSettingList = PreferenceInitializer.getDBSettingList(database);
for (final DBSetting dbSetting : dbSettingList) {
final TableItem item = new TableItem(settingTable, SWT.NONE);
item.setText(0, dbSetting.getDbsystem());
item.setText(1, dbSetting.getServer());
if (dbSetting.getPort() != 0) {
item.setText(2, String.valueOf(dbSetting.getPort()));
}
item.setText(3, dbSetting.getDatabase());
item.setText(4, dbSetting.getUser());
item.setText(5, Format.null2blank(dbSetting.getUrl()));
}
setButtonEnabled(false);
}
示例5: buttonPressed
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void buttonPressed(final int buttonId) {
if (buttonId == IDialogConstants.STOP_ID) {
int index = settingTable.getSelectionIndex();
if (index != -1) {
settingTable.remove(index);
dbSettingList.remove(index);
PreferenceInitializer.saveSetting(dbSettingList);
if (index >= settingTable.getItemCount()) {
index = settingTable.getItemCount() - 1;
}
selectTable(index);
}
}
super.buttonPressed(buttonId);
}
示例6: getErrorMessage
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected String getErrorMessage() {
if (isBlank(dictionaryNameText)) {
return "error.translation.dictionary.name.empty";
}
final String fileName = dictionaryNameText.getText().trim();
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IStatus result = workspace.validateName(fileName, IResource.FILE);
if (!result.isOK()) {
return result.getMessage();
}
final File file = new File(PreferenceInitializer.getTranslationPath(fileName));
if (file.exists()) {
return "error.translation.dictionary.name.duplicated";
}
return null;
}
示例7: getClassLoader
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
public static ClassLoader getClassLoader() {
ClassLoader currentClassLoader = ERDiagramActivator.class
.getClassLoader();
String path = PreferenceInitializer.getExtendedClasspath();
if (!Check.isEmpty(path)) {
URL[] urls = new URL[1];
try {
urls[0] = new File(path + "/").toURI().toURL();
URLFirstClassLoader classLoader = new URLFirstClassLoader(urls,
currentClassLoader);
return classLoader;
} catch (MalformedURLException e) {
}
}
return currentClassLoader;
}
示例8: performOk
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
public boolean performOk() {
PreferenceInitializer.clearJDBCDriverInfo();
for (int i = 0; i < this.table.getItemCount(); i++) {
TableItem tableItem = this.table.getItem(i);
String db = tableItem.getText(0);
String driverClassName = tableItem.getText(1);
String path = tableItem.getText(2);
PreferenceInitializer.addJDBCDriver(db, driverClassName, path);
}
return super.performOk();
}
示例9: setData
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected void setData() {
this.dbSettingList = PreferenceInitializer
.getDBSettingList(this.database);
for (DBSetting dbSetting : this.dbSettingList) {
TableItem item = new TableItem(this.settingTable, SWT.NONE);
item.setText(0, dbSetting.getDbsystem());
item.setText(1, dbSetting.getServer());
if (dbSetting.getPort() != 0) {
item.setText(2, String.valueOf(dbSetting.getPort()));
}
item.setText(3, dbSetting.getDatabase());
item.setText(4, dbSetting.getUser());
item.setText(5, Format.null2blank(dbSetting.getUrl()));
}
this.setButtonEnabled(false);
}
示例10: buttonPressed
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.STOP_ID) {
int index = this.settingTable.getSelectionIndex();
if (index != -1) {
this.settingTable.remove(index);
this.dbSettingList.remove(index);
PreferenceInitializer.saveSetting(this.dbSettingList);
if (index >= this.settingTable.getItemCount()) {
index = this.settingTable.getItemCount() - 1;
}
this.selectTable(index);
}
}
super.buttonPressed(buttonId);
}
示例11: initTemplateCombo
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
private void initTemplateCombo() {
this.templateCombo.setVisibleItemCount(20);
this.templateCombo.add(ResourceString
.getResourceString("label.template.default.en"));
this.templateCombo.add(ResourceString
.getResourceString("label.template.default.ja"));
List<String> fileNames = PreferenceInitializer
.getAllExcelTemplateFiles();
for (String fileName : fileNames) {
File file = new File(
PreferenceInitializer.getTemplatePath(fileName));
if (file.exists()) {
this.templateCombo.add(fileName);
}
}
}
示例12: getErrorMessage
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
@Override
protected String getErrorMessage() {
if (isBlank(this.dictionaryNameText)) {
return "error.translation.dictionary.name.empty";
}
String fileName = this.dictionaryNameText.getText().trim();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IStatus result = workspace.validateName(fileName, IResource.FILE);
if (!result.isOK()) {
return result.getMessage();
}
File file = new File(PreferenceInitializer.getTranslationPath(fileName));
if (file.exists()) {
return "error.translation.dictionary.name.duplicated";
}
return null;
}
示例13: getSelectedTemplate
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的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);
}
示例14: initTemplateCombo
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的package包/类
private void initTemplateCombo() {
this.templateCombo.setVisibleItemCount(20);
this.templateCombo.add(ResourceString
.getResourceString("label.template.default.en"));
this.templateCombo.add(ResourceString
.getResourceString("label.template.default.ja"));
this.templateCombo.add(ResourceString
.getResourceString("label.template.default.ko"));
List<String> fileNames = PreferenceInitializer
.getAllExcelTemplateFiles();
for (String fileName : fileNames) {
File file = new File(
PreferenceInitializer.getTemplatePath(fileName));
if (file.exists()) {
this.templateCombo.add(fileName);
}
}
}
示例15: getSelectedTemplate
import org.insightech.er.preference.PreferenceInitializer; //导入依赖的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();
} else if ("ko".equals(lang)) {
return TemplatePreferencePage.getDefaultExcelTemplateKo();
}
String templateName = this.exportExcelSetting.getExcelTemplate();
File file = new File(
PreferenceInitializer.getTemplatePath(templateName));
return new FileInputStream(file);
}