本文整理汇总了Java中org.netbeans.installer.product.Registry类的典型用法代码示例。如果您正苦于以下问题:Java Registry类的具体用法?Java Registry怎么用?Java Registry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Registry类属于org.netbeans.installer.product包,在下文中一共展示了Registry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
public void execute(CLIArgumentsList arguments) throws CLIOptionException {
File targetFile = new File(arguments.next()).getAbsoluteFile();
if (targetFile.exists()) {
throw new CLIOptionException(ResourceUtils.getString(
CreateBundleOption.class,
WARNING_BUNDLE_FILE_EXISTS_KEY,
CREATE_BUNDLE_ARG,
targetFile));
} else {
ExecutionMode.setCurrentExecutionMode(
ExecutionMode.CREATE_BUNDLE);
System.setProperty(
Registry.CREATE_BUNDLE_PATH_PROPERTY,
targetFile.getAbsolutePath());
}
}
示例2: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
@Override
public void execute(CLIArgumentsList arguments) throws CLIOptionException {
final String value = arguments.next();
final String existing = System.getProperty(
Registry.REMOTE_PRODUCT_REGISTRIES_PROPERTY);
if (existing == null) {
System.setProperty(
Registry.REMOTE_PRODUCT_REGISTRIES_PROPERTY,
value);
} else {
if (!Arrays.asList(
existing.split(StringUtils.LF)).contains(value)) {
System.setProperty(
Registry.REMOTE_PRODUCT_REGISTRIES_PROPERTY,
existing + StringUtils.LF + value);
}
}
}
示例3: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
@Override
public void execute(CLIArgumentsList arguments) throws CLIOptionException {
File stateFile = new File(arguments.next()).getAbsoluteFile();
if (!stateFile.exists()) {
throw new CLIOptionException(ResourceUtils.getString(
StateOption.class,
WARNING_MISSING_STATE_FILE_KEY,
STATE_ARG,
stateFile));
} else {
System.setProperty(
Registry.SOURCE_STATE_FILE_PATH_PROPERTY,
stateFile.getAbsolutePath());
}
}
示例4: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
@Override
public void execute(CLIArgumentsList arguments) throws CLIOptionException {
File stateFile = new File(arguments.next()).getAbsoluteFile();
if (stateFile.exists()) {
throw new CLIOptionException(ResourceUtils.getString(
RecordOption.class,
WARNING_TARGET_STATE_FILE_EXISTS_KEY,
RECORD_ARG,
stateFile));
} else {
System.setProperty(
Registry.TARGET_STATE_FILE_PATH_PROPERTY,
stateFile.getAbsolutePath());
}
}
示例5: fetchLocationsFromRegistry
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
private void fetchLocationsFromRegistry(final List<File> locations) {
for (Product jdk: Registry.getInstance().getProducts(JDK_PRODUCT_UID)) {
if (jdk.getStatus() == Status.INSTALLED) {
if (!locations.contains(jdk.getInstallationLocation())) {
locations.add(jdk.getInstallationLocation());
}
}
}
for (Product product: Registry.getInstance().getProducts(Status.TO_BE_INSTALLED)) {
final String jdkSysPropName = product.getUid() + StringUtils.DOT +
JdkLocationPanel.JDK_LOCATION_PROPERTY;
final String jdkSysProp = System.getProperty(jdkSysPropName);
if (jdkSysProp != null) {
File sprop = new File(jdkSysProp);
if (!locations.contains(sprop)) {
locations.add(sprop);
}
}
}
}
示例6: getJavaFromInstalledProductProperties
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
private File getJavaFromInstalledProductProperties() {
for (Product product : Registry.getInstance().queryProducts(new OrFilter(
new ProductFilter(Status.INSTALLED),
new ProductFilter(Status.TO_BE_INSTALLED)))) {
final String jdk = product.getProperty(JDK_LOCATION_PROPERTY);
if (jdk != null) {
final File jdkFile = new File(jdk);
if (jdkLocations.contains(jdkFile)) {
return jdkFile;
}
}
}
return null;
}
示例7: getVersion
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
private Version getVersion(File file) {
Version version = JavaUtils.getVersion(file);
if (version == null) {
for (Product jdk : Registry.getInstance().getProducts(JDK_PRODUCT_UID)) {
if ((jdk.getStatus() == Status.TO_BE_INSTALLED) && jdk.getInstallationLocation().equals(file)) {
version = jdk.getVersion();
}
}
for (Product jreNested : Registry.getInstance().getProducts(JRE_NESTED_PRODUCT_UID)) {
if ((jreNested.getStatus() == Status.TO_BE_INSTALLED) && jreNested.getInstallationLocation().equals(file)) {
version = jreNested.getVersion();
}
}
}
return version;
}
示例8: canExecuteForward
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
@Override
public boolean canExecuteForward() {
List <Product> products = Registry.getInstance().getProductsToInstall();
boolean doShowPanel = true;
if (products.size() > 0) {
doShowPanel = System.getProperty(OVERALL_LICENSE_RESOURCE_PROPERTY) != null;
if (!doShowPanel) {
for (Product p : products) {
if (p.isLogicDownloaded()) {
try {
if (p.getLogic().getLicense() != null) {
doShowPanel = true;
}
} catch (InitializationException e) {
}
} else {
doShowPanel = true;
}
}
}
}
return products.size() > 0 && doShowPanel;
}
示例9: executeForward
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
@Override
public void executeForward() {
final Registry registry = Registry.getInstance();
// remove all current children (if there are any), as the components
// selection has probably changed and we need to rebuild from scratch
getChildren().clear();
// we're creating a bundle - we only need to download and package things
addChild(preCreateBundleSummaryPanel);
addChild(downloadConfigurationLogicAction);
addChild(downloadInstallationDataAction);
addChild(createBundleAction);
if (registry.getTargetPlatform().isCompatibleWith(Platform.MACOSX)) {
addChild(createAppLauncherAction);
} else {
addChild(createNativeLauncherAction);
}
addChild(postCreateBundleSummaryPanel);
super.executeForward();
}
示例10: initializeRegistry
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
private File initializeRegistry(String name) throws ManagerException {
File directory = new File(REGISTRIES, name);
File registryxml = new File(directory, REGISTRY_XML);
directory.mkdirs();
if (!registryxml.exists()) {
try {
Document document = Registry.
getInstance().getEmptyRegistryDocument();
XMLUtils.saveXMLDocument(document, registryxml);
} catch (XMLException e) {
e.printStackTrace();
throw new ManagerException("Cannot initialize registry", e);
}
}
return directory;
}
示例11: loadRegistry
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
private Registry loadRegistry(
final File root,
final File tempUserDir,
final Platform platform) throws ManagerException {
try {
final File registryXml =
new File(root, REGISTRY_XML);
final Registry registry = new Registry();
registry.setLocalDirectory(tempUserDir);
registry.setFinishHandler(DummyFinishHandler.INSTANCE);
registry.setTargetPlatform(platform);
registry.loadProductRegistry(registryXml);
return registry;
} catch (InitializationException e) {
throw new ManagerException(e);
}
}
示例12: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
public void execute(CLIArgumentsList arguments) throws CLIOptionException {
final String uid = arguments.next();
final String version = arguments.next();
System.setProperty(Registry.TARGET_COMPONENT_UID_PROPERTY, uid);
System.setProperty(Registry.TARGET_COMPONENT_VERSION_PROPERTY, version);
LogManager.log(
"target component:"); // NOI18N
LogManager.log(
"... uid: " + uid); // NOI18N
LogManager.log(
"... version: " + version); // NOI18N
}
示例13: getInstallationLocation
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
/**
* Returns installation location
*
* @return installation location
*/
private static File getInstallationLocation() {
if (installationLocation == null) {
String target = System.getProperty(Registry.TARGET_COMPONENT_UID_PROPERTY);
Registry registry = Registry.getInstance();
for (Product product : registry.getProductsToUninstall()) {
if (product.getUid().equals(target)) {
installationLocation = product.getInstallationLocation();
}
}
}
return installationLocation;
}
示例14: InstallationDetailsTreeModel
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
public InstallationDetailsTreeModel() {
final Registry registry = Registry.getInstance();
components.addAll(registry.getProducts(DetailedStatus.INSTALLED_SUCCESSFULLY));
components.addAll(registry.getProducts(DetailedStatus.INSTALLED_WITH_WARNINGS));
components.addAll(registry.getProducts(DetailedStatus.FAILED_TO_INSTALL));
components.addAll(registry.getProducts(DetailedStatus.UNINSTALLED_SUCCESSFULLY));
components.addAll(registry.getProducts(DetailedStatus.UNINSTALLED_WITH_WARNINGS));
components.addAll(registry.getProducts(DetailedStatus.FAILED_TO_UNINSTALL));
}
示例15: execute
import org.netbeans.installer.product.Registry; //导入依赖的package包/类
public void execute() {
try {
final Progress progress = new Progress();
getWizardUi().setProgress(progress);
Registry.getInstance().initializeRegistry(progress);
} catch (InitializationException e) {
ErrorManager.notifyError(
StringUtils.format(
getProperty(REGISTRY_INITIALIZATION_FAILED_PROPERTY)), e);
}
}