Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5b774472ee9c5fd157c5c65fb7a19c0c6ca56a6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*******************************************************************************
 * Copyright (c) 2011 - 2014 Wind River Systems, Inc. and others. All rights reserved.
 * This program and the accompanying materials are made available under the terms
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tcf.core.nls;

import java.lang.reflect.Field;

import org.eclipse.osgi.util.NLS;

/**
 * Plug-in externalized strings management.
 */
public class Messages extends NLS {

	// The plug-in resource bundle name
	private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.core.nls.Messages"; //$NON-NLS-1$

	/**
	 * Static constructor.
	 */
	static {
		// Load message values from bundle file
		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
	}

	/**
	 * Returns if or if not this NLS manager contains a constant for
	 * the given externalized strings key.
	 *
	 * @param key The externalized strings key or <code>null</code>.
	 * @return <code>True</code> if a constant for the given key exists, <code>false</code> otherwise.
	 */
	public static boolean hasString(String key) {
		if (key != null) {
			try {
				Field field = Messages.class.getDeclaredField(key);
				return field != null;
			} catch (NoSuchFieldException e) { /* ignored on purpose */ }
		}

		return false;
	}

	/**
	 * Returns the corresponding string for the given externalized strings
	 * key or <code>null</code> if the key does not exist.
	 *
	 * @param key The externalized strings key or <code>null</code>.
	 * @return The corresponding string or <code>null</code>.
	 */
	public static String getString(String key) {
		if (key != null) {
			try {
				Field field = Messages.class.getDeclaredField(key);
				return (String)field.get(null);
			} catch (Exception e) { /* ignored on purpose */ }
		}

		return null;
	}

	// **** Declare externalized string id's down here *****

	public static String InternalChannelOpenListener_onChannelOpen_message;

	public static String InternalChannelListener_onChannelClosed_message;
	public static String InternalChannelListener_onChannelClosed_cause;

	public static String ChannelManager_openChannel_message;
	public static String ChannelManager_openChannel_reuse_message;
	public static String ChannelManager_openChannel_pending_message;
	public static String ChannelManager_openChannel_new_message;
	public static String ChannelManager_openChannel_success_message;
	public static String ChannelManager_openChannel_failed_message;
	public static String ChannelManager_openChannel_valueAdd_check;
	public static String ChannelManager_openChannel_valueAdd_noneApplicable;
	public static String ChannelManager_openChannel_valueAdd_numApplicable;
	public static String ChannelManager_openChannel_valueAdd_isAlive;
	public static String ChannelManager_openChannel_valueAdd_launch;
	public static String ChannelManager_openChannel_valueAdd_launch_exception;
	public static String ChannelManager_openChannel_valueAdd_startChaining;
	public static String ChannelManager_openChannel_proxies_startChaining;
	public static String ChannelManager_openChannel_succeeded;
	public static String ChannelManager_openChannel_failed;
	public static String ChannelManager_openChannel_redirect_succeeded;
	public static String ChannelManager_openChannel_redirect_failed;
	public static String ChannelManager_openChannel_redirect_invalidChannelState;
	public static String ChannelManager_closeChannel_close_message;
	public static String ChannelManager_closeChannel_message;
	public static String ChannelManager_closeChannel_inuse_message;
	public static String ChannelManager_closeChannel_closed_message;
	public static String ChannelManager_closeChannel_pending_message;
	public static String ChannelManager_closeChannel_failed_message;
	public static String ChannelManager_stream_closed_message;
	public static String ChannelManager_stream_missing_service_message;

	public static String AbstractExternalValueAdd_error_invalidLocation;
	public static String AbstractExternalValueAdd_start_at;
	public static String AbstractExternalValueAdd_died_at;
	public static String AbstractExternalValueAdd_running_at;
	public static String AbstractExternalValueAdd_start_waiting_at;
	public static String AbstractExternalValueAdd_stop_waiting_at;
	public static String AbstractExternalValueAdd_output;
	public static String AbstractExternalValueAdd_error_cause;
	public static String AbstractExternalValueAdd_error_processDied;
	public static String AbstractExternalValueAdd_error_failedToReadOutput;
	public static String AbstractExternalValueAdd_error_output;
	public static String AbstractExternalValueAdd_error_invalidPeerAttributes;

	public static String ValueAddLauncher_launch_command;

	public static String CallbackMonitor_AllTasksFinished;

	public static String MonitorTask_TimeoutError;

	public static String Extension_error_invalidProtocolStateChangeListener;
	public static String Extension_error_invalidChannelStateChangeListener;

	public static String AbstractJob_error_dialogTitle;

	public static String StepperOperationService_stepGroupName_openChannel;
	public static String StepperOperationService_stepGroupName_closeChannel;
}

Back to the top