?? deviceselectdialog.java
字號:
/**
* Copyright (c) 2003-2006 Craig Setera
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*/
package eclipseme.ui.internal.dialog;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import eclipseme.core.model.device.IDevice;
import eclipseme.ui.devices.DeviceSelector;
/**
* A dialog implementation for use in selecting a device
* from the registry.
* <p />
* Copyright (c) 2003-2006 Craig Setera<br>
* All Rights Reserved.<br>
* Licensed under the Eclipse Public License - v 1.0<p/>
* <br>
* $Revision: 1.1 $
* <br>
* $Date: 2006/02/13 01:16:48 $
* <br>
* @author Craig Setera
*/
public class DeviceSelectDialog extends Dialog {
private DeviceSelector deviceSelector;
private IDevice selectedDevice;
/**
* Construct a dialog
*
* @param parentShell
*/
public DeviceSelectDialog(Shell parentShell) {
super(parentShell);
}
/**
* Construct a dialog
*
* @param parentShell
*/
public DeviceSelectDialog(IShellProvider parentShell) {
super(parentShell);
}
/**
* Return the device selected by the user.
*
* @return
*/
public IDevice getSelectedDevice() {
return selectedDevice;
}
/**
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
selectedDevice = deviceSelector.getSelectedDevice();
}
super.buttonPressed(buttonId);
}
/**
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Select Device for Project");
}
/**
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
deviceSelector = new DeviceSelector();
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, true));
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
deviceSelector.createContents(parent, false);
return composite;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -