Search in sources :

Example 1 with CreateLinkedResourceGroup

use of org.eclipse.ui.internal.ide.dialogs.CreateLinkedResourceGroup in project translationstudio8 by heartsome.

the class NewFolderDialogOfHs method createAdvancedControls.

/**
		 * Creates the widget for advanced options.
		 *  
		 * @param parent the parent composite
		 */
protected void createAdvancedControls(Composite parent) {
    Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
    if (preferences.getBoolean(ResourcesPlugin.PREF_DISABLE_LINKING) == false && isValidContainer()) {
        linkedResourceParent = new Composite(parent, SWT.NONE);
        linkedResourceParent.setFont(parent.getFont());
        linkedResourceParent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        GridLayout layout = new GridLayout();
        layout.marginHeight = 0;
        layout.marginWidth = 0;
        linkedResourceParent.setLayout(layout);
        advancedButton = new Button(linkedResourceParent, SWT.PUSH);
        advancedButton.setFont(linkedResourceParent.getFont());
        advancedButton.setText(IDEWorkbenchMessages.showAdvanced);
        setButtonLayoutData(advancedButton);
        GridData data = (GridData) advancedButton.getLayoutData();
        data.horizontalAlignment = GridData.BEGINNING;
        advancedButton.setLayoutData(data);
        advancedButton.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent e) {
                handleAdvancedButtonSelect();
            }
        });
    }
    linkedResourceGroup = new CreateLinkedResourceGroup(IResource.FOLDER, new Listener() {

        public void handleEvent(Event e) {
            validateLinkedResource();
            firstLinkCheck = false;
        }
    }, new CreateLinkedResourceGroup.IStringValue() {

        public void setValue(String string) {
            folderNameField.setText(string);
        }

        public String getValue() {
            return folderNameField.getText();
        }

        public IResource getResource() {
            return container;
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) CreateLinkedResourceGroup(org.eclipse.ui.internal.ide.dialogs.CreateLinkedResourceGroup) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Preferences(org.eclipse.core.runtime.Preferences)

Aggregations

Preferences (org.eclipse.core.runtime.Preferences)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)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 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1 CreateLinkedResourceGroup (org.eclipse.ui.internal.ide.dialogs.CreateLinkedResourceGroup)1