|
Lines 11-17
Link Here
|
| 11 |
package org.eclipse.debug.internal.ui.launchConfigurations; |
11 |
package org.eclipse.debug.internal.ui.launchConfigurations; |
| 12 |
|
12 |
|
| 13 |
|
13 |
|
| 14 |
import java.util.HashSet; |
|
|
| 15 |
import java.util.List; |
14 |
import java.util.List; |
| 16 |
import java.util.Set; |
15 |
import java.util.Set; |
| 17 |
|
16 |
|
|
Lines 37-48
Link Here
|
| 37 |
import org.eclipse.jface.dialogs.IDialogConstants; |
36 |
import org.eclipse.jface.dialogs.IDialogConstants; |
| 38 |
import org.eclipse.jface.viewers.ISelection; |
37 |
import org.eclipse.jface.viewers.ISelection; |
| 39 |
import org.eclipse.jface.viewers.IStructuredSelection; |
38 |
import org.eclipse.jface.viewers.IStructuredSelection; |
| 40 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
|
| 41 |
import org.eclipse.jface.viewers.StructuredSelection; |
39 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 42 |
import org.eclipse.jface.viewers.Viewer; |
40 |
import org.eclipse.jface.viewers.Viewer; |
| 43 |
import org.eclipse.swt.SWT; |
41 |
import org.eclipse.swt.SWT; |
| 44 |
import org.eclipse.swt.custom.BusyIndicator; |
42 |
import org.eclipse.swt.custom.BusyIndicator; |
| 45 |
import org.eclipse.swt.custom.CLabel; |
|
|
| 46 |
import org.eclipse.swt.custom.CTabFolder; |
43 |
import org.eclipse.swt.custom.CTabFolder; |
| 47 |
import org.eclipse.swt.custom.CTabItem; |
44 |
import org.eclipse.swt.custom.CTabItem; |
| 48 |
import org.eclipse.swt.custom.StackLayout; |
45 |
import org.eclipse.swt.custom.StackLayout; |
|
Lines 294-299
Link Here
|
| 294 |
fOptionsLink.setFont(linkComp.getFont()); |
291 |
fOptionsLink.setFont(linkComp.getFont()); |
| 295 |
gd = new GridData(GridData.BEGINNING); |
292 |
gd = new GridData(GridData.BEGINNING); |
| 296 |
fOptionsLink.setLayoutData(gd); |
293 |
fOptionsLink.setLayoutData(gd); |
|
|
294 |
fOptionsLink.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_13); |
| 297 |
fOptionsLink.addSelectionListener(new SelectionListener() { |
295 |
fOptionsLink.addSelectionListener(new SelectionListener() { |
| 298 |
public void widgetSelected(SelectionEvent e) { |
296 |
public void widgetSelected(SelectionEvent e) { |
| 299 |
//collect the options available |
297 |
//collect the options available |
|
Lines 309-333
Link Here
|
| 309 |
modes.remove(getLaunchConfigurationDialog().getMode()); |
307 |
modes.remove(getLaunchConfigurationDialog().getMode()); |
| 310 |
ILaunchConfigurationWorkingCopy wc = getWorkingCopy(); |
308 |
ILaunchConfigurationWorkingCopy wc = getWorkingCopy(); |
| 311 |
wc.setModes(modes); |
309 |
wc.setModes(modes); |
| 312 |
refresh(); |
|
|
| 313 |
refreshStatus(); |
310 |
refreshStatus(); |
| 314 |
} |
311 |
} |
| 315 |
} |
312 |
} |
| 316 |
} |
313 |
} |
| 317 |
else if(hasDuplicateDelegates()) { |
|
|
| 318 |
Set modes = new HashSet(); |
| 319 |
modes.add(getLaunchConfigurationDialog().getMode()); |
| 320 |
modes.addAll(getWorkingCopy().getModes()); |
| 321 |
SelectLaunchDelegatesDialog sld = new SelectLaunchDelegatesDialog(getShell(), fTabType.getDelegates(modes)); |
| 322 |
if(sld.open() == IDialogConstants.OK_ID) { |
| 323 |
Object[] res = sld.getResult(); |
| 324 |
if(res != null) { |
| 325 |
fTabType.setPreferredDelegate(modes, (ILaunchDelegate) res[0]); |
| 326 |
disposeExistingTabs(); |
| 327 |
displayInstanceTabs(); |
| 328 |
} |
| 329 |
} |
| 330 |
} |
| 331 |
} catch (CoreException ex) {} |
314 |
} catch (CoreException ex) {} |
| 332 |
} |
315 |
} |
| 333 |
public void widgetDefaultSelected(SelectionEvent e) {} |
316 |
public void widgetDefaultSelected(SelectionEvent e) {} |
|
Lines 366-385
Link Here
|
| 366 |
} |
349 |
} |
| 367 |
|
350 |
|
| 368 |
/** |
351 |
/** |
| 369 |
* Simple method to create a spacer in the page |
|
|
| 370 |
* |
| 371 |
* @param composite the composite to add the spacer to |
| 372 |
* @param columnSpan the amount of space for the spacer |
| 373 |
* @since 3.2 |
| 374 |
*/ |
| 375 |
protected void createSpacer(Composite composite, int columnSpan) { |
| 376 |
Label label = new Label(composite, SWT.NONE); |
| 377 |
GridData gd = new GridData(); |
| 378 |
gd.horizontalSpan = columnSpan; |
| 379 |
label.setLayoutData(gd); |
| 380 |
} |
| 381 |
|
| 382 |
/** |
| 383 |
* Creates some help text for the tab group launch types |
352 |
* Creates some help text for the tab group launch types |
| 384 |
* @param parent thep arent composite |
353 |
* @param parent thep arent composite |
| 385 |
* @since 3.2 |
354 |
* @since 3.2 |
|
Lines 387-410
Link Here
|
| 387 |
private void createGettingStarted(Composite parent) { |
356 |
private void createGettingStarted(Composite parent) { |
| 388 |
Font font = parent.getFont(); |
357 |
Font font = parent.getFont(); |
| 389 |
GridData gd = null; |
358 |
GridData gd = null; |
| 390 |
createWrapLabel(parent, null, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_1); |
359 |
int width = parent.getBounds().width - 30; |
| 391 |
createWrapLabel(parent, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG), |
360 |
SWTUtil.createWrapLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_1, 1, width); |
| 392 |
LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2); |
361 |
SWTUtil.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_2, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG), 1, width); |
| 393 |
createWrapLabel(parent, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG), |
362 |
SWTUtil.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_6, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG), 1, width); |
| 394 |
LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_6); |
363 |
SWTUtil.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG), 1, width); |
| 395 |
createWrapLabel(parent, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG), |
364 |
SWTUtil.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_8, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS), 1, width); |
| 396 |
LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_4); |
365 |
SWTUtil.createWrapCLabel(parent, LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_3, DebugUITools.getImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT), 1, width); |
| 397 |
createWrapLabel(parent, DebugUITools.getImage(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS), |
|
|
| 398 |
LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_8); |
| 399 |
createWrapLabel(parent, DebugUITools.getImage(IInternalDebugUIConstants.IMG_OVR_TRANSPARENT), |
| 400 |
LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_3); |
| 401 |
|
366 |
|
| 402 |
createSpacer(parent, 2); |
367 |
SWTUtil.createHorizontalSpacer(parent, 2); |
| 403 |
Link link = new Link(parent, SWT.LEFT | SWT.WRAP); |
368 |
Link link = new Link(parent, SWT.LEFT | SWT.WRAP); |
| 404 |
link.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_5); |
369 |
link.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_5); |
| 405 |
link.setFont(font); |
370 |
link.setFont(font); |
| 406 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
371 |
gd = new GridData(GridData.FILL_HORIZONTAL); |
| 407 |
gd.widthHint = parent.getBounds().width - 30; |
372 |
gd.widthHint = width; |
| 408 |
link.setLayoutData(gd); |
373 |
link.setLayoutData(gd); |
| 409 |
link.addSelectionListener(new SelectionListener() { |
374 |
link.addSelectionListener(new SelectionListener() { |
| 410 |
public void widgetSelected(SelectionEvent e) { |
375 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 413-434
Link Here
|
| 413 |
public void widgetDefaultSelected(SelectionEvent e) {} |
378 |
public void widgetDefaultSelected(SelectionEvent e) {} |
| 414 |
}); |
379 |
}); |
| 415 |
} |
380 |
} |
| 416 |
|
|
|
| 417 |
/** |
| 418 |
* Create a label on the given parent that wraps text. |
| 419 |
* |
| 420 |
* @param parent |
| 421 |
* @param text |
| 422 |
*/ |
| 423 |
private void createWrapLabel(Composite parent, Image image, String text) { |
| 424 |
CLabel lbl = new CLabel(parent, SWT.NONE | SWT.WRAP); |
| 425 |
lbl.setImage(image); |
| 426 |
lbl.setFont(parent.getFont()); |
| 427 |
lbl.setText(text); |
| 428 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
| 429 |
gd.widthHint = parent.getBounds().width - 30; |
| 430 |
lbl.setLayoutData(gd); |
| 431 |
} |
| 432 |
|
381 |
|
| 433 |
/** |
382 |
/** |
| 434 |
* Creates the tab folder for displaying config instances |
383 |
* Creates the tab folder for displaying config instances |
|
Lines 519-528
Link Here
|
| 519 |
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() |
468 |
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() |
| 520 |
*/ |
469 |
*/ |
| 521 |
public ISelection getSelection() { |
470 |
public ISelection getSelection() { |
| 522 |
if (getActiveTab() == null) { |
471 |
/*if (getActiveTab() == null) { |
| 523 |
return new StructuredSelection(); |
472 |
return new StructuredSelection(); |
| 524 |
} |
473 |
} */ |
| 525 |
return new StructuredSelection(getActiveTab()); |
474 |
return new StructuredSelection(fWorkingCopy/*getActiveTab()*/); |
| 526 |
} |
475 |
} |
| 527 |
|
476 |
|
| 528 |
/** |
477 |
/** |
|
Lines 540-558
Link Here
|
| 540 |
// update error ticks |
489 |
// update error ticks |
| 541 |
CTabItem item = null; |
490 |
CTabItem item = null; |
| 542 |
boolean error = false; |
491 |
boolean error = false; |
|
|
492 |
Image image = null; |
| 543 |
for (int i = 0; i < tabs.length; i++) { |
493 |
for (int i = 0; i < tabs.length; i++) { |
| 544 |
tabs[i].isValid(getWorkingCopy()); |
494 |
error = tabs[i].getErrorMessage() != null && !tabs[i].isValid(getWorkingCopy()); |
| 545 |
error = tabs[i].getErrorMessage() != null; |
495 |
image = tabs[i].getImage(); |
| 546 |
item = fTabFolder.getItem(i); |
496 |
item = fTabFolder.getItem(i); |
| 547 |
setTabIcon(item, error, tabs[i]); |
497 |
if(error) { |
| 548 |
} |
498 |
item.setImage(DebugUIPlugin.getDefault().getLaunchConfigurationManager().getErrorTabImage(tabs[i])); |
| 549 |
if(!canLaunchWithModes()) { |
499 |
} |
| 550 |
fOptionsLink.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_13); |
500 |
else { |
| 551 |
} |
501 |
item.setImage(image); |
| 552 |
else if(hasDuplicateDelegates()) { |
502 |
} |
| 553 |
fOptionsLink.setText(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_15); |
|
|
| 554 |
} |
503 |
} |
| 555 |
fOptionsLink.setVisible(!canLaunchWithModes() || hasDuplicateDelegates()); |
504 |
fOptionsLink.setVisible(!canLaunchWithModes()); |
| 556 |
fOptionsLink.getParent().layout(); |
505 |
fOptionsLink.getParent().layout(); |
| 557 |
} |
506 |
} |
| 558 |
} |
507 |
} |
|
Lines 565-584
Link Here
|
| 565 |
fApplyButton.setEnabled(dirty && canSave()); |
514 |
fApplyButton.setEnabled(dirty && canSave()); |
| 566 |
fRevertButton.setEnabled(dirty); |
515 |
fRevertButton.setEnabled(dirty); |
| 567 |
} |
516 |
} |
| 568 |
|
|
|
| 569 |
/** |
| 570 |
* Set the specified tab item's icon to an error icon if <code>error</code> is true, |
| 571 |
* or a transparent icon of the same size otherwise. |
| 572 |
*/ |
| 573 |
private void setTabIcon(CTabItem tabItem, boolean error, ILaunchConfigurationTab tab) { |
| 574 |
Image image = null; |
| 575 |
if (error) { |
| 576 |
image = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getErrorTabImage(tab); |
| 577 |
} else { |
| 578 |
image = tab.getImage(); |
| 579 |
} |
| 580 |
tabItem.setImage(image); |
| 581 |
} |
| 582 |
|
517 |
|
| 583 |
/* (non-Javadoc) |
518 |
/* (non-Javadoc) |
| 584 |
* @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object) |
519 |
* @see org.eclipse.jface.viewers.Viewer#setInput(java.lang.Object) |
|
Lines 673-679
Link Here
|
| 673 |
*/ |
608 |
*/ |
| 674 |
protected void setFocusOnName() { |
609 |
protected void setFocusOnName() { |
| 675 |
fNameWidget.setFocus(); |
610 |
fNameWidget.setFocus(); |
| 676 |
|
|
|
| 677 |
} |
611 |
} |
| 678 |
|
612 |
|
| 679 |
/** |
613 |
/** |
|
Lines 730-768
Link Here
|
| 730 |
* launch configuration type. |
664 |
* launch configuration type. |
| 731 |
*/ |
665 |
*/ |
| 732 |
private void showInstanceTabsFor(ILaunchConfigurationType configType) { |
666 |
private void showInstanceTabsFor(ILaunchConfigurationType configType) { |
| 733 |
|
|
|
| 734 |
// Don't do any work if the current tabs are for the current config type |
667 |
// Don't do any work if the current tabs are for the current config type |
| 735 |
if (fTabType != null && fTabType.equals(configType)) { |
668 |
/*if (fTabType != null && fTabType.equals(configType)) { |
| 736 |
return; |
669 |
return; |
| 737 |
} |
670 |
}*/ |
| 738 |
|
|
|
| 739 |
// try to keep on same tab |
671 |
// try to keep on same tab |
| 740 |
Class tabKind = null; |
672 |
Class tabKind = null; |
| 741 |
if (getActiveTab() != null) { |
673 |
if (getActiveTab() != null) { |
| 742 |
tabKind = getActiveTab().getClass(); |
674 |
tabKind = getActiveTab().getClass(); |
| 743 |
} |
675 |
} |
| 744 |
|
|
|
| 745 |
// Build the new tabs |
676 |
// Build the new tabs |
| 746 |
ILaunchConfigurationTabGroup group = null; |
677 |
ILaunchConfigurationTabGroup group = null; |
| 747 |
try { |
678 |
try { |
| 748 |
group = createGroup(configType); |
679 |
group = createGroup(); |
| 749 |
} catch (CoreException ce) { |
680 |
} catch (CoreException ce) { |
| 750 |
DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Error_19, LaunchConfigurationsMessages.LaunchConfigurationDialog_Exception_occurred_creating_launch_configuration_tabs_27,ce); // |
681 |
DebugUIPlugin.errorDialog(getShell(), LaunchConfigurationsMessages.LaunchConfigurationDialog_Error_19, LaunchConfigurationsMessages.LaunchConfigurationDialog_Exception_occurred_creating_launch_configuration_tabs_27,ce); // |
| 751 |
return; |
682 |
return; |
| 752 |
} |
683 |
} |
| 753 |
|
684 |
disposeExistingTabs(); |
| 754 |
showTabsFor(group); |
|
|
| 755 |
fTabGroup = group; |
685 |
fTabGroup = group; |
| 756 |
fTabType = configType; |
686 |
fTabType = configType; |
| 757 |
|
|
|
| 758 |
// select same tab as before, if possible |
| 759 |
ILaunchConfigurationTab[] tabs = getTabs(); |
687 |
ILaunchConfigurationTab[] tabs = getTabs(); |
|
|
688 |
CTabItem tab = null; |
| 689 |
String name = EMPTY_STRING; |
| 690 |
Control control = null; |
| 691 |
for (int i = 0; i < tabs.length; i++) { |
| 692 |
tab = new CTabItem(fTabFolder, SWT.BORDER); |
| 693 |
name = tabs[i].getName(); |
| 694 |
if (name == null) { |
| 695 |
name = LaunchConfigurationsMessages.LaunchConfigurationDialog_unspecified_28; |
| 696 |
} |
| 697 |
tab.setText(name); |
| 698 |
tab.setImage(tabs[i].getImage()); |
| 699 |
tabs[i].createControl(tab.getParent()); |
| 700 |
control = tabs[i].getControl(); |
| 701 |
if (control != null) { |
| 702 |
tab.setControl(control); |
| 703 |
} |
| 704 |
} |
| 760 |
//set the default tab as the first one |
705 |
//set the default tab as the first one |
| 761 |
setActiveTab(tabs[0]); |
706 |
setActiveTab(tabs[0]); |
|
|
707 |
// select same tab as before, if possible |
| 762 |
for (int i = 0; i < tabs.length; i++) { |
708 |
for (int i = 0; i < tabs.length; i++) { |
| 763 |
ILaunchConfigurationTab tab = tabs[i]; |
709 |
if (tabs[i].getClass().equals(tabKind)) { |
| 764 |
if (tab.getClass().equals(tabKind)) { |
710 |
setActiveTab(tabs[i]); |
| 765 |
setActiveTab(tab); |
|
|
| 766 |
break; |
711 |
break; |
| 767 |
} |
712 |
} |
| 768 |
} |
713 |
} |
|
Lines 782-830
Link Here
|
| 782 |
String mode = fDialog.getMode(); |
727 |
String mode = fDialog.getMode(); |
| 783 |
description = LaunchConfigurationPresentationManager.getDefault().getDescription(configType, mode); |
728 |
description = LaunchConfigurationPresentationManager.getDefault().getDescription(configType, mode); |
| 784 |
} |
729 |
} |
| 785 |
if (description == null) |
730 |
if (description == null) { |
| 786 |
description = EMPTY_STRING; |
731 |
description = EMPTY_STRING; |
|
|
732 |
} |
| 787 |
return description; |
733 |
return description; |
| 788 |
} |
734 |
} |
| 789 |
|
735 |
|
| 790 |
/** |
736 |
/** |
| 791 |
* Create the tabs in the configuration edit area for the given tab group. |
|
|
| 792 |
*/ |
| 793 |
private void showTabsFor(ILaunchConfigurationTabGroup tabGroup) { |
| 794 |
// Dispose the current tabs |
| 795 |
disposeExistingTabs(); |
| 796 |
|
| 797 |
fTabGroup = tabGroup; |
| 798 |
|
| 799 |
// Create the Control for each tab |
| 800 |
ILaunchConfigurationTab[] tabs = tabGroup.getTabs(); |
| 801 |
CTabItem tab = null; |
| 802 |
String name = EMPTY_STRING; |
| 803 |
Control control = null; |
| 804 |
for (int i = 0; i < tabs.length; i++) { |
| 805 |
tab = new CTabItem(fTabFolder, SWT.BORDER); |
| 806 |
name = tabs[i].getName(); |
| 807 |
if (name == null) { |
| 808 |
name = LaunchConfigurationsMessages.LaunchConfigurationDialog_unspecified_28; |
| 809 |
} |
| 810 |
tab.setText(name); |
| 811 |
tab.setImage(tabs[i].getImage()); |
| 812 |
tabs[i].createControl(tab.getParent()); |
| 813 |
control = tabs[i].getControl(); |
| 814 |
if (control != null) { |
| 815 |
tab.setControl(control); |
| 816 |
} |
| 817 |
} |
| 818 |
|
| 819 |
} |
| 820 |
|
| 821 |
/** |
| 822 |
* Returns tab group for the given type of launch configuration. |
737 |
* Returns tab group for the given type of launch configuration. |
| 823 |
* Tabs are initialized to be contained in this dialog. |
738 |
* Tabs are initialized to be contained in this dialog. |
| 824 |
* |
739 |
* |
| 825 |
* @exception CoreException if unable to instantiate a tab group |
740 |
* @exception CoreException if unable to instantiate a tab group |
| 826 |
*/ |
741 |
*/ |
| 827 |
protected ILaunchConfigurationTabGroup createGroup(final ILaunchConfigurationType configType) throws CoreException { |
742 |
protected ILaunchConfigurationTabGroup createGroup() throws CoreException { |
| 828 |
// Use a final Object array to store the tab group and any exception that |
743 |
// Use a final Object array to store the tab group and any exception that |
| 829 |
// results from the Runnable |
744 |
// results from the Runnable |
| 830 |
final Object[] finalArray = new Object[2]; |
745 |
final Object[] finalArray = new Object[2]; |
|
Lines 1029-1035
Link Here
|
| 1029 |
return false; |
944 |
return false; |
| 1030 |
} |
945 |
} |
| 1031 |
} |
946 |
} |
| 1032 |
|
|
|
| 1033 |
return true; |
947 |
return true; |
| 1034 |
} |
948 |
} |
| 1035 |
|
949 |
|
|
Lines 1084-1090
Link Here
|
| 1084 |
modes.add(getLaunchConfigurationDialog().getMode()); |
998 |
modes.add(getLaunchConfigurationDialog().getMode()); |
| 1085 |
ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(fTabType, modes); |
999 |
ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(fTabType, modes); |
| 1086 |
if(delegates.length > 1) { |
1000 |
if(delegates.length > 1) { |
| 1087 |
ILaunchDelegate preferred = fTabType.getPreferredDelegate(modes); |
1001 |
ILaunchDelegate preferred = config.getPreferredDelegate(modes); |
|
|
1002 |
if(preferred == null) { |
| 1003 |
preferred = fTabType.getPreferredDelegate(modes); |
| 1004 |
} |
| 1088 |
if(preferred == null) { |
1005 |
if(preferred == null) { |
| 1089 |
return true; |
1006 |
return true; |
| 1090 |
} |
1007 |
} |
|
Lines 1141-1150
Link Here
|
| 1141 |
return temp.toString(); |
1058 |
return temp.toString(); |
| 1142 |
} |
1059 |
} |
| 1143 |
} |
1060 |
} |
| 1144 |
if(getWorkingCopy() != null) { |
1061 |
if(getWorkingCopy().isReadOnly()) { |
| 1145 |
if(getWorkingCopy().isReadOnly()) { |
1062 |
return LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9; |
| 1146 |
return LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_9; |
|
|
| 1147 |
} |
| 1148 |
} |
1063 |
} |
| 1149 |
//EXPERIMENTAL |
1064 |
//EXPERIMENTAL |
| 1150 |
if(!canLaunchWithModes()) { |
1065 |
if(!canLaunchWithModes()) { |
|
Lines 1157-1171
Link Here
|
| 1157 |
return e.getMessage(); |
1072 |
return e.getMessage(); |
| 1158 |
} |
1073 |
} |
| 1159 |
} |
1074 |
} |
| 1160 |
if(hasDuplicateDelegates()) { |
|
|
| 1161 |
try { |
| 1162 |
Set modes = getWorkingCopy().getModes(); |
| 1163 |
modes.add(getLaunchConfigurationDialog().getMode()); |
| 1164 |
List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes); |
| 1165 |
return MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_16, new String[] {names.toString()}); |
| 1166 |
} |
| 1167 |
catch (CoreException e) {DebugUIPlugin.log(e);} |
| 1168 |
} |
| 1169 |
return null; |
1075 |
return null; |
| 1170 |
} |
1076 |
} |
| 1171 |
|
1077 |
|
|
Lines 1293-1300
Link Here
|
| 1293 |
} |
1199 |
} |
| 1294 |
} |
1200 |
} |
| 1295 |
fCurrentTabIndex = fTabFolder.getSelectionIndex(); |
1201 |
fCurrentTabIndex = fTabFolder.getSelectionIndex(); |
| 1296 |
SelectionChangedEvent event = new SelectionChangedEvent(this, getSelection()); |
|
|
| 1297 |
fireSelectionChanged(event); |
| 1298 |
} |
1202 |
} |
| 1299 |
|
1203 |
|
| 1300 |
/** |
1204 |
/** |
|
Lines 1342-1348
Link Here
|
| 1342 |
if(fTabGroup != null) { |
1246 |
if(fTabGroup != null) { |
| 1343 |
fTabGroup.initializeFrom(fOriginal); |
1247 |
fTabGroup.initializeFrom(fOriginal); |
| 1344 |
fWorkingCopy = fOriginal.getWorkingCopy(); |
1248 |
fWorkingCopy = fOriginal.getWorkingCopy(); |
| 1345 |
refresh(); |
|
|
| 1346 |
refreshStatus(); |
1249 |
refreshStatus(); |
| 1347 |
} |
1250 |
} |
| 1348 |
} |
1251 |
} |
|
Lines 1366-1376
Link Here
|
| 1366 |
*/ |
1269 |
*/ |
| 1367 |
public void setActiveTab(ILaunchConfigurationTab tab) { |
1270 |
public void setActiveTab(ILaunchConfigurationTab tab) { |
| 1368 |
ILaunchConfigurationTab[] tabs = getTabs(); |
1271 |
ILaunchConfigurationTab[] tabs = getTabs(); |
| 1369 |
for (int i = 0; i < tabs.length; i++) { |
1272 |
if(tabs != null) { |
| 1370 |
ILaunchConfigurationTab configurationTab = tabs[i]; |
1273 |
for (int i = 0; i < tabs.length; i++) { |
| 1371 |
if (configurationTab.equals(tab)) { |
1274 |
if (tabs[i].getClass().equals(tab.getClass())) { |
| 1372 |
setActiveTab(i); |
1275 |
setActiveTab(i); |
| 1373 |
return; |
1276 |
return; |
|
|
1277 |
} |
| 1374 |
} |
1278 |
} |
| 1375 |
} |
1279 |
} |
| 1376 |
} |
1280 |
} |