mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-16 20:55:44 +02:00
Bug 547916 - Manage the size of the New Launch Config Wizard Dialog.
Replicates the size management code of the regular launch config dialog and sets the default size to be 800x720. Change-Id: I00e5028383e3a04e8b81d3adfa8487f9fb7fbcaf
This commit is contained in:
parent
890bca3466
commit
65fdbea4c0
3 changed files with 69 additions and 2 deletions
|
@ -28,6 +28,7 @@ import org.eclipse.launchbar.core.ILaunchDescriptor;
|
||||||
import org.eclipse.launchbar.ui.DefaultDescriptorLabelProvider;
|
import org.eclipse.launchbar.ui.DefaultDescriptorLabelProvider;
|
||||||
import org.eclipse.launchbar.ui.ILaunchBarUIManager;
|
import org.eclipse.launchbar.ui.ILaunchBarUIManager;
|
||||||
import org.eclipse.launchbar.ui.NewLaunchConfigWizard;
|
import org.eclipse.launchbar.ui.NewLaunchConfigWizard;
|
||||||
|
import org.eclipse.launchbar.ui.NewLaunchConfigWizardDialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.MouseAdapter;
|
import org.eclipse.swt.events.MouseAdapter;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
|
@ -174,7 +175,7 @@ public class ConfigSelector extends CSelector {
|
||||||
@Override
|
@Override
|
||||||
public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
|
public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
|
||||||
final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard();
|
final NewLaunchConfigWizard wizard = new NewLaunchConfigWizard();
|
||||||
WizardDialog dialog = new WizardDialog(getShell(), wizard);
|
WizardDialog dialog = new NewLaunchConfigWizardDialog(getShell(), wizard);
|
||||||
if (dialog.open() == Window.OK) {
|
if (dialog.open() == Window.OK) {
|
||||||
new Job(Messages.ConfigSelector_3) {
|
new Job(Messages.ConfigSelector_3) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2014, 2018 QNX Software Systems 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
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: EPL-2.0
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.launchbar.ui;
|
||||||
|
|
||||||
|
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||||
|
import org.eclipse.jface.wizard.IWizard;
|
||||||
|
import org.eclipse.jface.wizard.WizardDialog;
|
||||||
|
import org.eclipse.launchbar.ui.internal.Activator;
|
||||||
|
import org.eclipse.swt.graphics.Point;
|
||||||
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wizard Dialog for Launch Bar's new Launch Configuration Wizard.
|
||||||
|
*
|
||||||
|
* @since 2.3
|
||||||
|
*/
|
||||||
|
public class NewLaunchConfigWizardDialog extends WizardDialog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size of this dialog if there is no preference specifying a size.
|
||||||
|
*/
|
||||||
|
protected static final Point DEFAULT_INITIAL_DIALOG_SIZE = new Point(800, 720);
|
||||||
|
|
||||||
|
public NewLaunchConfigWizardDialog(Shell parentShell, IWizard newWizard) {
|
||||||
|
super(parentShell, newWizard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the section that this dialog stores its settings in
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
protected String getDialogSettingsSectionName() {
|
||||||
|
return Activator.PLUGIN_ID + ".LAUNCH_CONFIGURATIONS_DIALOG_SECTION"; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected IDialogSettings getDialogBoundsSettings() {
|
||||||
|
IDialogSettings settings = Activator.getDefault().getDialogSettings();
|
||||||
|
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
|
||||||
|
if (section == null) {
|
||||||
|
section = settings.addNewSection(getDialogSettingsSectionName());
|
||||||
|
}
|
||||||
|
return section;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Point getInitialSize() {
|
||||||
|
try {
|
||||||
|
// Check if we've saved the height before
|
||||||
|
getDialogBoundsSettings().getInt("DIALOG_HEIGHT"); //$NON-NLS-1$
|
||||||
|
return super.getInitialSize();
|
||||||
|
} catch(NumberFormatException nfe) {
|
||||||
|
// Nope, return the default size
|
||||||
|
return DEFAULT_INITIAL_DIALOG_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue