mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-12 11:35:21 +02:00
Fix descriptor name on edit config dialog.
Use the label provider if there is one. Also externalizes strings for the dialog. Change-Id: I3a1e5c7f2b2843cd014a033ee5859832f7e10f9e
This commit is contained in:
parent
303bd3aaa7
commit
ecc24ace4d
3 changed files with 29 additions and 6 deletions
|
@ -12,10 +12,12 @@ import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
import org.eclipse.jface.dialogs.TitleAreaDialog;
|
import org.eclipse.jface.dialogs.TitleAreaDialog;
|
||||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||||
import org.eclipse.jface.operation.ModalContext;
|
import org.eclipse.jface.operation.ModalContext;
|
||||||
|
import org.eclipse.jface.viewers.ILabelProvider;
|
||||||
import org.eclipse.jface.wizard.ProgressMonitorPart;
|
import org.eclipse.jface.wizard.ProgressMonitorPart;
|
||||||
import org.eclipse.launchbar.core.ILaunchDescriptor;
|
import org.eclipse.launchbar.core.ILaunchDescriptor;
|
||||||
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
import org.eclipse.launchbar.core.target.ILaunchTarget;
|
||||||
import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog;
|
import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog;
|
||||||
|
import org.eclipse.launchbar.ui.ILaunchBarUIManager;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.custom.CTabFolder;
|
import org.eclipse.swt.custom.CTabFolder;
|
||||||
import org.eclipse.swt.custom.CTabItem;
|
import org.eclipse.swt.custom.CTabItem;
|
||||||
|
@ -70,19 +72,28 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
|
||||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
composite.setFont(parent.getFont());
|
composite.setFont(parent.getFont());
|
||||||
|
|
||||||
getShell().setText("Edit Configuration");
|
getShell().setText(Messages.LaunchBarLaunchConfigDialog_EditConfiguration);
|
||||||
boolean supportsTargets = true;
|
boolean supportsTargets = true;
|
||||||
try {
|
try {
|
||||||
supportsTargets = descriptor.getType().supportsTargets();
|
supportsTargets = descriptor.getType().supportsTargets();
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
Activator.log(e);
|
Activator.log(e);
|
||||||
}
|
}
|
||||||
if (supportsTargets) {
|
|
||||||
setTitle(String.format("Edit %s for %s on %s", descriptor.getName(), mode.getLabel(), target.getId()));
|
try {
|
||||||
} else {
|
ILaunchBarUIManager uiManager = Activator.getService(ILaunchBarUIManager.class);
|
||||||
setTitle(String.format("Edit %s for %s", descriptor.getName(), mode.getLabel()));
|
ILabelProvider labelProvider = uiManager.getLabelProvider(descriptor);
|
||||||
|
String descName = labelProvider != null ? labelProvider.getText(descriptor) : descriptor.getName();
|
||||||
|
if (supportsTargets) {
|
||||||
|
setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit2, descName, mode.getLabel(), target.getId()));
|
||||||
|
} else {
|
||||||
|
setTitle(String.format(Messages.LaunchBarLaunchConfigDialog_Edit1, descName, mode.getLabel()));
|
||||||
|
}
|
||||||
|
} catch (CoreException e) {
|
||||||
|
Activator.log(e);
|
||||||
}
|
}
|
||||||
setMessage("Set parameters for the configuration.");
|
|
||||||
|
setMessage(Messages.LaunchBarLaunchConfigDialog_SetParameters);
|
||||||
|
|
||||||
tabFolder = new CTabFolder(composite, SWT.NONE);
|
tabFolder = new CTabFolder(composite, SWT.NONE);
|
||||||
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||||
|
|
|
@ -41,6 +41,14 @@ public class Messages extends NLS {
|
||||||
public static String CannotEditLaunchConfiguration;
|
public static String CannotEditLaunchConfiguration;
|
||||||
public static String NoLaunchModeSelected;
|
public static String NoLaunchModeSelected;
|
||||||
public static String NoLaunchGroupSelected;
|
public static String NoLaunchGroupSelected;
|
||||||
|
public static String LaunchBarLaunchConfigDialog_Edit1;
|
||||||
|
|
||||||
|
public static String LaunchBarLaunchConfigDialog_Edit2;
|
||||||
|
|
||||||
|
public static String LaunchBarLaunchConfigDialog_EditConfiguration;
|
||||||
|
|
||||||
|
public static String LaunchBarLaunchConfigDialog_SetParameters;
|
||||||
|
|
||||||
public static String LaunchConfigurationNotFound;
|
public static String LaunchConfigurationNotFound;
|
||||||
public static String LaunchConfigurationNotFoundDesc;
|
public static String LaunchConfigurationNotFoundDesc;
|
||||||
public static String NoLaunchTabsDefined;
|
public static String NoLaunchTabsDefined;
|
||||||
|
|
|
@ -34,6 +34,10 @@ NoLaunchConfigType=No launch configuration type matches selected launch descript
|
||||||
CannotEditLaunchConfiguration=Cannot edit this configuration.
|
CannotEditLaunchConfiguration=Cannot edit this configuration.
|
||||||
NoLaunchModeSelected=No launch mode selected.
|
NoLaunchModeSelected=No launch mode selected.
|
||||||
NoLaunchGroupSelected=No launch group found for the current selection.
|
NoLaunchGroupSelected=No launch group found for the current selection.
|
||||||
|
LaunchBarLaunchConfigDialog_Edit1=Edit %s for %s
|
||||||
|
LaunchBarLaunchConfigDialog_Edit2=Edit %s for %s on %s
|
||||||
|
LaunchBarLaunchConfigDialog_EditConfiguration=Edit Configuration
|
||||||
|
LaunchBarLaunchConfigDialog_SetParameters=Set parameters for the configuration.
|
||||||
LaunchConfigurationNotFound=Launch Configuration Not Found
|
LaunchConfigurationNotFound=Launch Configuration Not Found
|
||||||
LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target.
|
LaunchConfigurationNotFoundDesc=No launch configuration is found for the given launch descriptor and target.
|
||||||
NoLaunchTabsDefined=No launch tabs defined.
|
NoLaunchTabsDefined=No launch tabs defined.
|
||||||
|
|
Loading…
Add table
Reference in a new issue