Skip to content

Commit

Permalink
- 文字列を外部化した。
Browse files Browse the repository at this point in the history
  • Loading branch information
MATSUFUJI Hideharu committed Feb 10, 2007
1 parent 0a6cfba commit 7778382
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 deletions.
Expand Up @@ -14,10 +14,10 @@
public interface IConfiguration {

/** キー:スキーマフォルダー. */
String KEY_SCHEMAFOLDER = "SchemaFolder";
String KEY_SCHEMAFOLDER = "SchemaFolder"; //$NON-NLS-1$

/** キー:スキーマファイル(接頭文字列). */
String KEY_PREFIX_SCHEMAFILE = "SchemaFile_";
String KEY_PREFIX_SCHEMAFILE = "SchemaFile_"; //$NON-NLS-1$

/**
* プロジェクトから設定を取得する.
Expand Down
Expand Up @@ -13,8 +13,8 @@
*/
public final class Messages {

private static final String BUNDLE_NAME = //$NON-NLS-1$
"com.piece_framework.yaml_editor.plugin.messages";
private static final String BUNDLE_NAME =
"com.piece_framework.yaml_editor.plugin.messages"; //$NON-NLS-1$

private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle(BUNDLE_NAME);
Expand Down
@@ -1,3 +1,13 @@
# $Id$
YAMLEditorPart.SchemaTitle=\u30b9\u30ad\u30fc\u30de
YAMLEditorPropertyPage.Title=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC\u9078\u629E
YAMLEditorPart.SelectSchemaMessage=\u30b9\u30ad\u30fc\u30de\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002
YAMLEditorPart.ChangeSchemaFolderButtonCaption=\u5909\u66F4(&C)
YAMLEditorPropertyPage.SelectSchemaFolderMessage=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044\u3002
YAMLEditorPropertyPage.SchemaFolderLabelCaption=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC(&S):
YAMLEditorPropertyPage.ReferenceButtonCaption=\u53C2\u7167(&W)...
YAMLEditorPart.SelectSchemaFolderMessage=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u9078\u629E\u3057\u3066\u4E0B\u3055\u3044\u3002
YAMLEditorPropertyPage.NoExistSchemaFolder=\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002
SchemaFolderSelectionDialog.Title=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC\u306E\u9078\u629E
SchemaFolderSelectionDialog.Message=\u30B9\u30AD\u30FC\u30DE\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044(&C):
SchemaFolderSelectionDialog.NewFolderButtonCaption=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u30FC\u306E\u4F5C\u6210(&N)...
Expand Up @@ -25,6 +25,8 @@
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceSorter;

import com.piece_framework.yaml_editor.plugin.Messages;

/**
* スキーマフォルダー選択ダイアログ.
* プロジェクト内のフォルダからスキーマフォルダーを選択する。<br>
Expand Down Expand Up @@ -56,8 +58,10 @@ public SchemaFolderSelectionDialog(Shell parent, final IProject project) {
new WorkbenchLabelProvider(),
new WorkbenchContentProvider());

setTitle("スキーマフォルダーの選択");
setMessage("スキーマフォルダーを選択してください(&C):");
setTitle(Messages.getString(
"SchemaFolderSelectionDialog.Title")); //$NON-NLS-1$
setMessage(Messages.getString(
"SchemaFolderSelectionDialog.Message")); //$NON-NLS-1$
setAllowMultiple(false);

// ルートから表示し、自プロジェクト以外を表示しないようにする
Expand Down Expand Up @@ -95,7 +99,8 @@ protected Control createDialogArea(Composite parent) {
getTreeViewer().addSelectionChangedListener(this);

fNewFolderButton = new Button(composite, SWT.PUSH);
fNewFolderButton.setText("新規フォルダーの作成(&N)...");
fNewFolderButton.setText(Messages.getString(
"SchemaFolderSelectionDialog.NewFolderButtonCaption")); //$NON-NLS-1$
fNewFolderButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
newFolderButtonPressed();
Expand Down
Expand Up @@ -76,7 +76,7 @@ public void dispose() {
while (e.hasNext()) {
((Color) e.next()).dispose();
}
System.out.println("YAMLColorManager#dispose()");
System.out.println("YAMLColorManager#dispose()"); //$NON-NLS-1$
}

}
Expand Up @@ -210,8 +210,8 @@ public void createPartControl(Composite parent) {
schemaLayout.spacing = SCHEMA_GROUP_SPACING;

Group schemaGroup = new Group(parentComposite, SWT.NONE);
schemaGroup.setText(
Messages.getString("YAMLEditorPart.SchemaTitle")); //$NON-NLS-1$
schemaGroup.setText(Messages.getString(
"YAMLEditorPart.SchemaTitle")); //$NON-NLS-1$
schemaGroup.setLayout(schemaLayout);

fSchemaCombo = new Combo(schemaGroup, SWT.READ_ONLY);
Expand All @@ -223,14 +223,13 @@ public void createPartControl(Composite parent) {
SCHEMA_LABEL_HEIGHT));

fSchemaFolderButton = new Button(schemaGroup, SWT.NONE);
fSchemaFolderButton.setText("変更(&C)");
fSchemaFolderButton.setText(Messages.getString(
"YAMLEditorPart.ChangeSchemaFolderButtonCaption")); //$NON-NLS-1$
fSchemaFolderButton.addSelectionListener(new SelectionAdapter() {

@Override
public void widgetSelected(SelectionEvent e) {

changeSchemaFolder();

super.widgetSelected(e);
}

Expand Down Expand Up @@ -469,7 +468,8 @@ private void setSchemaFolder() {
backRGB = SCHEMA_LABEL_NORM_COLOR;

} else {
text = "スキーマフォルダーを選択して下さい。";
text = Messages.getString(
"YAMLEditorPart.SelectSchemaFolderMessage"); //$NON-NLS-1$
backRGB = SCHEMA_LABEL_ERR_COLOR;

}
Expand Down Expand Up @@ -570,7 +570,8 @@ private void saveYAMLFile() {
String schemaFileName = getSelectionSchemaFileName();

if (schemaFileName != null) {
fEditor.setSchemaFileName(schemaFolderName + "/" + schemaFileName);
fEditor.setSchemaFileName(
schemaFolderName + "/" + schemaFileName); //$NON-NLS-1$
} else {
fEditor.setSchemaFileName(null);
}
Expand Down
Expand Up @@ -20,6 +20,7 @@

import com.piece_framework.yaml_editor.plugin.ConfigurationFactory;
import com.piece_framework.yaml_editor.plugin.IConfiguration;
import com.piece_framework.yaml_editor.plugin.Messages;
import com.piece_framework.yaml_editor.plugin.YAMLEditorPlugin;
import com.piece_framework.yaml_editor.ui.dialog.SchemaFolderSelectionDialog;

Expand Down Expand Up @@ -79,10 +80,14 @@ protected void performApply() {
private boolean saveYAMLEditorProperty() {
String schemaFolderName = fSchemaFolderText.getText();

if (schemaFolderName == null || schemaFolderName.equals("")) {
if (schemaFolderName == null
|| schemaFolderName.equals("")) { //$NON-NLS-1$

MessageDialog.openError(getShell(),
"スキーマフォルダー選択",
"スキーマフォルダーを選択して下さい。");
Messages.getString("YAMLEditorPropertyPage.Title"), //$NON-NLS-1$
Messages.getString(
"YAMLEditorPropertyPage.SelectSchemaFolderMessage" //$NON-NLS-1$
));
return false;
}

Expand All @@ -91,8 +96,11 @@ private boolean saveYAMLEditorProperty() {
IFolder folder = project.getFolder(schemaFolderName);
if (!folder.exists()) {
MessageDialog.openError(getShell(),
"スキーマフォルダー選択",
schemaFolderName + "は存在しません。");
Messages.getString(
"YAMLEditorPropertyPage.Title"), //$NON-NLS-1$
schemaFolderName
+ Messages.getString(
"YAMLEditorPropertyPage.NoExistSchemaFolder")); //$NON-NLS-1$
return false;
}

Expand Down Expand Up @@ -135,10 +143,11 @@ protected Control createContents(Composite parent) {
composite.setSize(new Point(BASE_WIDTH, BASE_HEIGHT));

Label label = new Label(composite, SWT.NONE);
label.setText("スキーマフォルダー(&S):");
label.setText(Messages.getString(
"YAMLEditorPropertyPage.SchemaFolderLabelCaption")); //$NON-NLS-1$

Label dummy = new Label(composite, SWT.NONE);
dummy.setText("");
dummy.setText(""); //$NON-NLS-1$

GridData gridData = null;

Expand All @@ -149,7 +158,8 @@ protected Control createContents(Composite parent) {


Button button = new Button(composite, SWT.NONE);
button.setText("参照(&W)...");
button.setText(Messages.getString(
"YAMLEditorPropertyPage.ReferenceButtonCaption")); //$NON-NLS-1$
gridData = new GridData();
gridData.widthHint = BUTTON_WIDTH;
button.setLayoutData(gridData);
Expand Down

0 comments on commit 7778382

Please sign in to comment.