Search in sources :

Example 1 with SelectionType

use of org.eclipse.egit.ui.internal.components.RemoteSelectionCombo.SelectionType in project egit by eclipse.

the class RepositorySelectionPage method createRemotePanel.

private void createRemotePanel(final Composite parent) {
    remoteButton = new Button(parent, SWT.RADIO);
    remoteButton.setText(UIText.RepositorySelectionPage_configuredRemoteChoice + // $NON-NLS-1$
    ":");
    remoteButton.setSelection(true);
    remotePanel = new Composite(parent, SWT.NULL);
    remotePanel.setLayout(new GridLayout());
    final GridData gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    remotePanel.setLayoutData(gd);
    SelectionType selectionType = sourceSelection ? SelectionType.FETCH : SelectionType.PUSH;
    remoteCombo = new RemoteSelectionCombo(remotePanel, SWT.NULL, selectionType);
    remoteConfig = remoteCombo.setItems(configuredRemotes);
    remoteCombo.addRemoteSelectionListener(new IRemoteSelectionListener() {

        @Override
        public void remoteSelected(RemoteConfig rc) {
            remoteConfig = rc;
            checkPage();
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionType(org.eclipse.egit.ui.internal.components.RemoteSelectionCombo.SelectionType) IRemoteSelectionListener(org.eclipse.egit.ui.internal.components.RemoteSelectionCombo.IRemoteSelectionListener) GridData(org.eclipse.swt.layout.GridData) RemoteConfig(org.eclipse.jgit.transport.RemoteConfig)

Aggregations

IRemoteSelectionListener (org.eclipse.egit.ui.internal.components.RemoteSelectionCombo.IRemoteSelectionListener)1 SelectionType (org.eclipse.egit.ui.internal.components.RemoteSelectionCombo.SelectionType)1 RemoteConfig (org.eclipse.jgit.transport.RemoteConfig)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1