/** * Calls {@link #isValid(boolean)} with <code>false</code>. */ public boolean isValid() { return isValid(false); }
/** * Checks whether the platform has a valid Rake installed. * * @param warn whether to show warning message to the user if ther is no * valid Rake installed */ public boolean hasValidRake(boolean warn) { boolean valid = isValid(warn) && hasRubyGemsInstalled(warn); String rakePath = getRake(); valid = (rakePath != null) && new File(rakePath).exists(); possiblyNotifyUser(warn, valid, "rake"); // NOI18N return valid; }
/** * If the platform is in invalid state, shows general message to the user. * * @return whether the platform is valid */ public boolean showWarningIfInvalid() { boolean valid = isValid(); if (!valid) { Util.notifyLocalized(RubyPlatform.class, "RubyPlatform.InvalidInterpreter", // NOI18N NotifyDescriptor.WARNING_MESSAGE, getInterpreter()); } return valid; }
public ClassPath findClassPath(FileObject file, String type) { if (type.equals(RubyLanguage.BOOT)) { // See if the file is under the Ruby libraries for (RubyPlatform platform : RubyPlatformManager.getPlatforms()) { if (!platform.isValid()) { continue; } FileObject systemRoot = platform.getSystemRoot(file); if (systemRoot != null) { return getRubyClassPaths(file, type, systemRoot); } } } return null; }
if (!platform.isValid(false)) { return new RailsInstallationInfo(null, false,
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { // #93658: GTK needs name to render cell renderer "natively" setName("ComboBox.listRenderer"); // NOI18N if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } String label; if (value instanceof String) { label = (String) value; } else { RubyPlatform plaf = ((RubyPlatform) value); if (plaf == null || !plaf.isValid()) { label = plaf != null ? plaf.getLabel() : NbBundle.getMessage(PlatformComponentFactory.class, "PlatformComponentFactory.invalid.platform"); setForeground(INVALID_PLAF_COLOR); } else { label = plaf.getLabel(); } } setText(label); return this; }
if (paltformsAreBeingLoaded || platform == null || !platform.isValid() || !platform.hasRubyGemsInstalled()) { if (!paltformsAreBeingLoaded) { gemHomeValue.setForeground(PlatformComponentFactory.INVALID_PLAF_COLOR);
if (!platform.isValid(warn)) { return;
if (!platform.isValid(warn)) { return;
boolean valid (WizardDescriptor settings) { if (!platform().isValid(false)) { wizardDescriptor.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(RailsInstallationPanel.class, "NoRuby")); return false; } RailsInstallationInfo railsInfo = RailsInstallationValidator.getRailsInstallation(platform()); // Make sure we have Rails (and possibly openssl as well) if (!railsInfo.isValid()) { wizardDescriptor.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE, railsInfo.getMessage()); //NOI18N return false; } if ((Boolean) wizardDescriptor.getProperty(NewRailsProjectWizardIterator.WAR_SUPPORT) && !isWarblerInstalled()) { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(RailsInstallationPanel.class, "MSG_NoWarbler")); //NOI18N return false; } RubyInstance server = (RubyInstance) wizardDescriptor.getProperty(NewRailsProjectWizardIterator.SERVER_INSTANCE); if (!RailsServerUiUtils.isValidServer(server)) { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(RailsInstallationPanel.class, "MSG_NoGfGem")); //NOI18N return false; } wizardDescriptor.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE,""); //NOI18N return true; }