Java Code Examples for org.eclipse.core.runtime.IProduct#getName()

The following examples show how to use org.eclipse.core.runtime.IProduct#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DesignerWorkbenchWindowAdvisor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void preWindowOpen( )
{
	IWorkbenchWindowConfigurer configurer = getWindowConfigurer( );
	configurer.setShowCoolBar( true );
	configurer.setShowStatusLine( true );

	String title = null;
	IProduct product = Platform.getProduct( );
	if ( product != null )
	{
		title = product.getName( );
	}

	if ( title == null )
	{
		title = DesignerWorkbenchMessages.Workbench_title;
	}
	configurer.setTitle( title );
}
 
Example 2
Source File: ExitDialog.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
protected static String exitMessage() {
    String productName = null;
    final IProduct product = Platform.getProduct();
    if (product != null) {
        productName = product.getName();
    }
    String message = null;
    if (productName == null) {
        message = IDEWorkbenchMessages.PromptOnExitDialog_message0;
    } else {
        message = NLS.bind(
                IDEWorkbenchMessages.PromptOnExitDialog_message1,
                productName);
    }
    return message;
}
 
Example 3
Source File: EclipseUtil.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public static String getProductName()
{
	IProduct product = Platform.getProduct();
	if (product != null)
	{
		String name = product.getName();
		if (!StringUtil.isEmpty(name))
		{
			return name;
		}
	}
	return APTANA_STUDIO;
}
 
Example 4
Source File: SelfBaseHelpSystem.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains name of the Eclipse product
 * 
 * @return String
 */
public static String getProductName() {
	IProduct product = Platform.getProduct();
	if (product == null) {
		return ""; //$NON-NLS-1$
	}
	String name = product.getName();
	return name == null ? "" : name; //$NON-NLS-1$
}
 
Example 5
Source File: SelfBaseHelpSystem.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains name of the Eclipse product
 * 
 * @return String
 */
public static String getProductName() {
	IProduct product = Platform.getProduct();
	if (product == null) {
		return ""; //$NON-NLS-1$
	}
	String name = product.getName();
	return name == null ? "" : name; //$NON-NLS-1$
}
 
Example 6
Source File: SelfBaseHelpSystem.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains name of the Eclipse product
 * 
 * @return String
 */
public static String getProductName() {
	IProduct product = Platform.getProduct();
	if (product == null) {
		return ""; //$NON-NLS-1$
	}
	String name = product.getName();
	return name == null ? "" : name; //$NON-NLS-1$
}
 
Example 7
Source File: EmacsPlusPreferencePage.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Pop up a message dialog to request the restart of the workbench
 */
private void requestRestart(String rePreference) {

	String reMessage = EmacsPlusActivator.getString("EmacsPlusPref_RestartMessage");	//$NON-NLS-1$ 
	IProduct product = Platform.getProduct();
	String productName = product != null && product.getName() != null ? product.getName() : 
		EmacsPlusActivator.getString("EmacsPlusPref_DefaultProduct");	//$NON-NLS-1$ 

	final String msg = String.format(reMessage, productName,rePreference);
	final String reTitle = EmacsPlusActivator.getString("EmacsPlusPref_RestartTitle");	//$NON-NLS-1$ 
	
	PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
		public void run() {
			if (PlatformUI.getWorkbench().isClosing())
				return;
			// yes == 0, no == 1
			MessageDialog dialog = new MessageDialog(getDefaultShell(),reTitle,null,msg, MessageDialog.QUESTION ,
					new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL}, 0);
			if (dialog.open() != Window.CANCEL) {
				if (dialog.getReturnCode() == 0) {
					// restart workbench
					PlatformUI.getWorkbench().restart();
				}
			}
		}
	});
}