mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 13:05:22 +02:00
[235626] Convert terminals.ui to MessageBundle format
This commit is contained in:
parent
d845181b70
commit
19fdbcabac
6 changed files with 55 additions and 66 deletions
|
@ -1,18 +1,16 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2008 MontaVista Software, Inc.
|
* Copyright (c) 2008 MontaVista Software, Inc. and others.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Yu-Fen Kuo (MontaVista) - initial API and implementation
|
* Yu-Fen Kuo (MontaVista) - initial API and implementation
|
||||||
|
* Martin Oberhuber (Wind River) - [235626] Convert terminals.ui to MessageBundle format
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.terminals.ui;
|
package org.eclipse.rse.internal.terminals.ui;
|
||||||
|
|
||||||
import java.util.MissingResourceException;
|
|
||||||
import java.util.ResourceBundle;
|
|
||||||
|
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
import org.osgi.framework.BundleContext;
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
|
@ -27,8 +25,6 @@ public class Activator extends SystemBasePlugin {
|
||||||
// The shared instance
|
// The shared instance
|
||||||
private static Activator plugin;
|
private static Activator plugin;
|
||||||
|
|
||||||
private ResourceBundle resourceBundle;
|
|
||||||
|
|
||||||
public static String ICON_ID_LAUNCH_TERMINAL = "icon_id_launch_terminal"; //$NON-NLS-1$
|
public static String ICON_ID_LAUNCH_TERMINAL = "icon_id_launch_terminal"; //$NON-NLS-1$
|
||||||
public static String ICON_ID_TERMINAL_SUBSYSTEM = "icon_id_terminal_subsystem"; //$NON-NLS-1$
|
public static String ICON_ID_TERMINAL_SUBSYSTEM = "icon_id_terminal_subsystem"; //$NON-NLS-1$
|
||||||
public static String ICON_ID_TERMINAL_SUBSYSTEM_LIVE = "icon_id_terminal_subsystem_live"; //$NON-NLS-1$
|
public static String ICON_ID_TERMINAL_SUBSYSTEM_LIVE = "icon_id_terminal_subsystem_live"; //$NON-NLS-1$
|
||||||
|
@ -42,7 +38,7 @@ public class Activator extends SystemBasePlugin {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
public void start(BundleContext context) throws Exception {
|
public void start(BundleContext context) throws Exception {
|
||||||
|
@ -52,59 +48,23 @@ public class Activator extends SystemBasePlugin {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
public void stop(BundleContext context) throws Exception {
|
public void stop(BundleContext context) throws Exception {
|
||||||
plugin = null;
|
plugin = null;
|
||||||
resourceBundle = null;
|
|
||||||
super.stop(context);
|
super.stop(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the shared instance
|
* Returns the shared instance
|
||||||
*
|
*
|
||||||
* @return the shared instance
|
* @return the shared instance
|
||||||
*/
|
*/
|
||||||
public static Activator getDefault() {
|
public static Activator getDefault() {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the string from the plugin's resource bundle, or 'key' if not
|
|
||||||
* found.
|
|
||||||
*
|
|
||||||
* @see java.util.ResourceBundle#getString(String)
|
|
||||||
*
|
|
||||||
* @param key
|
|
||||||
* the key for the desired string
|
|
||||||
* @return the string for the given key
|
|
||||||
*/
|
|
||||||
public static String getResourceString(String key) {
|
|
||||||
ResourceBundle bundle = Activator.getDefault().getResourceBundle();
|
|
||||||
try {
|
|
||||||
return (bundle != null) ? bundle.getString(key) : key;
|
|
||||||
} catch (MissingResourceException e) {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the plugin's Resource bundle.
|
|
||||||
*
|
|
||||||
* @return the Resource bundle
|
|
||||||
*/
|
|
||||||
public ResourceBundle getResourceBundle() {
|
|
||||||
try {
|
|
||||||
if (resourceBundle == null)
|
|
||||||
resourceBundle = ResourceBundle
|
|
||||||
.getBundle("org.eclipse.rse.internal.terminals.ui.TerminalUIResources"); //$NON-NLS-1$
|
|
||||||
} catch (MissingResourceException x) {
|
|
||||||
resourceBundle = null;
|
|
||||||
}
|
|
||||||
return resourceBundle;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the image registry by declaring all of the required graphics.
|
* Initialize the image registry by declaring all of the required graphics.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2008 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:
|
||||||
|
* Martin Oberhuber (Wind River) - [235626] initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package org.eclipse.rse.internal.terminals.ui;
|
||||||
|
|
||||||
|
import org.eclipse.osgi.util.NLS;
|
||||||
|
|
||||||
|
public class TerminalUIResources extends NLS {
|
||||||
|
private static String BUNDLE_NAME = "org.eclipse.rse.internal.terminals.ui.TerminalUIResources"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
public static String RemoveTerminalAction_label;
|
||||||
|
public static String RemoveTerminalAction_tooltip;
|
||||||
|
public static String ShowInTerminalViewAction_label;
|
||||||
|
public static String ShowInTerminalViewAction_tooltip;
|
||||||
|
|
||||||
|
public static String TerminalsUI_cannotOpenView_error;
|
||||||
|
|
||||||
|
static {
|
||||||
|
NLS.initializeMessages(BUNDLE_NAME, TerminalUIResources.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,22 +1,21 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
# Copyright (c) 2008 MontaVista Software, Inc.
|
# Copyright (c) 2008 MontaVista Software, Inc. and others.
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
# http://www.eclipse.org/legal/epl-v10.html
|
# http://www.eclipse.org/legal/epl-v10.html
|
||||||
#
|
#
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# Yu-Fen Kuo (MontaVista) - initial API and implementation
|
# Yu-Fen Kuo (MontaVista) - initial API and implementation
|
||||||
|
# Martin Oberhuber (Wind River) - [235626] Convert terminals.ui to MessageBundle format
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# NLS_MESSAGEFORMAT_VAR
|
# NLS_MESSAGEFORMAT_VAR
|
||||||
# NLS_ENCODING=UTF-8
|
# NLS_ENCODING=UTF-8
|
||||||
|
|
||||||
LaunchTerminalAction.title=Launch Terminal
|
RemoveTerminalAction_label=Remove Terminal
|
||||||
LaunchTerminalAction.tooltip=Launch Terminal view
|
RemoveTerminalAction_tooltip=Remove current terminal from terminals view
|
||||||
TerminalsUI.cannotOpenView.error=Can not open remote terminals view
|
ShowInTerminalViewAction_label=Show In Terminals View
|
||||||
|
ShowInTerminalViewAction_tooltip=Show current terminal in Terminals view
|
||||||
|
|
||||||
RemoveTerminalAction.label=Remove Terminal
|
TerminalsUI_cannotOpenView_error=Can not open remote terminals view
|
||||||
RemoveTerminalAction.tooltip=Remove current terminal from terminals view
|
|
||||||
ShowInTerminalViewAction.label=Show In Terminals View
|
|
||||||
ShowInTerminalViewAction.tooltip=Show current terminal in Terminals view
|
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work
|
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work
|
||||||
* Anna Dushistova (MontaVista) - Adapted from SystemShowInShellViewAction
|
* Anna Dushistova (MontaVista) - Adapted from SystemShowInShellViewAction
|
||||||
* Anna Dushistova (MontaVista) - Adapted from ShowInTerminalViewAction
|
* Anna Dushistova (MontaVista) - Adapted from ShowInTerminalViewAction
|
||||||
|
* Martin Oberhuber (Wind River) - [235626] Convert terminals.ui to MessageBundle format
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.rse.internal.terminals.ui.actions;
|
package org.eclipse.rse.internal.terminals.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.rse.internal.terminals.ui.Activator;
|
import org.eclipse.rse.internal.terminals.ui.Activator;
|
||||||
|
import org.eclipse.rse.internal.terminals.ui.TerminalUIResources;
|
||||||
import org.eclipse.rse.internal.terminals.ui.views.TerminalViewer;
|
import org.eclipse.rse.internal.terminals.ui.views.TerminalViewer;
|
||||||
import org.eclipse.rse.internal.terminals.ui.views.TerminalsUI;
|
import org.eclipse.rse.internal.terminals.ui.views.TerminalsUI;
|
||||||
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement;
|
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement;
|
||||||
|
@ -27,8 +29,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
public class RemoveTerminalAction extends TerminalElementBaseAction {
|
public class RemoveTerminalAction extends TerminalElementBaseAction {
|
||||||
public RemoveTerminalAction(Shell parent) {
|
public RemoveTerminalAction(Shell parent) {
|
||||||
this(Activator.getResourceString("RemoveTerminalAction.label"), //$NON-NLS-1$
|
this(TerminalUIResources.RemoveTerminalAction_label, TerminalUIResources.RemoveTerminalAction_tooltip,
|
||||||
Activator.getResourceString("RemoveTerminalAction.tooltip"), //$NON-NLS-1$
|
|
||||||
Activator.getDefault().getImageDescriptor(
|
Activator.getDefault().getImageDescriptor(
|
||||||
Activator.ICON_ID_REMOVE_TERMINAL), parent);
|
Activator.ICON_ID_REMOVE_TERMINAL), parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,13 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work
|
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work
|
||||||
* Anna Dushistova (MontaVista) - Adapted from SystemShowInShellViewAction
|
* Anna Dushistova (MontaVista) - Adapted from SystemShowInShellViewAction
|
||||||
|
* Martin Oberhuber (Wind River) - [235626] Convert terminals.ui to MessageBundle format
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.terminals.ui.actions;
|
package org.eclipse.rse.internal.terminals.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.rse.internal.terminals.ui.Activator;
|
import org.eclipse.rse.internal.terminals.ui.Activator;
|
||||||
|
import org.eclipse.rse.internal.terminals.ui.TerminalUIResources;
|
||||||
import org.eclipse.rse.internal.terminals.ui.views.TerminalViewer;
|
import org.eclipse.rse.internal.terminals.ui.views.TerminalViewer;
|
||||||
import org.eclipse.rse.internal.terminals.ui.views.TerminalsUI;
|
import org.eclipse.rse.internal.terminals.ui.views.TerminalsUI;
|
||||||
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement;
|
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement;
|
||||||
|
@ -27,11 +29,8 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
public class ShowInTerminalViewAction extends TerminalElementBaseAction {
|
public class ShowInTerminalViewAction extends TerminalElementBaseAction {
|
||||||
|
|
||||||
public ShowInTerminalViewAction(Shell parent) {
|
public ShowInTerminalViewAction(Shell parent) {
|
||||||
super(
|
super(TerminalUIResources.ShowInTerminalViewAction_label, TerminalUIResources.ShowInTerminalViewAction_tooltip,
|
||||||
Activator.getResourceString("ShowInTerminalViewAction.label"), //$NON-NLS-1$
|
Activator.getDefault().getImageDescriptor(Activator.ICON_ID_LAUNCH_TERMINAL), parent);
|
||||||
Activator.getResourceString("ShowInTerminalViewAction.tooltip"), //$NON-NLS-1$
|
|
||||||
Activator.getDefault().getImageDescriptor(
|
|
||||||
Activator.ICON_ID_LAUNCH_TERMINAL), parent);
|
|
||||||
allowOnMultipleSelection(false);
|
allowOnMultipleSelection(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,12 @@
|
||||||
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
||||||
* Yu-Fen Kuo (MontaVista) - Adapted from SystemCommandsUI
|
* Yu-Fen Kuo (MontaVista) - Adapted from SystemCommandsUI
|
||||||
* Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl
|
* Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl
|
||||||
|
* Martin Oberhuber (Wind River) - [235626] Convert terminals.ui to MessageBundle format
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.terminals.ui.views;
|
package org.eclipse.rse.internal.terminals.ui.views;
|
||||||
|
|
||||||
import org.eclipse.rse.internal.terminals.ui.Activator;
|
import org.eclipse.rse.internal.terminals.ui.TerminalUIResources;
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.PartInitException;
|
import org.eclipse.ui.PartInitException;
|
||||||
|
@ -57,8 +58,7 @@ public class TerminalsUI {
|
||||||
viewer = (TerminalViewer) page.showView(TerminalViewer.VIEW_ID);
|
viewer = (TerminalViewer) page.showView(TerminalViewer.VIEW_ID);
|
||||||
page.bringToTop(viewer);
|
page.bringToTop(viewer);
|
||||||
} catch (PartInitException e) {
|
} catch (PartInitException e) {
|
||||||
SystemBasePlugin.logError(Activator
|
SystemBasePlugin.logError(TerminalUIResources.TerminalsUI_cannotOpenView_error, e);
|
||||||
.getResourceString("TerminalsUI.cannotOpenView.error"), e); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return viewer;
|
return viewer;
|
||||||
|
|
Loading…
Add table
Reference in a new issue