类org.eclipse.swt.widgets.ProgressBar源码实例Demo

下面列出了怎么用org.eclipse.swt.widgets.ProgressBar的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: SWET   文件: ProgressDialogEx.java
public ProgressController(Composite parent, int style) {
	this.parent = parent;
	display = Display.getCurrent();

	progressTitle = new Label(parent, SWT.NONE);
	progressTitle.setText("Progress");
	GridData titleData = new GridData();
	titleData.horizontalAlignment = GridData.BEGINNING;
	titleData.grabExcessHorizontalSpace = true;
	progressTitle.setLayoutData(titleData);

	progressValue = new Label(parent, SWT.NONE);
	progressValue.setText("0%");
	GridData valueData = new GridData();
	valueData.horizontalAlignment = GridData.END;
	progressValue.setLayoutData(valueData);

	progressBar = new ProgressBar(parent, style);
	GridData progressData = new GridData();
	progressData.horizontalAlignment = GridData.FILL;
	progressData.horizontalSpan = 2;
	progressData.grabExcessHorizontalSpace = true;
	progressBar.setLayoutData(progressData);

}
 
源代码2 项目: BiglyBT   文件: AZProgressBar.java
/**
 *
 * @param parent
 * @param isIndeterminate
 * @param useInputButton determines whether the <code>inputButton</code> is available or not
 * @param image an <code>Image</code> to display; may be null
 */
public AZProgressBar(Composite parent, boolean isIndeterminate) {
	super(parent, SWT.NULL);

	incrementalProgressBar = new ProgressBar(this, SWT.HORIZONTAL);
	indeterminateProgressBar = new ProgressBar(this, SWT.HORIZONTAL
			| SWT.INDETERMINATE);

	stack = new StackLayout();
	setLayout(stack);
	pack();

	visible = super.isVisible();
	
	setIndeterminate(isIndeterminate);
}
 
源代码3 项目: slr-toolkit   文件: ProgressBarDemo.java
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
       completedInfo = new Label(container, SWT.NONE);
       completedInfo.setAlignment(SWT.CENTER);
       GridData gd_completedInfo = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_completedInfo.minimumWidth = 250;
       completedInfo.setLayoutData(gd_completedInfo);
       completedInfo.setSize(250, 40);
       completedInfo.setText("Processing Data ...");
       new Label(container, SWT.NONE);
       
       progressBar = new ProgressBar(container, SWT.INDETERMINATE);
       GridData gd_progressBar = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_progressBar.minimumWidth = 250;
       progressBar.setLayoutData(gd_progressBar);
       progressBar.setBounds(10, 23, 400, 17);
       progressBar.setSelection(100);
       
	return container;
}
 
源代码4 项目: translationstudio8   文件: LicenseManageDialog.java
private void createBarComp(Composite parent) {
	Composite barComp = new Composite(parent, SWT.NONE);
	GridLayout barLayout = new GridLayout();
	barLayout.marginTop = 10;
	barComp.setLayout(barLayout);
	barComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	label4 = new Label(barComp, SWT.NONE);
	label4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	bar = new ProgressBar(barComp, SWT.NONE);
	bar.setMaximum(10);
	bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	setVisible(false);
}
 
public void fill(Composite parent) {
	super.fill(parent);
	Composite container = new Composite(parent, SWT.NONE);
	GridLayout gl = new GridLayout(2, false);
	gl.marginWidth = 5;
	gl.marginHeight = 3;
	container.setLayout(gl);

	progressBar = new ProgressBar(container, SWT.SMOOTH);
	GridData gdPprogressBar = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
	gdPprogressBar.heightHint = 16;
	gdPprogressBar.widthHint = 130;
	progressBar.setLayoutData(gdPprogressBar);
	progressBar.setMinimum(0); // 最小值
	progressBar.setMaximum(100);// 最大值
	progressBar.setSelection(progressValue);
	progressBar.setToolTipText(defaultMessage);

	label = new Label(container, SWT.None);
	label.setText(progressValue + "%");

	StatusLineLayoutData data = new StatusLineLayoutData();
	container.setLayoutData(data);
}
 
源代码6 项目: tmxeditor8   文件: LicenseManageDialog.java
private void createBarComp(Composite parent) {
	Composite barComp = new Composite(parent, SWT.NONE);
	GridLayout barLayout = new GridLayout();
	barLayout.marginTop = 10;
	barComp.setLayout(barLayout);
	barComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	label4 = new Label(barComp, SWT.NONE);
	label4.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	bar = new ProgressBar(barComp, SWT.NONE);
	bar.setMaximum(10);
	bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	setVisible(false);
}
 
源代码7 项目: nebula   文件: MessageArea.java
/**
 * Create a progress bar
 */
private void createProgressBar() {
	progressBar = new ProgressBar(composite, SWT.SMOOTH | SWT.HORIZONTAL);
	progressBar.setMinimum(progressBarMinimumValue);
	progressBar.setMaximum(progressBarMaximumValue);
	progressBar.setSelection(progressBarValue);
	final GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false, 1, 1);
	progressBar.setLayoutData(gd);
}
 
源代码8 项目: scava   文件: MetricDisplay.java
@Override
protected Control createDialogArea(Composite parent) {

	setTitleImage(null);
	setTitle("Metric informations");
	Composite area = (Composite) super.createDialogArea(parent);
	area.setLayout(new GridLayout(1, false));

	Composite textContainer = new Composite(area, SWT.NONE);
	textContainer.setLayout(new FillLayout(SWT.HORIZONTAL));
	textContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));

	table = new Table(textContainer, SWT.BORDER | SWT.FULL_SELECTION);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);

	TableColumn tblclmnNewColumn = new TableColumn(table, SWT.NONE);
	tblclmnNewColumn.setWidth(300);
	tblclmnNewColumn.setText("ID");

	TableColumn tblclmnNewColumn_1 = new TableColumn(table, SWT.NONE);
	tblclmnNewColumn_1.setWidth(100);
	tblclmnNewColumn_1.setText("Value");
	
	TableColumn tblclmnNewColumn_2 = new TableColumn(table, SWT.NONE);
	tblclmnNewColumn_2.setWidth(300);
	tblclmnNewColumn_2.setText("Description");
	

	progressBar = new ProgressBar(area, SWT.SMOOTH);
	progressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));

	refreshMetrics();

	return area;
}
 
源代码9 项目: mappwidget   文件: MainView.java
private void setValue(Composite top, final ProgressBar progressBar, final int value)
{
	top.getDisplay().asyncExec(new Runnable()
	{
		@Override
		public void run()
		{
			progressBar.setSelection(value);
		}
	});
}
 
源代码10 项目: mappwidget   文件: MainView.java
private void setCompliete(Composite top, final Button runButton, final ProgressBar progressBar)
{
	top.getDisplay().asyncExec(new Runnable()
	{
		@Override
		public void run()
		{
			runButton.setEnabled(true);
		}
	});
}
 
源代码11 项目: slr-toolkit   文件: ProgressBarDialog.java
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
       completedInfo = new Label(container, SWT.NONE);
       completedInfo.setAlignment(SWT.CENTER);
       GridData gd_completedInfo = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_completedInfo.minimumWidth = 250;
       completedInfo.setLayoutData(gd_completedInfo);
       completedInfo.setSize(250, 40);
       completedInfo.setText("Processing Data ...");
       new Label(container, SWT.NONE);
       
       progressBar = new ProgressBar(container, SWT.SMOOTH);
       GridData gd_progressBar = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_progressBar.minimumWidth = 250;
       progressBar.setLayoutData(gd_progressBar);
       progressBar.setBounds(10, 23, 400, 17);
       
       taskLabel = new Label(container, SWT.NONE);
       taskLabel.setAlignment(SWT.CENTER);
       GridData gd_taskLabel = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_taskLabel.heightHint = 15;
       gd_taskLabel.minimumWidth = 250;
       taskLabel.setLayoutData(gd_taskLabel);
       taskLabel.setSize(250, 40);
       
	return container;
}
 
源代码12 项目: translationstudio8   文件: ExcelExportProgessBar.java
public void open(int minValue, int maxValue) {
	childShell = new Shell(shell.getDisplay(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	childShell.setText("Exporting to Excel.. please wait");

	progressBar = new ProgressBar(childShell, SWT.SMOOTH);
	progressBar.setMinimum(minValue);
	progressBar.setMaximum(maxValue);
	progressBar.setBounds(0, 0, 400, 25);
	progressBar.setFocus();

	childShell.pack();
	childShell.open();
}
 
源代码13 项目: offspring   文件: ProgressIndicator.java
/**
 * Create a ProgressIndicator as a child under the given parent.
 * 
 * @param parent
 *          The widgets parent
 * @param style
 *          the SWT style constants for progress monitors created by the
 *          receiver.
 * @since 3.4
 */
public ProgressIndicator(Composite parent, int style) {
  super(parent, SWT.NULL);

  // Enforce horizontal only if vertical isn't set
  if ((style & SWT.VERTICAL) == 0)
    style |= SWT.HORIZONTAL;

  determinateProgressBar = new ProgressBar(this, style);
  indeterminateProgressBar = new ProgressBar(this, style | SWT.INDETERMINATE);
  layout = new StackLayout();
  setLayout(layout);
}
 
源代码14 项目: tmxeditor8   文件: ExcelExportProgessBar.java
public void open(int minValue, int maxValue) {
	childShell = new Shell(shell.getDisplay(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	childShell.setText("Exporting to Excel.. please wait");

	progressBar = new ProgressBar(childShell, SWT.SMOOTH);
	progressBar.setMinimum(minValue);
	progressBar.setMaximum(maxValue);
	progressBar.setBounds(0, 0, 400, 25);
	progressBar.setFocus();

	childShell.pack();
	childShell.open();
}
 
源代码15 项目: RepDev   文件: SymitarSession.java
/**
 * Helper method for runRepGen stuff
 * @param progress
 * @param value
 * @param text
 * @param str
 */
protected void setProgress(ProgressBar progress, int value, Text text, String str){
	if( progress != null && !progress.isDisposed() )
		progress.setSelection(value);

	if( text != null && str != null && !text.isDisposed())
		text.setText(str.replace("\r", "\n"));
}
 
源代码16 项目: RepDev   文件: TestingSymitarSession.java
@Override
public RunRepgenResult runRepGen(String name, int queue, ProgressBar progress, Text text, PromptListener prompter) {
	setProgress(progress, 50, text, "Answer Prompts");
	prompter.getPrompt("Test");
	setProgress(progress, 100, text, "Error");
	return new RunRepgenResult(-1,0);
}
 
源代码17 项目: olca-app   文件: SimulationPage.java
private void createProgressSection(FormToolkit toolkit, Composite body) {
	progressSection = UI.section(body, toolkit, M.Progress);
	Composite composite = UI.sectionClient(progressSection, toolkit);
	progressBar = new ProgressBar(composite, SWT.SMOOTH);
	progressBar.setMaximum(editor.setup.numberOfRuns);
	UI.gridData(progressBar, false, false).widthHint = 470;
	Button progressButton = toolkit.createButton(composite,
			M.Start, SWT.NONE);
	UI.gridData(progressButton, false, false).widthHint = 70;
	new SimulationControl(progressButton, editor, this);
}
 
源代码18 项目: Universal-FE-Randomizer   文件: ProgressModal.java
public ProgressModal(Shell parent, String title) {
	display = Display.getDefault();
	yuneImage = new Image(display, Main.class.getClassLoader().getResourceAsStream("YuneIcon_100x100.png"));
	
	dialogShell = new Shell(parent, SWT.PRIMARY_MODAL | SWT.DIALOG_TRIM);
	dialogShell.setText(title);
	dialogShell.setImage(yuneImage);
	
	progressBar = new ProgressBar(dialogShell, SWT.SMOOTH);
	
	FormLayout mainLayout = new FormLayout();
	mainLayout.marginWidth = 5;
	mainLayout.marginHeight = 5;
	dialogShell.setLayout(mainLayout);
	
	imageLabel = new Label(dialogShell, SWT.NONE);
	imageLabel.setImage(yuneImage);
	
	FormData imageData = new FormData(100, 100);
	imageData.left = new FormAttachment(0, 10);
	imageData.top = new FormAttachment(0, 10);
	imageData.bottom = new FormAttachment(100, -10);
	imageLabel.setLayoutData(imageData);
	
	FormData progressData = new FormData(300, 20);
	progressData.left = new FormAttachment(imageLabel, 10);
	progressData.bottom = new FormAttachment(imageLabel, -50, SWT.CENTER);
	progressData.right = new FormAttachment(100, -10);
	progressBar.setLayoutData(progressData);
	
	statusLabel = new Label(dialogShell, SWT.NONE);
	
	FormData statusData = new FormData();
	statusData.left = new FormAttachment(progressBar, 0, SWT.LEFT);
	statusData.top = new FormAttachment(progressBar, 5);
	statusData.right = new FormAttachment(100, -10);
	statusLabel.setLayoutData(statusData);
	
	dialogShell.layout();
	final Point newSize = dialogShell.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
	dialogShell.setSize(newSize);
	
	Rectangle parentBounds = parent.getBounds();
	Rectangle dialogBounds = dialogShell.getBounds();
	
	dialogShell.setLocation(parentBounds.x + (parentBounds.width - dialogBounds.width) / 2, parentBounds.y + (parentBounds.height - dialogBounds.height) / 2);
}
 
源代码19 项目: neoscada   文件: ProgressComposite.java
public ProgressComposite ( final Composite parent, final int style, final DataItemDescriptor descriptor, final String format, final String decimal, final String attribute, final double max, final double min, final double factor, final int width, final String hdConnectionId, final String hdItemId, final String queryString )
{
    super ( parent, style, format, decimal, false, attribute );

    if ( max != 0 )
    {
        this.max = max;
    }

    if ( min != 0 )
    {
        this.min = min;
    }

    if ( factor != 0 )
    {
        this.factor = factor;
    }

    if ( width > 0 )
    {
        this.width = width;
    }

    addDisposeListener ( new DisposeListener () {

        @Override
        public void widgetDisposed ( final DisposeEvent e )
        {
            ProgressComposite.this.handleDispose ();
        }
    } );

    final RowLayout layout = new RowLayout ();
    layout.wrap = false;
    layout.center = true;
    layout.spacing = 7;
    layout.pack = true;
    setLayout ( layout );

    this.progressWidth = this.width - this.textWidth - layout.spacing;
    if ( this.progressWidth < 1 )
    {
        this.progressWidth = 1;
    }

    this.controlImage = new ControlImage ( this, this.registrationManager );
    Helper.createTrendButton ( this.controlImage, hdConnectionId, hdItemId, queryString );

    this.progressBar = new ProgressBar ( this, SWT.NONE );
    //        this.progressBar.setSize ( this.progressWidth, this.textHeight );
    final RowData progressData = new RowData ( this.progressWidth, SWT.DEFAULT );
    this.progressBar.setLayoutData ( progressData );
    final int minimum = (int)Math.round ( this.min );
    final int maximum = (int)Math.round ( this.max );
    this.progressBar.setMinimum ( minimum );
    this.progressBar.setMaximum ( maximum );

    this.text = new Text ( this, SWT.MULTI | SWT.WRAP | SWT.RIGHT );
    //        final RowData rowData = new RowData ( 60, SWT.DEFAULT );
    //        this.font = new Font ( getDisplay (), new FontData ( "Arial", 10, 0 ) ); //$NON-NLS-1$
    //        this.text.setFont ( this.font );
    final RowData rowData = new RowData ( this.textWidth, this.textHeight );
    //        this.dataText.setAlignment ( SWT.RIGHT );
    this.text.setLayoutData ( rowData );
    this.text.setEnabled ( true );
    this.text.setEditable ( false );

    this.text.setText ( "" ); //$NON-NLS-1$
    new DescriptorLabel ( this, SWT.NONE, format, descriptor );

    if ( descriptor != null )
    {
        this.controlImage.setDetailItem ( descriptor.asItem () );
        this.registrationManager.registerItem ( "value", descriptor.getItemId (), descriptor.getConnectionInformation (), false, false ); //$NON-NLS-1$
    }
}
 
源代码20 项目: BiglyBT   文件: PlayerInstallWindow.java
public void open() {

		box = new VuzeMessageBox("","", null, 0);
		box.setSubTitle(MessageText.getString("dlg.player.install.subtitle"));
		box.addResourceBundle(PlayerInstallWindow.class,
				SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register");
		box.setIconResource("image.player.dlg.header");

		this.progressText = MessageText.getString("dlg.player.install.description");

		box.setListener(new VuzeMessageBoxListener() {

			@Override
			public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
				SWTSkin skin = soExtra.getSkin();
				skin.createSkinObject("dlg.register.install", "dlg.register.install",
						soExtra);

				SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
				if (soProgressBar != null) {
					progressBar = new ProgressBar(soProgressBar.getComposite(),
							SWT.HORIZONTAL);
					progressBar.setMinimum(0);
					progressBar.setMaximum(100);
					progressBar.setLayoutData(Utils.getFilledFormData());
				}

				soInstallPct = (SWTSkinObjectText) skin.getSkinObject("install-pct");

				soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");
				if (soProgressText != null && progressText != null) {
					soProgressText.setText(progressText);
				}
			}
		});

		box.open(new UserPrompterResultListener() {
			@Override
			public void prompterClosed(int result) {
				installer.setListener(null);
				installer.cancel();
			}
		});
	}
 
源代码21 项目: BiglyBT   文件: SimplePluginInstallWindow.java
public void open() {

		box = new VuzeMessageBox("","", null, 0);
		box.setSubTitle(MessageText.getString( resource_prefix + ".subtitle" ));
		box.addResourceBundle(SimplePluginInstallWindow.class,
				SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register");
		box.setIconResource( resource_prefix + ".image" );

		this.progressText = MessageText.getString( resource_prefix + ".description" );

		box.setListener(new VuzeMessageBoxListener() {

			@Override
			public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
				SWTSkin skin = soExtra.getSkin();
				skin.createSkinObject("dlg.register.install", "dlg.register.install",
						soExtra);

				SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
				if (soProgressBar != null) {
					progressBar = new ProgressBar(soProgressBar.getComposite(),
							SWT.HORIZONTAL);
					progressBar.setMinimum(0);
					progressBar.setMaximum(100);
					progressBar.setLayoutData(Utils.getFilledFormData());
				}

				soInstallPct = (SWTSkinObjectText) skin.getSkinObject("install-pct");

				soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");
				if (soProgressText != null && progressText != null) {
					soProgressText.setText(progressText);
				}
			}
		});

		box.open(new UserPrompterResultListener() {
			@Override
			public void prompterClosed(int result) {
				installer.setListener(null);
				try {
					installer.cancel();
				} catch (Exception e) {
					Debug.out(e);
				}
			}
		});
	}
 
源代码22 项目: tuxguitar   文件: SWTIndeterminateProgressBar.java
public SWTIndeterminateProgressBar(SWTContainer<? extends Composite> parent) {
	super(new ProgressBar(parent.getControl(), SWT.BORDER | SWT.HORIZONTAL | SWT.SMOOTH | SWT.INDETERMINATE), parent);
}
 
源代码23 项目: tuxguitar   文件: SWTProgressBar.java
public SWTProgressBar(SWTContainer<? extends Composite> parent) {
	super(new ProgressBar(parent.getControl(), SWT.BORDER | SWT.HORIZONTAL | SWT.SMOOTH), parent);
}
 
源代码24 项目: AndroidRobot   文件: RowItem.java
public ProgressBar getPb(){
	return pb;
}
 
源代码25 项目: AndroidRobot   文件: RowItem.java
public void setPb(ProgressBar pb1){
	pb = pb1;
}
 
源代码26 项目: ldparteditor   文件: SplashScreen.java
@Override
protected Control createContents(final Composite parent) {

    final Color bgColor = SWTResourceManager.getColor(SWT.COLOR_WHITE);
    final Composite frame = new Composite(parent, SWT.NONE);
    final FormData titleData = new FormData();
    final FormData statusData = new FormData();
    final FormLayout layout = new FormLayout();
    final Label titleLabel = new Label(frame, SWT.NONE);
    final Label statusLabel = new Label(frame, SWT.NONE);
    final ProgressBar bar = new ProgressBar(frame, SWT.NONE);
    final FormData barData = new FormData();

    bar.setMaximum(100);

    titleLabel.setText(Version.getApplicationName() + " " + Version.getVersion() + "\n" + Version.getStage() + "\n(C) " + Version.getDevelopmentLead()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    titleLabel.setBackground(bgColor);
    bar.setBackground(bgColor);
    statusLabel.setBackground(bgColor);

    frame.setLayout(layout);
    frame.setBackgroundImage(ResourceManager.getImage("imgSplash.png")); //$NON-NLS-1$

    barData.left = new FormAttachment(15, 5);
    barData.right = new FormAttachment(100, -5);
    barData.bottom = new FormAttachment(100, -5);
    bar.setLayoutData(barData);

    titleData.left = new FormAttachment(45, 5);
    titleData.right = new FormAttachment(100, 0);
    titleData.top = new FormAttachment(50, 0);
    titleLabel.setLayoutData(titleData);

    statusData.left = new FormAttachment(15, 5);
    statusData.right = new FormAttachment(100, 0);
    statusData.top = new FormAttachment(80, 0);
    statusLabel.setLayoutData(statusData);

    this.bar = bar;
    this.label = statusLabel;

    return frame;
}
 
源代码27 项目: translationstudio8   文件: ServiceUtil.java
public static int active(String licenseId, ProgressBar bar) throws Exception {
	boolean result = FileUtils.writeFile(new byte[] {'1','1'}, ProtectionFactory.getFileName(0, Constants.PRODUCTID));
	if (!result) {
		return Constants.EXCEPTION_INT8;
	} else {
		FileUtils.removeFile(ProtectionFactory.getFileName(0, Constants.PRODUCTID));
	}
	
	IService srvc = ServiceUtil.getService();
	bar.setSelection(1);
	
	String series = ProtectionFactory.getSeries();
	if (series == null || "".equals(series)) {
		return Constants.EXCEPTION_INT5;
	}
	
	byte[] serverPublicKey = srvc.getServerPublicKey();
	bar.setSelection(2);
	
	IKeyGenerator gen = new KeyGeneratorImpl();
	byte[] k = gen.generateKey(licenseId, series, serverPublicKey);
	if (k == null) {
		return Constants.EXCEPTION_INT9;
	}
	bar.setSelection(3);
	Encrypt en = ProtectionFactory.getEncrypt();
	bar.setSelection(4);
	String str = srvc.activeLicense(StringUtils.toHexString(k), en.getPublicKey(), ProtectionFactory.getPlatform());
	bar.setSelection(5);
	bar.setSelection(6);
	byte[] b = StringUtils.toBytes(str);
	bar.setSelection(7);
	b = en.decrypt(en.getPrivateKey(), b);
	if (b == null) {
		return Constants.EXCEPTION_INT7;
	}
	bar.setSelection(8);
	
	String info = new String(b);
	if (Constants.RETURN_INVALIDLICENSE.equals(info)) {
		return Constants.RETURN_INVALIDLICENSE_INT;
	} else if (Constants.RETURN_INVALIDBUNDLE.equals(info)) {
		return Constants.RETURN_INVALIDBUNDLE_INT;
	} else if (Constants.RETURN_DBEXCEPTION.equals(info)) {
		return Constants.EXCEPTION_INT13;
	} else if (Constants.RETURN_MUTILTEMPBUNDLE.equals(info)) {
		return Constants.RETURN_MUTILTEMPBUNDLE_INT;
	} else if (Constants.RETURN_EXPIREDLICENSE.equals(info)) {
		return Constants.RETURN_EXPIREDLICENSE_INT;
	} else if (Constants.RETURN_STOPLICENSE.equals(info)) {
		return Constants.RETURN_STOPLICENSE_INT;
	} else {
		result = FileUtils.writeFile(b, ProtectionFactory.getFileName(1, Constants.PRODUCTID));
		if (!result) {
			return Constants.EXCEPTION_INT12;
		}
		bar.setSelection(9);
		b = InstallKeyEncrypt.encrypt(StringUtils.handle(gen.getInstallKey(), 1, 3, 2).getBytes());
		if (b == null) {
			return Constants.EXCEPTION_INT10;
		}
		result = FileUtils.writeFile(b, ProtectionFactory.getFileName(2, Constants.PRODUCTID));
		if (!result) {
			return Constants.EXCEPTION_INT11;
		}
		bar.setSelection(10);
		
		System.getProperties().setProperty("TSState", "true");
		return Constants.ACTIVE_OK_INT;
	}
}
 
源代码28 项目: Rel   文件: UpdatesCheck.java
public UpdatesCheck(Button btnSend, Label lblProgress, ProgressBar progressBar) {
	this.display = lblProgress.getDisplay();
	this.btnGo = btnSend;
	this.lblProgress = lblProgress;
	this.progressBar = progressBar;
}
 
源代码29 项目: Rel   文件: Feedback.java
public Feedback(Button btnSend, Label lblProgress, ProgressBar progressBar) {
	this.btnSend = btnSend;
	this.lblProgress = lblProgress;
	this.progressBar = progressBar;
}
 
源代码30 项目: Flashtool   文件: LogProgress.java
public static void registerProgressBar(ProgressBar bar) {
	_bar = bar;
}
 
 类所在包
 同包方法