protected IProduct getProduct() { if (product == null) product = Platform.getProduct(); return product; }
private void initValues() { if (initialized) return; initialized = true; IProduct product = Platform.getProduct(); if (product == null) { if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("Product not available to set product default preference overrides."); //$NON-NLS-1$ return; } productID = product.getId(); if (productID == null) { if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("Product ID not available to apply product-level preference defaults."); //$NON-NLS-1$ return; } customizationBundle = product.getDefiningBundle(); if (customizationBundle == null) { if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("Bundle not available to apply product-level preference defaults for product id: " + productID); //$NON-NLS-1$ return; } customizationValue = product.getProperty(PRODUCT_KEY); if (customizationValue == null) { if (InternalPlatform.DEBUG_PLUGIN_PREFERENCES) InternalPlatform.message("Product : " + productID + " does not define preference customization file. Using legacy file: plugin_customization.ini"); //$NON-NLS-1$//$NON-NLS-2$ customizationValue = LEGACY_PRODUCT_CUSTOMIZATION_FILENAME; } }
@Override public boolean canEnableSimilarDeclarationUpdating() { IProduct product= Platform.getProduct(); if (product != null) { String property= product.getProperty("org.eclipse.jdt.ui.refactoring.handlesSimilarDeclarations"); //$NON-NLS-1$ if ("false".equalsIgnoreCase(property)) //$NON-NLS-1$ return false; } return true; }
public InputStream getHelpDataFile(String filePath) throws IOException { IProduct product = Platform.getProduct(); Bundle definingBundle = product != null ? product.getDefiningBundle() : null; URL entry = definingBundle != null ? definingBundle.getEntry(filePath) : null; if(entry == null) { throw new IOException("No entry to '"+filePath+"' could be found or caller does not have the appropriate permissions.");//$NON-NLS-1$ //$NON-NLS-2$ } return entry.openStream(); }
@Override public boolean canEnableSimilarDeclarationUpdating() { IProduct product= Platform.getProduct(); if (product != null) { String property= product.getProperty("org.eclipse.jdt.ui.refactoring.handlesSimilarDeclarations"); //$NON-NLS-1$ if ("false".equalsIgnoreCase(property)) //$NON-NLS-1$ return false; } return true; }
public boolean canEnableSimilarDeclarationUpdating() { IProduct product= Platform.getProduct(); if (product != null) { String property= product.getProperty("org.eclipse.jdt.ui.refactoring.handlesSimilarDeclarations"); //$NON-NLS-1$ if ("false".equalsIgnoreCase(property)) //$NON-NLS-1$ return false; } return true; }
@Override public boolean canEnableSimilarDeclarationUpdating() { IProduct product = Platform.getProduct(); if (product != null) { String property = product.getProperty("org.eclipse.jdt.ui.refactoring.handlesSimilarDeclarations"); //$NON-NLS-1$ if ("false".equalsIgnoreCase(property)) { return false; } } return true; }
private boolean filterByProduct(String productId) { IProduct product = Platform.getProduct(); if (product != null) { return !productId.equals(product.getId()); } return true; }
/** * Returns an instance that describes this plugin's product (formerly "primary * plugin"). * @return ProductInfo the product info for the receiver */ private ProductInfo getProductInfo() { if (productInfo == null) { productInfo = new ProductInfo(Platform.getProduct()); } return productInfo; }
public static String getProperty(String propertyName) { String property = Platform.getProduct().getProperty(propertyName); if (property == null) { property = System.getProperty(propertyName); } return property; }
private String getProductPlugin() { IProduct product = Platform.getProduct(); if (product != null) { Bundle plugin = product.getDefiningBundle(); if (plugin != null) { return plugin.getSymbolicName(); } } return PLATFORM_PLUGIN; } }
public static Dictionary<Object, Object> createEnvironment() { Dictionary<Object, Object> environment = new Hashtable<Object, Object>(System.getProperties()); // add the installed Mylyn version to the environment so that we can // have // connectors that are filtered based on version of Mylyn IProduct product = Platform.getProduct(); if (product != null) { environment.put("org.eclipse.product.id", product.getId()); //$NON-NLS-1$ } return environment; }
private String getProductPlugin() { IProduct product = Platform.getProduct(); if (product != null) { Bundle plugin = product.getDefiningBundle(); if (plugin != null) { return plugin.getSymbolicName(); } } return PLATFORM_PLUGIN; } }
/** * Returns the title that the dialog (or splash) should have. * * @return the window title * @since 3.4 */ public static String getWindowTitle() { String productName = null; IProduct product = Platform.getProduct(); if (product != null) { productName = product.getName(); } if (productName == null) { productName = IDEWorkbenchMessages.ChooseWorkspaceDialog_defaultProductName; } return productName; }
private void load() { IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.help.base.activitySupport");//$NON-NLS-1$ if (elements.length==1 && elements[0].getName().equals("support")) //$NON-NLS-1$ config = elements[0]; else if (elements.length>0) { IProduct product = Platform.getProduct(); if (product==null) return; String productId = product.getId(); for (int i=0; i<elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getAttribute("productId").equals(productId)) { //$NON-NLS-1$ config = element; break; } } } } private IConfigurationElement getChild(String name) {
@Override protected void configureShell(Shell newShell) { super.configureShell(newShell); String productName = ""; //$NON-NLS-1$ IProduct product = Platform.getProduct(); if (product != null && product.getName() != null) productName = product.getName(); newShell.setText(NLS.bind( WorkbenchMessages.InstallationDialog_ShellTitle, productName)); }
public ImportFromInstallationPage_c(ProvisioningUI ui, ProvisioningOperationWizard wizard, boolean firstTime) { super("importfrominstancepage", ui, wizard); //$NON-NLS-1$ setTitle(firstTime ? ProvUIMessages.ImportFromInstallationPage_DIALOG_TITLE_FIRSTRUN : ProvUIMessages.ImportFromInstallationPage_DIALOG_TITLE); setDescription(NLS.bind(ProvUIMessages.ImportFromInstallationPage_DIALOG_DESCRIPTION, Platform.getProduct().getName())); }
public ImportFromInstallationPage_c(ProvisioningUI ui, ImportFromInstallationWizard_c wizard, IProfile toImportFrom, boolean firstTime) { super("importfrominstancepage", ui, wizard); //$NON-NLS-1$ setTitle(firstTime ? ProvUIMessages.ImportFromInstallationPage_DIALOG_TITLE_FIRSTRUN : ProvUIMessages.ImportFromInstallationPage_DIALOG_TITLE); setDescription(NLS.bind(firstTime ? ProvUIMessages.ImportFromInstallationPage_DIALOG_DESCRIPTION_FIRSTRUN : ProvUIMessages.ImportFromInstallationPage_DIALOG_DESCRIPTION, Platform.getProduct().getName())); toBeImportedProfile = toImportFrom; }
/** * Prompt the user for restart or apply profile changes. * * @param parent the parent shell of the dialog, or <code>null</code> if none * @param mustRestart indicates whether the user must restart to get the * changes. If <code>false</code>, then the user may choose to apply * the changes to the running profile rather than restarting. * @return one of PROFILE_IGNORE (do nothing), PROFILE_APPLYCHANGES * (attempt to apply the changes), or PROFILE_RESTART (restart the system). */ public static int promptForRestart(Shell parent, boolean mustRestart) { String title = ProvUIMessages.PlatformUpdateTitle; IProduct product = Platform.getProduct(); String productName = product != null && product.getName() != null ? product.getName() : ProvUIMessages.ApplicationInRestartDialog; String message = NLS.bind(mustRestart ? ProvUIMessages.PlatformRestartMessage : ProvUIMessages.OptionalPlatformRestartMessage, productName); ApplyProfileChangesDialog dialog = new ApplyProfileChangesDialog(parent, title, message, mustRestart); if (dialog.open() == Window.CANCEL) return PROFILE_IGNORE; return dialog.returnCode; }
protected UpdateSingleIUPage(UpdateOperation operation, ProvisioningUI ui) { super("UpdateSingleIUPage", ui, null); //$NON-NLS-1$ setTitle(ProvUIMessages.UpdateAction_UpdatesAvailableTitle); IProduct product = Platform.getProduct(); String productName = product != null && product.getName() != null ? product.getName() : ProvUIMessages.ApplicationInRestartDialog; setDescription(NLS.bind(ProvUIMessages.UpdateSingleIUPage_SingleUpdateDescription, productName)); Assert.isNotNull(operation); Assert.isTrue(operation.hasResolved()); Assert.isTrue(operation.getSelectedUpdates().length == 1); Assert.isTrue(operation.getResolutionResult().isOK()); this.operation = operation; }