This repository has been archived by the owner on Apr 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6c38a9
commit 8fbd0b9
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
plugin_ide.ui/src-lang/melnorme/lang/ide/ui/preferences/AbstractToolLocationGroup.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,65 @@ | |||
/******************************************************************************* | |||
* Copyright (c) 2016 Bruno Medeiros and other Contributors. | |||
* 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 | |||
* | |||
* Contributors: | |||
* Bruno Medeiros - initial API and implementation | |||
*******************************************************************************/ | |||
package melnorme.lang.ide.ui.preferences; | |||
|
|||
|
|||
import org.eclipse.jface.layout.GridLayoutFactory; | |||
import org.eclipse.swt.widgets.Composite; | |||
|
|||
import melnorme.lang.ide.ui.preferences.pages.DownloadToolTextField; | |||
import melnorme.lang.ide.ui.utils.operations.BasicUIOperation; | |||
import melnorme.util.swt.SWTFactoryUtil; | |||
import melnorme.util.swt.components.AbstractCompositeWidget; | |||
import melnorme.util.swt.components.IDisableableWidget; | |||
import melnorme.util.swt.components.fields.ButtonTextField; | |||
import melnorme.utilbox.collections.ArrayList2; | |||
import melnorme.utilbox.collections.Indexable; | |||
|
|||
public abstract class AbstractToolLocationGroup extends AbstractCompositeWidget { | |||
|
|||
public final ButtonTextField toolLocationField = new DownloadToolTextField("Executable:", "Download...") { | |||
@Override | |||
public BasicUIOperation getDownloadButtonHandler() { | |||
return do_getDownloadButtonHandler(this); | |||
} | |||
}; | |||
|
|||
public final String toolName; | |||
protected final ArrayList2<IDisableableWidget> subwidgets = new ArrayList2<IDisableableWidget>(); | |||
|
|||
public AbstractToolLocationGroup(String toolName) { | |||
this.toolName = toolName; | |||
this.subwidgets.add(toolLocationField); | |||
} | |||
|
|||
@Override | |||
protected Composite doCreateTopLevelControl(Composite parent) { | |||
return SWTFactoryUtil.createGroup(parent, toolName + ": "); | |||
} | |||
|
|||
@Override | |||
protected GridLayoutFactory createTopLevelLayout() { | |||
return GridLayoutFactory.swtDefaults().numColumns(getPreferredLayoutColumns()); | |||
} | |||
|
|||
@Override | |||
public int getPreferredLayoutColumns() { | |||
return 4; | |||
} | |||
|
|||
@Override | |||
protected Indexable<IDisableableWidget> getSubWidgets() { | |||
return subwidgets; | |||
} | |||
|
|||
protected abstract BasicUIOperation do_getDownloadButtonHandler(DownloadToolTextField downloadToolTextField); | |||
|
|||
} |
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