本文整理汇总了Java中org.netbeans.api.progress.aggregate.ProgressContributor类的典型用法代码示例。如果您正苦于以下问题:Java ProgressContributor类的具体用法?Java ProgressContributor怎么用?Java ProgressContributor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressContributor类属于org.netbeans.api.progress.aggregate包,在下文中一共展示了ProgressContributor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateBeans
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void generateBeans(final ProgressPanel progressPanel,
final RelatedCMPHelper helper,
final FileObject dbSchemaFile,
final ProgressContributor handle) throws IOException {
//as it's "public" and may be called from outside, need to check target package exist and create if necessary, see #220073
if(helper.getLocation() != null && helper.getPackageName() != null) {
SourceGroups.getFolderForPackage( helper.getLocation(), helper.getPackageName());
}
//
generateBeans(helper.getBeans(), helper.isGenerateFinderMethods(),
helper.isGenerateJAXBAnnotations(),
helper.isGenerateValidationConstraints(),
helper.isFullyQualifiedTableNames(), helper.isRegenTablesAttrs(),
helper.isUseDefaults(),
helper.isGenerateMappedSuperclasses(),
helper.getFetchType(), helper.getCollectionType(),
handle, progressPanel, helper.getProject());
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:JavaPersistenceGenerator.java
示例2: downloadArchetype
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Messages("Handle_Download=Downloading Archetype")
private Artifact downloadArchetype(Archetype arch) throws ArtifactResolutionException, ArtifactNotFoundException {
AggregateProgressHandle hndl = AggregateProgressFactory.createHandle(Handle_Download(),
new ProgressContributor[] {
AggregateProgressFactory.createProgressContributor("zaloha") }, //NOI18N
ProgressTransferListener.cancellable(), null);
synchronized (HANDLE_LOCK) {
handle = hndl;
}
try {
arch.resolveArtifacts(hndl);
} finally {
synchronized (HANDLE_LOCK) {//prevent store()/read() methods to call finish - issue 236251
if (hndl == handle) {
handle = null;
}
}
}
//#154913
RepositoryIndexer.updateIndexWithArtifacts(RepositoryPreferences.getInstance().getLocalRepository(), Collections.singletonList(arch.getArtifact()));
return arch.getArtifact();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:BasicPanelVisual.java
示例3: transferStarted
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void transferStarted(TransferEvent te) throws TransferCancelledException {
ProgressContributor c = contrib;
if (c == null || handle == null) {
return;
}
TransferResource res = te.getResource();
int total = (int)Math.min((long)Integer.MAX_VALUE, res.getContentLength());
if (total < 0) {
c.start(0);
} else {
c.start(total);
}
length = total;
c.progress(TXT_Started(getResourceName(res)));
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ProgressTransferListener.java
示例4: transferProgressed
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Messages({
"# {0} - transferring resource name",
"TXT_Transferring={0} - Transferring...",
"# {0} - transferring resource name",
"# {1} - transferred amount",
"TXT_Transferred={0} - Transferred {1}"
})
@Override
public void transferProgressed(TransferEvent te) throws TransferCancelledException {
checkCancel();
ProgressContributor c = contrib;
if (c == null) {
return;
}
long cnt = te.getTransferredBytes();
cnt = Math.min((long)Integer.MAX_VALUE, cnt);
if (length < 0) {
c.progress(TXT_Transferring(getResourceName(te.getResource())));
} else {
cnt = Math.min(cnt, (long)length);
c.progress(TXT_Transferred(getResourceName(te.getResource()), cnt), (int)cnt);
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ProgressTransferListener.java
示例5: retrieveAsposeMavenDependencies
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
public boolean retrieveAsposeMavenDependencies(ProgressContributor p) {
try {
AsposeMavenDependenciesManager.getAsposeProjectMavenDependencies().clear();
p.progress(1);
byte i = 2;
for (AsposeJavaAPI component : AsposeMavenProject.getApiList().values()) {
if (component.is_selected()) {
StatusDisplayer.getDefault().setStatusText("Retrieving " + component.get_name() + " Maven Artifact...");
Metadata productMavenDependency = getProductMavenDependency(component.get_mavenRepositoryURL());
if (productMavenDependency != null) {
AsposeMavenDependenciesManager.getAsposeProjectMavenDependencies().add(productMavenDependency);
}
p.progress(i++);
}
}
} catch (Exception rex) {
AsposeMavenDependenciesManager.getAsposeProjectMavenDependencies().clear();
}
return !AsposeMavenDependenciesManager.getAsposeProjectMavenDependencies().isEmpty();
}
开发者ID:asposemarketplace,项目名称:Aspose_Maven_for_NetBeans,代码行数:23,代码来源:AsposeMavenDependenciesManager.java
示例6: generateModal
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
private void generateModal(String fileName, EntityClass[] entityClasses,
boolean fullyQualifiedTableNames, boolean regenTablesAttrs,
boolean useDefaults,
ProgressContributor progressContributor, ProgressPanel panel, Project prj) throws IOException {
int progressMax = entityClasses.length * 3;
progressContributor.start(progressMax);
result = new Generator(fileName, entityClasses,
fullyQualifiedTableNames, regenTablesAttrs,
useDefaults,
progressContributor, panel, this).run();
progressContributor.progress(progressMax);
PersistenceUtils.logUsage(JavaPersistenceModelGenerator.class, "USG_PERSISTENCE_ENTITY_DB_CREATED", new Integer[]{entityClasses.length});
}
开发者ID:jeddict,项目名称:jeddict,代码行数:17,代码来源:JavaPersistenceModelGenerator.java
示例7: updateRepository
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
/**
*
* @param component
*/
public static void updateRepository(AsposeJavaComponent component, ProgressContributor p) {
StatusDisplayer.getDefault().setStatusText("Downloading " + component.get_name() + " examples ...");
checkAndCreateFolder(getLocalRepositoryPath(component));
try {
updateRepository(getLocalRepositoryPath(component), component.get_remoteExamplesRepository());
p.progress(3);
// Added by [email protected] - Integration of Apache POI Examples / Other FrameWork Examples
OtherExamplesManager.updateOtherExamplesRepositories(component);
// adeel.i[email protected]
p.progress(3);
} catch (Exception e) {
}
}
开发者ID:aspose-total,项目名称:Aspose.Total-for-Java,代码行数:20,代码来源:GitHelper.java
示例8: processGraph
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
private void processGraph(FileObject fo, CountDownLatch latch, ProgressContributor pc) {
System.out.println("Processing traversal graph...");
EntityManager em = null;
try {
GortDatabaseService gds = project.getLookup().lookup(GortDatabaseService.class);
if (gds == null) {
return;
}
GortEntityManager gem = gds.getGortEntityManager();
if (gem == null) {
return;
}
em = gem.getEntityManager();
Traversal t = gem.selectTraversal(em, fo.getNameExt());
} finally {
System.out.println("Processing traversal graph done.");
GortEntityManager.closeEntityManager(em);
latch.countDown();
}
}
开发者ID:samini,项目名称:gort-public,代码行数:27,代码来源:TraversalProcessorServiceProvider.java
示例9: generateModel
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void generateModel(final ProgressPanel progressPanel,
final ImportHelper helper,
final FileObject dbSchemaFile,
final ProgressContributor handle) throws IOException {
// PUDataObject pudo;
// try {
// pudo = ProviderUtil.getPUDataObject(helper.getProject());
// pudo.getPersistence().getPersistenceUnit();
// } catch (InvalidPersistenceXmlException ex) {
// Exceptions.printStackTrace(ex);
// }
generateModal(helper.getFileName(), helper.getBeans(),
helper.isFullyQualifiedTableNames(), helper.isRegenTablesAttrs(),
helper.isUseDefaults(),
handle, progressPanel, helper.getProject());
}
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:19,代码来源:JavaPersistenceModelGenerator.java
示例10: updateRepository
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
/**
*
* @param component
*/
public static void updateRepository(AsposeJavaComponent component, ProgressContributor p) {
StatusDisplayer.getDefault().setStatusText("Downloading " + component.get_name() + " examples ...");
checkAndCreateFolder(getLocalRepositoryPath(component));
try {
updateRepository(getLocalRepositoryPath(component), component.get_remoteExamplesRepository());
p.progress(3);
// Added by [email protected] - Integration of Apache POI Examples / Other FrameWork Examples
OtherExamplesManager.updateOtherExamplesRepositories(component);
// [email protected]
p.progress(3);
} catch (Exception e) {
}
}
开发者ID:asposemarketplace,项目名称:Aspose_for_NetBeans,代码行数:20,代码来源:GitHelper.java
示例11: generate
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
/**
* Performs the generation of entity classes.
*
* @param progressContributor the progress contributor for the generation process.
*
* @return a set of <code>FileObject</code>s representing the generated entity
* classes.
* @throws SQLException in case an error was encountered when connecting to the db.
* @throws IOException in case the writing of the generated entities fails.
*/
public Set<FileObject> generate(ProgressContributor progressContributor) throws SQLException, IOException{
RelatedCMPHelper helper = new RelatedCMPHelper(project, PersistenceLocation.getLocation(project, location.getRootFolder()), generator);
helper.setLocation(location);
helper.setPackageName(packageName);
try{
TableClosure tableClosure = getTableClosure();
SelectedTables selectedTables = new SelectedTables(generator, tableClosure, location, packageName);
helper.setTableClosure(tableClosure);
helper.setTableSource(getSchemaElement(), null);
helper.setSelectedTables(selectedTables);
helper.setGenerateFinderMethods(generateNamedQueries);
helper.setFullyQualifiedTableNames(fullyQualifiedTableNames);
helper.setRegenTablesAttrs(regenTableAttrs);
helper.setFetchType(fetchType);
helper.setCollectionType(collectionType);
helper.buildBeans();
} catch (DBException ex){
IOException wrapper = new IOException(ex.getMessage());
wrapper.initCause(ex);
throw wrapper;
}
generator.generateBeans(null, helper, null, progressContributor);
Set<FileObject> result = generator.createdObjects();
return result;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:45,代码来源:EntitiesFromDBGenerator.java
示例12: Generator
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
public Generator(EntityClass[] entityClasses, boolean generateNamedQueries,
boolean generateJAXBAnnotations,
boolean generateValidationConstraints,
boolean fullyQualifiedTableNames, boolean regenTablesAttrs,
boolean useDefaults,
boolean generateMappedSC,
FetchType fetchType, CollectionType collectionType,
ProgressContributor progressContributor, ProgressPanel progressPanel,
PersistenceGenerator persistenceGen) {
this.entityClasses = entityClasses;
this.generateNamedQueries = generateNamedQueries;
this.generateJAXBAnnotations = generateJAXBAnnotations;
this.generateValidationConstraints = generateValidationConstraints;
this.fullyQualifiedTableNames = fullyQualifiedTableNames;
this.useDefaults = useDefaults;
this.generateMappedSC = generateMappedSC;
this.regenTablesAttrs = regenTablesAttrs;
this.fetchType = fetchType;
this.collectionType = collectionType;
this.progressContributor = progressContributor;
this.progressPanel = progressPanel;
generatedFOs = new HashSet<FileObject>();
generatedEntityFOs = new HashSet<FileObject>();
this.persistenceGen = persistenceGen;
replacedNames = new HashMap<String, String>();
replacedTypeNames = new HashMap<String, String>();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:JavaPersistenceGenerator.java
示例13: actionPerformed
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Messages({"# {0} - artifact ID", "DownloadAction_downloading=Downloading {0}"})
public @Override void actionPerformed(ActionEvent e) {
RP.post(new Runnable() {
public @Override void run() {
MavenEmbedder online = EmbedderFactory.getOnlineEmbedder();
AggregateProgressHandle hndl = AggregateProgressFactory.createHandle(DownloadAction_downloading(art.getId()),
new ProgressContributor[] {AggregateProgressFactory.createProgressContributor("")},
ProgressTransferListener.cancellable(), null);
ProgressTransferListener.setAggregateHandle(hndl);
try {
hndl.start();
//mkleint: XXX theoretically using info from RepositoryPreferences.getRepositoryInfos() here could cause problems as the
// maven embedder code might want to retry applying mirrors on it.
online.resolve(art, Collections.<ArtifactRepository>singletonList(online.createRemoteRepository(info.getRepositoryUrl(), info.getId())), online.getLocalRepository());
} catch (ThreadDeath d) {
return;
} catch (IllegalStateException ise) { //download interrupted in dependent thread. #213812
if (!(ise.getCause() instanceof ThreadDeath)) {
throw ise;
}
return;
} catch (AbstractArtifactResolutionException x) {
return;
} finally {
hndl.finish();
ProgressTransferListener.clearAggregateHandle();
}
if (!primary) {
return;
}
RepositoryIndexer.updateIndexWithArtifacts(RepositoryPreferences.getInstance().getLocalRepository(), Collections.singletonList(art));
setLocalArtifact(findLocalArtifact(info, record));
setChildren(createChildren(localArtifact));
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:VersionNode.java
示例14: triggerSourceJavadocDownload
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Messages({"Progress_Javadoc=Downloading Javadoc", "Progress_Source=Downloading Sources"})
public void triggerSourceJavadocDownload(final boolean javadoc) {
NONBINARYRP.post(new Runnable() {
@Override
public void run() {
Set<Artifact> arts = project.getOriginalMavenProject().getArtifacts();
ProgressContributor[] contribs = new ProgressContributor[arts.size()];
for (int i = 0; i < arts.size(); i++) {
contribs[i] = AggregateProgressFactory.createProgressContributor("multi-" + i); //NOI18N
}
String label = javadoc ? Progress_Javadoc() : Progress_Source();
AggregateProgressHandle handle = AggregateProgressFactory.createHandle(label,
contribs, ProgressTransferListener.cancellable(), null);
handle.start();
try {
ProgressTransferListener.setAggregateHandle(handle);
int index = 0;
for (Artifact a : arts) {
downloadOneJavadocSources(contribs[index], project, a, javadoc);
index++;
}
} catch (ThreadDeath d) { // download interrupted
} catch (IllegalStateException ise) { //download interrupted in dependent thread. #213812
if (!(ise.getCause() instanceof ThreadDeath)) {
throw ise;
}
} finally {
handle.finish();
ProgressTransferListener.clearAggregateHandle();
fireProjectReload();
}
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:NbMavenProject.java
示例15: actionPerformed
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent evnt) {
if (actionContext == null) {
return;
}
RP.post(new Runnable() {
public @Override void run() {
ProgressContributor contributor =AggregateProgressFactory.createProgressContributor("multi-1");
String label = javadoc ? Progress_Javadoc() : Progress_Source();
AggregateProgressHandle handle = AggregateProgressFactory.createHandle(label,
new ProgressContributor [] {contributor}, ProgressTransferListener.cancellable(), null);
handle.start();
try {
ProgressTransferListener.setAggregateHandle(handle);
for (Data data : actionContext.lookupAll(Data.class)) {
ProgressContributor contributor2 = AggregateProgressFactory.createProgressContributor("multi-1");
handle.addContributor(contributor2);
if (javadoc && !data.hasJavadocInRepository()) {
data.getNode().downloadJavadocSources(contributor2, javadoc);
} else if (!javadoc && !data.hasSourceInRepository()) {
data.getNode().downloadJavadocSources(contributor2, javadoc);
} else {
contributor2.finish();
}
}
} catch (ThreadDeath d) { // download interrupted
} catch (IllegalStateException ise) { //download interrupted in dependent thread. #213812
if (!(ise.getCause() instanceof ThreadDeath)) {
throw ise;
}
} finally {
handle.finish();
ProgressTransferListener.clearAggregateHandle();
}
}
});
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:DependencyNode.java
示例16: setAggregateHandle
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
public static void setAggregateHandle(AggregateProgressHandle hndl) {
ProgressTransferListener ptl = activeListener();
ptl.handle = hndl;
ProgressContributor pc = AggregateProgressFactory.createProgressContributor("Pom files");
hndl.addContributor(pc);
pc.start(POM_MAX);
ptl.pomcontrib = pc;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProgressTransferListener.java
示例17: transferCorrupted
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void transferCorrupted(TransferEvent te) throws TransferCancelledException {
ProgressContributor c = contrib;
contrib = null;
if (c != null) {
c.finish();
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProgressTransferListener.java
示例18: transferSucceeded
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void transferSucceeded(TransferEvent te) {
ProgressContributor c = contrib;
contrib = null;
if (c != null) {
c.finish();
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProgressTransferListener.java
示例19: transferFailed
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void transferFailed(TransferEvent te) {
ProgressContributor c = contrib;
contrib = null;
if (c != null) {
c.finish();
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProgressTransferListener.java
示例20: generateModel
import org.netbeans.api.progress.aggregate.ProgressContributor; //导入依赖的package包/类
@Override
public void generateModel(final ProgressPanel progressPanel,
final ImportHelper helper,
final FileObject dbSchemaFile,
final ProgressContributor handle) throws IOException {
generateModal(helper.getFileName(), helper.getBeans(),
helper.isFullyQualifiedTableNames(), helper.isRegenTablesAttrs(),
helper.isUseDefaults(),
handle, progressPanel, helper.getProject());
}
开发者ID:jeddict,项目名称:jeddict,代码行数:11,代码来源:JavaPersistenceModelGenerator.java
注:本文中的org.netbeans.api.progress.aggregate.ProgressContributor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论