-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds capability to display warnings in LaunchBar Launch Config Dialog (…
…#879) Add SWTBot to test that the Launch Configuration, when opened via the Launch Bar, displays a warning in the message area. The Launch Bar Launch Configuration is, confusingly, handled by 2 different classes depending on whether a new configuration is being created (NewLaunchConfigEditPage) or edited (LaunchBarLaunchConfigDialog). When using NewLaunchConfigEditPage, the existing LaunchConfigurationTabGroupViewer.getWarningMessage() mechanism is used. This was added to eclipse-platform in Bug 386673 (commit 231ef13). When using LaunchBarLaunchConfigDialog (when editing), the new getWarningMessage() mechanism, copied from the existing, is used. In both classes above, logic was added to update the message when a tab change occurs.
- Loading branch information
1 parent
3ee0e61
commit efbba15
Showing
6 changed files
with
217 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...aunchbar.ui.tests/src/org/eclipse/launchbar/ui/tests/internal/WarningLaunchConfigTab.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Renesas Electronics Europe and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*******************************************************************************/ | ||
package org.eclipse.launchbar.ui.tests.internal; | ||
|
||
import org.eclipse.debug.core.ILaunchConfiguration; | ||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; | ||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.layout.RowLayout; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Label; | ||
|
||
/** | ||
* Creates a tab to test that the Launch Configuration, when opened via the Launch Bar, | ||
* displays a warning in the message area. | ||
* @see {@link CreateLaunchConfigTests} | ||
*/ | ||
public class WarningLaunchConfigTab extends AbstractLaunchConfigurationTab { | ||
public static final String WARNING_MESSAGE = "This is a warning"; | ||
public static final String TAB_NAME = "Warning Tab"; | ||
|
||
@Override | ||
public void createControl(Composite parent) { | ||
parent.setLayout(new RowLayout()); | ||
Label label = new Label(parent, SWT.NONE); | ||
label.setText("The Launch Configuration message area should show a warning message!"); | ||
setControl(label); | ||
} | ||
|
||
@Override | ||
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { | ||
} | ||
|
||
@Override | ||
public void initializeFrom(ILaunchConfiguration configuration) { | ||
} | ||
|
||
@Override | ||
public void performApply(ILaunchConfigurationWorkingCopy configuration) { | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return TAB_NAME; | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return "org.eclipse.launchbar.ui.tests.internal.WarningLaunchConfigTab"; | ||
} | ||
|
||
@Override | ||
public boolean isValid(ILaunchConfiguration launchConfig) { | ||
setWarningMessage(WARNING_MESSAGE); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters