Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[562040] Provide support for donation from within the IDE
- Loading branch information
Showing
12 changed files
with
269 additions
and
9 deletions.
There are no files selected for viewing
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
65 changes: 65 additions & 0 deletions
65
...e.oomph.setup.editor/src/org/eclipse/oomph/setup/presentation/handlers/DonateHandler.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2020 Ed Merks (Berlin, Germany) and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Ed Merks - initial API and implementation | ||
*/ | ||
package org.eclipse.oomph.setup.presentation.handlers; | ||
|
||
import org.eclipse.oomph.setup.presentation.SetupEditorPlugin; | ||
import org.eclipse.oomph.setup.ui.SetupPropertyTester; | ||
import org.eclipse.oomph.util.PropertiesUtil; | ||
|
||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
import org.eclipse.core.runtime.IStatus; | ||
import org.eclipse.ui.PlatformUI; | ||
import org.eclipse.ui.browser.IWebBrowser; | ||
import org.eclipse.ui.browser.IWorkbenchBrowserSupport; | ||
|
||
import javax.net.ssl.SSLEngineResult.Status; | ||
|
||
import java.net.URL; | ||
|
||
/** | ||
* @author Ed Merks | ||
*/ | ||
public class DonateHandler extends AbstractHandler | ||
{ | ||
public DonateHandler() | ||
{ | ||
} | ||
|
||
public Object execute(ExecutionEvent event) throws ExecutionException | ||
{ | ||
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport(); | ||
try | ||
{ | ||
String donating = SetupPropertyTester.getDonating(); | ||
int style = IWorkbenchBrowserSupport.AS_EDITOR; | ||
if ("true".equals(PropertiesUtil.getProperty("org.eclipse.oomph.setup.dontate.navigation", "false"))) | ||
{ | ||
style |= IWorkbenchBrowserSupport.NAVIGATION_BAR; | ||
} | ||
|
||
if ("true".equals(PropertiesUtil.getProperty("org.eclipse.oomph.setup.dontate.location", "false"))) | ||
{ | ||
style |= IWorkbenchBrowserSupport.LOCATION_BAR; | ||
} | ||
|
||
IWebBrowser browser = browserSupport.createBrowser(style, "donate", SetupEditorPlugin.INSTANCE.getString("_UI_Donate_label"), donating); | ||
browser.openURL(new URL(donating)); | ||
} | ||
catch (Exception ex) | ||
{ | ||
SetupEditorPlugin.INSTANCE.log(ex, IStatus.WARNING); | ||
} | ||
|
||
return Status.OK; | ||
} | ||
} |
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
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
Oops, something went wrong.