eclipse plugin: Add a button for opening the Addon...
...Upload preferences page from within the Addons view
This commit is contained in:
parent
8ba72f62e2
commit
4433ec4111
2 changed files with 14 additions and 1 deletions
|
@ -22,6 +22,8 @@ import org.wesnoth.jface.RegexStringFieldEditor;
|
|||
|
||||
public class AddonUploadPreferencePage extends AbstractPreferencePage
|
||||
{
|
||||
public final static String ID_ADDON_PREFERENCE_PAGE = "org.wesnoth.preferences.AddonPage"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Holds the ports for each addon server as a (key, value) pair,
|
||||
* where:
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Menu;
|
|||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.ui.dialogs.PreferencesUtil;
|
||||
import org.eclipse.ui.part.ViewPart;
|
||||
import org.wesnoth.preferences.AddonUploadPreferencePage;
|
||||
import org.wesnoth.preferences.Preferences;
|
||||
|
@ -125,7 +126,17 @@ public class AddonsView extends ViewPart
|
|||
}
|
||||
});
|
||||
btnRefresh.setText("Refresh");
|
||||
new Label(grpOptions, SWT.NONE);
|
||||
|
||||
Button btnOpenAddonManager = new Button(grpOptions, SWT.NONE);
|
||||
btnOpenAddonManager.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
PreferencesUtil.createPreferenceDialogOn( getViewSite( ).getShell( ),
|
||||
AddonUploadPreferencePage.ID_ADDON_PREFERENCE_PAGE,
|
||||
null, null ).open( );
|
||||
}
|
||||
});
|
||||
btnOpenAddonManager.setText("Open Addon Manager preferences");
|
||||
|
||||
cmbAddonServer_.addSelectionListener( new SelectionAdapter( ) {
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue