當前位置: 首頁>>代碼示例>>Java>>正文


Java PreferenceInitializer類代碼示例

本文整理匯總了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();
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:17,代碼來源:JDBCPreferencePage.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:22,代碼來源:TemplatePreferencePage.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:21,代碼來源:TranslationPreferencePage.java

示例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);
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:19,代碼來源:DBSettingListDialog.java

示例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);
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:25,代碼來源:DBSettingListDialog.java

示例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;
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:22,代碼來源:ExportToTranslationDictionaryDialog.java

示例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;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:24,代碼來源:ERDiagramActivator.java

示例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();
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:17,代碼來源:JDBCPreferencePage.java

示例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);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:20,代碼來源:DBSettingListDialog.java

示例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);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:25,代碼來源:DBSettingListDialog.java

示例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);
		}
	}
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:20,代碼來源:ExportToExcelDialog.java

示例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;
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:22,代碼來源:ExportToTranslationDictionaryDialog.java

示例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);
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:24,代碼來源:ExportToExcelManager.java

示例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);
		}
	}
}
 
開發者ID:justinkwony,項目名稱:ermaster-nhit,代碼行數:22,代碼來源:ExportToExcelDialog.java

示例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);
}
 
開發者ID:justinkwony,項目名稱:ermaster-nhit,代碼行數:27,代碼來源:ExportToExcelManager.java


注:本文中的org.insightech.er.preference.PreferenceInitializer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。