Java Code Examples for org.eclipse.swt.widgets.Shell

The following are top voted examples for showing how to use org.eclipse.swt.widgets.Shell. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Hydrograph   File: CustomAboutDialog.java   Source Code and License 6 votes vote down vote up
/**
 * Create an instance of the AboutDialog for the given window.
 * 
 * @param parentShell
 *            The parent of the dialog.
 */
public CustomAboutDialog(Shell parentShell) {
	super(parentShell);
	this.parentShell = parentShell;
	setShellStyle(SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.WRAP);
	product = Platform.getProduct();

	if (product != null) {
		productName = product.getName();
	}
	if (productName == null) {
		productName = WorkbenchMessages.AboutDialog_defaultProductName;
	}

	// setDialogHelpAvailable(true);
}
 
Example 2
Project: n4js   File: UIUtils.java   Source Code and License 6 votes vote down vote up
/**
 * Returns the initial location to use for the shell. The default implementation centers the shell horizontally (1/2
 * of the difference to the left and 1/2 to the right) and vertically (1/3 above and 2/3 below) relative to the
 * active workbench windows shell, or display bounds if there is no parent shell.
 *
 * @param shell
 *            the shell which initial location has to be calculated.
 * @param initialSize
 *            the initial size of the shell, as returned by <code>getInitialSize</code>.
 * @return the initial location of the shell
 */
public static Point getInitialLocation(final Shell shell, final Point initialSize) {
	final Composite parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

	Monitor monitor = shell.getDisplay().getPrimaryMonitor();
	if (parent != null) {
		monitor = parent.getMonitor();
	}

	final Rectangle monitorBounds = monitor.getClientArea();
	Point centerPoint;
	if (parent != null) {
		centerPoint = Geometry.centerPoint(parent.getBounds());
	} else {
		centerPoint = Geometry.centerPoint(monitorBounds);
	}

	return new Point(centerPoint.x - (initialSize.x / 2), Math.max(
			monitorBounds.y, Math.min(centerPoint.y
					- (initialSize.y * 2 / 3), monitorBounds.y
							+ monitorBounds.height - initialSize.y)));
}
 
Example 3
Project: JavaFX-FrameRateMeter   File: SWTTestUtil.java   Source Code and License 6 votes vote down vote up
public static void openShell(String format, int weight, int height, Function<Shell, Control> function) {

    Display display = new Display();

    Shell shell = new Shell(display);

    shell.setSize(weight, height);
    shell.setLayout(new FillLayout());

    function.apply(shell);

    shell.open();

    while(!shell.isDisposed()) {
      if(!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
 
Example 4
Project: openaudible   File: ProgressDialog.java   Source Code and License 6 votes vote down vote up
public static void doProgressTask(final Shell s, final ProgressTask t) {
    SWTAsync.slow(new SWTAsync("doProgressTask") {
        public void task() {
            ProgressDialog p = new ProgressDialog(s, t);

            t.setProgress(p);
            p.open();
            p.getShell().setText(t.getName()); //$NON-NLS-1$

            // pd.taskLabel.setText("taskLabel");
            // pd.messageLabel.setText("messageLabel");

            p.runTask();

        }
    });
}
 
Example 5
Project: gemoc-studio-modeldebugging   File: SelectAnyEObjectDialog.java   Source Code and License 6 votes vote down vote up
public SelectAnyEObjectDialog(Shell parent, ResourceSet resourceSet, ILabelProvider renderer) {
	super(parent, renderer);
	_searchedResourceSet = resourceSet;
	ArrayList<EObject> all = new ArrayList<EObject>();
	EcoreUtil.resolveAll(resourceSet);
	for (Resource r : _searchedResourceSet.getResources())
	{
		for (TreeIterator<EObject> iterator = r.getAllContents(); iterator.hasNext();) {
			EObject o =  iterator.next();
			if(select(o)) all.add(o);
		}
	}
	
	Object[] elements = all.toArray();
	this.setElements(elements);
}
 
Example 6
Project: Hydrograph   File: ParameterGridDialog.java   Source Code and License 6 votes vote down vote up
/**
 * Create the dialog.
 * @param parentShell
 */
public ParameterGridDialog(Shell parentShell) {
	super(parentShell);
	setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL);
	runGraph=false;
	
	
	lastRowLastColumnTraverseListener=new TraverseListener() {
		
		@Override
		public void keyTraversed(TraverseEvent e) {
			if(e.detail == SWT.TRAVERSE_TAB_NEXT)
				addRowToTextGrid();
		}
	};
	
}
 
Example 7
Project: Open_Source_ECOA_Toolset_AS5   File: ClearTargetAction.java   Source Code and License 6 votes vote down vote up
@Override
public void run() {
	if (GenerationUtils.validate(containerName)) {
		Shell shell = Display.getDefault().getActiveShell();
		boolean confirm = MessageDialog.openQuestion(shell, "Confirm Create", "Existing Files will be cleared. Do you wish to continue?");
		if (confirm) {
			wsRoot = ResourcesPlugin.getWorkspace().getRoot();
			names = StringUtils.split(containerName, "/");
			wsRootRes = wsRoot.findMember(new Path("/" + names[0]));
			prj = wsRootRes.getProject();
			steps = prj.getFolder("target/Steps");
			File root = new File(steps.getLocation().toOSString());
			if (root.exists()) {
				GenerationUtils.clearCreatedFolders(root);
			}
			for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
				try {
					project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
				} catch (CoreException e) {
				}
			}
		}
	}
}
 
Example 8
Project: scanning   File: MultiStepCompositeTest.java   Source Code and License 6 votes vote down vote up
@Override
protected Shell createShell(Display display) throws Exception {

	this.model = new MultiStepModel();

	Shell shell = new Shell(display);
	shell.setText("Multi-Step");
	shell.setLayout(new GridLayout(1, false));

	this.ui = new MultiStepComposite(shell, SWT.NONE);

	this.controller = BeanService.getInstance().createController(ui, model);
	controller.beanToUI();
	controller.switchState(true);

	this.service = new MockScannableConnector(null);
	AnnotationManager manager = new AnnotationManager(Inject.class);
	manager.addDevices(ui);
	manager.invoke(Inject.class, service, model);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();
	return shell;
}
 
Example 9
Project: scanning   File: ScannableViewerTest2.java   Source Code and License 6 votes vote down vote up
@Override
protected Shell createShell(Display display) throws Exception {

	this.viewer = new ScannableViewer();

	Shell shell = new Shell(display);
	shell.setText("Monitors");
	shell.setLayout(new GridLayout(1, false));
       viewer.createPartControl(shell);

	shell.pack();
	shell.setSize(500, 500);
	shell.open();

	return shell;
}
 
Example 10
Project: iTrace-Archive   File: ControlView.java   Source Code and License 6 votes vote down vote up
/**
 * Find controls within a part, set it up to be used by iTrace,
 * and extract meta-data from it.
 * 
 * @param partRef partRef that just became visible.
 */
private void setupControls(IWorkbenchPartReference partRef) {
	IWorkbenchPart part = partRef.getPart(true);
    Control control = part.getAdapter(Control.class);
    //set up manager for control and managers for each child control if necessary
    if (control != null) {
    	setupControls(part, control);
    } else {
    	//Browser - always set up browser managers, no matter the partRef that
    	//has become visible
    	//not possible to get Browser control from a partRef
    	Shell workbenchShell = partRef.getPage().getWorkbenchWindow().getShell();
    	for (Control ctrl: workbenchShell.getChildren()) {
    		setupBrowsers(ctrl);
    	}
    }
}
 
Example 11
Project: tap17-muggl-javaee   File: OptionsWindow.java   Source Code and License 6 votes vote down vote up
/**
 * Build and show the Windows, dispose it after is is not longer needed.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 */
public void show(Shell parentShell, MugglClassLoader classLoader) {
	try {
		this.display = Display.getDefault();
		createShell(parentShell, classLoader);
		this.shell.open();

		while (!this.shell.isDisposed()) {
			if (!this.display.readAndDispatch())
				this.display.sleep();
			}
	} catch (Throwable t) {
		t.printStackTrace();
		StaticGuiSupport.processGuiError(t, "options", parentShell);
	} finally {
		doExit();
	}
}
 
Example 12
Project: pmTrans   File: FindReplaceDialog.java   Source Code and License 6 votes vote down vote up
private void renderTransparency(final Shell shell) {
	Group group = new Group(shell, SWT.NONE);
	group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 6, 1));
	group.setLayout(new GridLayout(1, false));
	group.setText("Transparency");
	final Scale transparencySlider = new Scale(group, SWT.HORIZONTAL);
	transparencySlider.setMinimum(20);
	transparencySlider.setMaximum(100);
	transparencySlider.setPageIncrement(90);
	transparencySlider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
	transparencySlider.setSelection(100);
	transparencySlider.addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(Event event) {
			shell.setAlpha(255 * transparencySlider.getSelection() / 100);
		}
	});
}
 
Example 13
Project: neoscada   File: Activator.java   Source Code and License 6 votes vote down vote up
/**
 * Notify error using message box (thread safe).
 * @param message The message to display
 * @param error The error that occurred
 */
public void notifyError ( final String message, final Throwable error )
{
    final Display display = getWorkbench ().getDisplay ();

    if ( !display.isDisposed () )
    {
        display.asyncExec ( new Runnable () {

            @Override
            public void run ()
            {
                final Shell shell = getWorkbench ().getActiveWorkbenchWindow ().getShell ();
                logger.debug ( "Shell disposed: {}", shell.isDisposed () );
                if ( !shell.isDisposed () )
                {
                    final IStatus status = new OperationStatus ( IStatus.ERROR, PLUGIN_ID, 0, message + ":" + error.getMessage (), error );
                    ErrorDialog.openError ( shell, null, message, status );
                }
            }
        } );
    }
}
 
Example 14
Project: Hydrograph   File: UpdateByKeysWidget.java   Source Code and License 6 votes vote down vote up
private void attachButtonListner(Button selectKeysButton) {
	selectKeysButton.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent e) {
			
			String buttonText = Messages.UPDATE_KEYS_WINDOW_LABEL;
			FieldDialog fieldDialog = new FieldDialog(new Shell(), propertyDialogButtonBar);
			fieldDialog.setComponentName(buttonText);
			fieldDialog.setSourceFieldsFromPropagatedSchema(getPropagatedSchema());
			if(StringUtils.isNotBlank(updateByKeysTextBox.getText())){
				fieldDialog.setPropertyFromCommaSepratedString(updateByKeysTextBox.getText());
			}
			fieldDialog.open();
			String valueForNewTableTextBox = fieldDialog.getResultAsCommaSeprated();
			if(valueForNewTableTextBox !=null){
				updateByKeysTextBox.setText(valueForNewTableTextBox);
			}
			showHideErrorSymbol(widgets);
		}
	});
	
}
 
Example 15
Project: neoscada   File: EntryEditDialog.java   Source Code and License 6 votes vote down vote up
public EntryEditDialog ( final Shell shell, final Map.Entry<?, ?> entry )
{
    super ( shell );

    this.entry = new ConfigurationEntry ();
    if ( entry == null )
    {
        this.createMode = true;
        this.entry.setKey ( "" );
        this.entry.setValue ( "" );
    }
    else
    {
        this.entry.setKey ( "" + entry.getKey () );
        this.entry.setValue ( "" + entry.getValue () );
        this.createMode = false;
    }
}
 
Example 16
Project: Hydrograph   File: WidgetUtility.java   Source Code and License 5 votes vote down vote up
/**
 * Error message.
 * 
 * @param message
 *            the message
 */
public static void errorMessage(String message) {
	Shell shell = new Shell();
	MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
	messageBox.setText(ERROR);
	messageBox.setMessage(message);
	messageBox.open();
}
 
Example 17
Project: Hydrograph   File: ELTGraphicalEditor.java   Source Code and License 5 votes vote down vote up
public void saveParameters() {

		//get map from file
		Map<String,String> currentParameterMap = getCurrentParameterMap();
		if(currentParameterMap == null){
			return;
		}
		List<String> letestParameterList = getLatestParameterList();

		Map<String,String> newParameterMap = new LinkedHashMap<>();

		for(int i=0;i<letestParameterList.size();i++){
			newParameterMap.put(letestParameterList.get(i), "");
		}

		for(String parameterName : currentParameterMap.keySet()){
			newParameterMap.put(parameterName, currentParameterMap.get(parameterName));
		}

		try {
			ParameterFileManager.getInstance().storeParameters(newParameterMap,null, getParameterFile());
		} catch (IOException e) {
			logger.error("Unable to store parameters to the file", e);

			MessageBox messageBox = new MessageBox(new Shell(), SWT.ICON_ERROR | SWT.OK );
			messageBox.setText("Error");
			messageBox.setMessage("Unable to store parameters to the file - \n" + e.getMessage());
			messageBox.open();
		}	

		refreshParameterFileInProjectExplorer();
	}
 
Example 18
Project: Hydrograph   File: JoinMapDialog.java   Source Code and License 5 votes vote down vote up
/**
 * Create the dialog.
 * 
 * @param parentShell
 * @wbp.parser.constructor
 */@Deprecated
public JoinMapDialog(Shell parentShell) {
	super(parentShell);

	setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL
			| SWT.RESIZE);
}
 
Example 19
Project: BiglyBT   File: ManagerUtils.java   Source Code and License 5 votes vote down vote up
public static void pause(DownloadManager dm, Shell shell) {
if (dm == null) {
	return;
}

int state = dm.getState();

if (state == DownloadManager.STATE_STOPPED
		|| state == DownloadManager.STATE_STOPPING ){
	return;
}

asyncPause(dm);
}
 
Example 20
Project: convertigo-eclipse   File: ExecuteMobileBuilderClassAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			if (treeObject instanceof MobileComponentTreeObject) {
   				if (treeObject instanceof MobileApplicationComponentTreeObject) {
   					MobileApplicationComponentTreeObject mpcto = (MobileApplicationComponentTreeObject) treeObject;
   					ApplicationComponentEditor editor = mpcto.activeEditor(false);
   					editor.launchBuilder(forceInstall, forceClean);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to open the mobile builder!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 21
Project: BiglyBT   File: ShellDocker.java   Source Code and License 5 votes vote down vote up
public ShellDocker(Control anchorControl, Shell dockedShell) {
	if (null == anchorControl || anchorControl.isDisposed()) {
		throw new NullPointerException("anchorControl cannot be null or disposed");
	}
	if (null == dockedShell || dockedShell.isDisposed()) {
		throw new NullPointerException("dockedShell cannot be null or disposed");
	}

	this.anchorControl = anchorControl;
	this.dockedShell = dockedShell;
	mainShell = anchorControl.getShell();
}
 
Example 22
Project: Hydrograph   File: ConfirmCancelMessageBox.java   Source Code and License 5 votes vote down vote up
private void createMessageBox(){
	Shell shell=container.getShell();
	int style = SWT.APPLICATION_MODAL | SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION;
	messageBox = new MessageBox(shell,style);
	messageBox.setText("Confirm"); //$NON-NLS-1$
	messageBox.setMessage(Messages.MessageBeforeClosingWindow);
}
 
Example 23
Project: AppleCommander   File: SwtUtil.java   Source Code and License 5 votes vote down vote up
/**
 * Display a dialog box with the error icon and only the ok button.
 */
public static void showErrorDialog(Shell shell, String title, String message) {
	MessageBox messageBox = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
	messageBox.setText(title);
	messageBox.setMessage(message);
	messageBox.open();
}
 
Example 24
Project: BiglyBT   File: DownloadBar.java   Source Code and License 5 votes vote down vote up
public static DownloadBar open(DownloadManager download, Shell main) {
	DownloadBar result = (DownloadBar)manager.getMiniBarForObject(download);
	if (result == null) {
		result = new DownloadBar(download, main);
	}
	return result;
}
 
Example 25
Project: ide-plugins   File: PluginDialog.java   Source Code and License 5 votes vote down vote up
public PluginDialog(Shell shell) {
    super(shell);
    this.display = Display.getDefault();
    
    fontName = display.getSystemFont().getFontData()[0].getName();
    backColor = new Color(display, 244, 244, 244);
    rowColorSelection = display.getSystemColor(SWT.COLOR_WHITE);
    titleFont = new Font(display, fontName, getTitleFontSize(), SWT.NORMAL);
    topFont = new Font(display, fontName, getTopFontSize(), SWT.NORMAL);
}
 
Example 26
Project: eclipse-jenkins-editor   File: JenkinsEditorMessageDialogSupport.java   Source Code and License 5 votes vote down vote up
public void showWarning(String message) {
	EclipseUtil.safeAsyncExec(new Runnable() {

		@Override
		public void run() {
			Shell shell = getActiveWorkbenchShell();
			MessageDialog.openWarning(shell, JENKINS_EDITOR, message);
		}

	});

}
 
Example 27
Project: Hydrograph   File: LookupMapDialog.java   Source Code and License 5 votes vote down vote up
/**
 * Create the Lookup mapping dialog.
 * 
 * @param parentShell
 * @wbp.parser.constructor
 */@Deprecated
public LookupMapDialog(Shell parentShell) {
	super(parentShell);
	
	setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL
			| SWT.RESIZE);
}
 
Example 28
Project: gw4e.project   File: FilterTests.java   Source Code and License 5 votes vote down vote up
private void resetWorkbench() {
	try {
		IViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getViewReferences();
		for (IViewReference iViewReference : views) {
			 if ( iViewReference.getTitle().equals( "Welcome" ) ) {
				 	iViewReference.getPage().hideView(iViewReference);
					break;
			}
		}
		
		IWorkbench workbench = PlatformUI.getWorkbench();
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
		IWorkbenchPage page = workbenchWindow.getActivePage();
		Shell activeShell = Display.getCurrent().getActiveShell();
		if ( activeShell != null && activeShell != workbenchWindow.getShell() ) {
			activeShell.close();
		}
		page.closeAllEditors( false );
		page.resetPerspective();
		String defaultPerspectiveId = workbench.getPerspectiveRegistry().getDefaultPerspective();
		workbench.showPerspective( defaultPerspectiveId, workbenchWindow );
		page.resetPerspective();
	}
	catch ( WorkbenchException e ) {
		throw new RuntimeException( e );
	}

}
 
Example 29
Project: neoscada   File: ConfirmationDialogFuture.java   Source Code and License 5 votes vote down vote up
protected void openDialog ( final Display display, final Shell parentShell, final Callback[] callbacks, final String dialogTitle )
{
    try
    {
        for ( final Callback cb : callbacks )
        {
            if ( cb instanceof ConfirmationCallback )
            {
                final Boolean result = showDialog ( (ConfirmationCallback)cb, display, parentShell, dialogTitle );
                if ( result == null )
                {
                    setError ( new CancellationException ( "Cancelled by user request" ) );
                }
                else
                {
                    ( (ConfirmationCallback)cb ).setValue ( result );
                }
            }
            else
            {
                cb.cancel ();
            }
        }

        setResult ( callbacks );
    }
    catch ( final Exception e )
    {
        setError ( e );
    }
}
 
Example 30
Project: convertigo-eclipse   File: MyAbstractAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
	MessageDialog.openInformation(
		shell,
		"Convertigo Plug-in",
		"The choosen operation is not yet implemented : '"+ action.getId() + "'.");
	
	shell.setCursor(null);
	waitCursor.dispose();
}
 
Example 31
Project: SWET   File: TipDayEx.java   Source Code and License 5 votes vote down vote up
public static void main(final String[] args) {
	final Display display = new Display();
	final Shell shell = new Shell(display);
	Locale.setDefault(Locale.ENGLISH);
	final TipDayEx tipDayEx = new TipDayEx();

	String yamlFile = String.format("%s/src/main/resources/%s",
			System.getProperty("user.dir"), "help.yaml");
	help = YamlHelper.loadHelp(yamlFile);
	for (Entry<String, String> helpdata : help.entrySet()) {
		String title = helpdata.getKey();
		String description = helpdata.getValue();
		tipDayEx.addTip(String.format("<h4>%s</h4>%s", title, description));
	}
	if (tipDayEx.getTips().size() == 0) {
		for (String tipMessage : new String[] { "This is the first tip",
				"This is the second tip", "This is the third tip",
				"This is the forth tip", "This is the fifth tip" }) {
			tipDayEx.addTip(String.format(
					"<h4>%s</h4>" + "<b>%s</b> " + "<u>%s</u> " + "<i>%s</i> " + "%s "
							+ "%s<br/>" + "<p color=\"#A00000\">%s</p>",
					tipMessage, tipMessage, tipMessage, tipMessage, tipMessage,
					tipMessage, tipMessage));

		}
	}

	tipDayEx.open(shell, display);
	display.dispose();
}
 
Example 32
Project: convertigo-eclipse   File: DisableStatementAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			DatabaseObjectTreeObject treeObject = null;
   			Statement statement = null;
   			
   			TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
			for (int i = treeObjects.length-1 ; i>=0  ; i--) {
				treeObject = (DatabaseObjectTreeObject) treeObjects[i];
				if (treeObject instanceof StatementTreeObject) {
					StatementTreeObject statementTreeObject = (StatementTreeObject)treeObject;
					statement = (Statement)statementTreeObject.getObject();
					statement.setEnabled(false);
					
					statementTreeObject.setEnabled(false);
					statementTreeObject.hasBeenModified(true);				
				}
			}
			
			explorerView.refreshSelectedTreeObjects();
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to disable statement!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 33
Project: BiglyBT   File: ManagerUtils.java   Source Code and License 5 votes vote down vote up
public static void
locateFiles(
	final DownloadManager[]		dms,
	Shell						shell )
{
	locateFiles( dms, null, shell );
}
 
Example 34
Project: avro-schema-editor   File: OpenPreferencesShellAction.java   Source Code and License 5 votes vote down vote up
@Override
public void run() {		
	
	Point location = MouseInfo.getPointerInfo().getLocation();
	Rectangle bounds = new Rectangle(location.x, location.y, 250, 250);
	
	Shell shell = Display.getDefault().getActiveShell();
	SchemaViewerPreferencesDialog dialog = new SchemaViewerPreferencesDialog(shell, bounds, serviceProvider);		
	dialog.open();				
}
 
Example 35
Project: convertigo-eclipse   File: ClipboardCopyAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
       
	try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			String sXml;
   			if (explorerView.isEditing()) {
   				sXml = explorerView.getEditingText();
   			}
   			else {
    			// copy to clipboard manager
   				sXml = copy(explorerView);
   			}
   			
  				// copy to system clipboard
   			if (sXml != null) {
      				Clipboard clipboard = new Clipboard(display);
      				TextTransfer textTransfer = TextTransfer.getInstance();
      				clipboard.setContents(new String[]{sXml}, new Transfer[]{textTransfer});
      				clipboard.dispose();
   			}
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to copy!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 36
Project: network-device-panel   File: DevicePanel.java   Source Code and License 5 votes vote down vote up
/**
 * Create the dialog.
 *
 * @param parentShell
 */
public DevicePanel(Shell parentShell, String nodeid, String lab) {
	super(parentShell);
	this.nodeid = nodeid;
	setShellStyle(SWT.MAX | SWT.RESIZE);

}
 
Example 37
Project: Hydrograph   File: DisposeSchemaGridListener.java   Source Code and License 5 votes vote down vote up
@Override
public void mouseAction(PropertyDialogButtonBar propertyDialogButtonBar,
		ListenerHelper helpers, Event event, Widget... widgets) {
	   Table table=(Table)event.widget;
	   Shell tip=(Shell) table.getData("tip");
	   Label label=(Label) table.getData("label");
	if(tip!=null) 
	{
	 tip.dispose();
        tip = null;
        label = null;
	}
}
 
Example 38
Project: BiglyBT   File: ConfigShell.java   Source Code and License 5 votes vote down vote up
private Shell getMainShell() {
	UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
	if (null != uiFunctions) {
		return uiFunctions.getMainShell();
	}

	throw new IllegalStateException(
			"No instance of UIFunctionsSWT found; the UIFunctionsManager might not have been initialized properly");

}
 
Example 39
Project: Hydrograph   File: CommentBoxEditor.java   Source Code and License 5 votes vote down vote up
private void createCommentBoxShell(org.eclipse.swt.graphics.Rectangle commentBoxEditorBounds) {
	shell = new Shell(getParent(), SWT.NONE);
	shell.setBounds(commentBoxEditorBounds);
	GridLayout gl_shell = new GridLayout(1, false);
	gl_shell.verticalSpacing = 0;
	gl_shell.marginWidth = 0;
	gl_shell.marginHeight = 0;
	gl_shell.horizontalSpacing = 0;
	shell.setLayout(gl_shell);
}
 
Example 40
Project: convertigo-eclipse   File: TestCaseImportRequestableVariablesAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			Object databaseObject = treeObject.getObject();
   			if ((databaseObject != null) && (databaseObject instanceof TestCase)) {
   				TestCase testCase = (TestCase)databaseObject;
   				testCase.importRequestableVariables((RequestableObject)testCase.getParent());
   				if (testCase.hasChanged) {
   					explorerView.reloadTreeObject(treeObject);
					StructuredSelection structuredSelection = new StructuredSelection(treeObject);
					ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to add requestable variables to test case!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 41
Project: convertigo-eclipse   File: StepImportSequenceVariablesAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			Object databaseObject = treeObject.getObject();
   			if ((databaseObject != null) && (databaseObject instanceof SequenceStep)) {
   				SequenceStep sequenceStep = (SequenceStep)databaseObject;
   				sequenceStep.importVariableDefinition();
   				if (sequenceStep.hasChanged) {
   					explorerView.reloadTreeObject(treeObject);
					StructuredSelection structuredSelection = new StructuredSelection(treeObject);
					ConvertigoPlugin.getDefault().getPropertiesView().selectionChanged((IWorkbenchPart)explorerView, structuredSelection);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to add sequence variables to step!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 42
Project: AppleCommander   File: SwtAppleCommander.java   Source Code and License 5 votes vote down vote up
/**
 * Displays the unrecognized disk format message.
 * @param fullpath
 */
protected void showUnrecognizedDiskFormatMessage(String fullpath) {
	Shell finalShell = shell;
	MessageBox box = new MessageBox(finalShell, SWT.ICON_ERROR | SWT.OK);
	box.setText(textBundle.get("SwtAppleCommander.UnrecognizedFormatTitle")); //$NON-NLS-1$
	box.setMessage(
		  textBundle.format("SwtAppleCommander.UnrecognizedFormatMessage", //$NON-NLS-1$
		  		fullpath));
	box.open();
}
 
Example 43
Project: convertigo-eclipse   File: ClipboardCutAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
       
	try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			String sXml;
   			if (explorerView.isEditing()) {
   				sXml = explorerView.getEditingText();
   				explorerView.setEditingText("");
   			}
   			else {
    			// copy to clipboard manager
   				sXml = cut(explorerView);
   			}
   			
  				// copy to system clipboard
   			if (sXml != null) {
      				Clipboard clipboard = new Clipboard(display);
      				TextTransfer textTransfer = TextTransfer.getInstance();
      				clipboard.setContents(new String[]{sXml}, new Transfer[]{textTransfer});
      				clipboard.dispose();
   			}
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to cut!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 44
Project: convertigo-eclipse   File: TraceDeleteAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
       
	try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TraceTreeObject traceObject = (TraceTreeObject)explorerView.getFirstSelectedTreeObject();
   			
			MessageBox messageBox = new MessageBox(shell,SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
			String message = java.text.MessageFormat.format("Do you really want to delete the trace \"{0}\"?", new Object[] {traceObject.getName()});
        	messageBox.setMessage(message);
        	if (messageBox.open() == SWT.YES) {
        		File file = (File) traceObject.getObject();
        		if (file.exists()) {
        			if (file.delete()) {
        				TreeParent treeParent = traceObject.getParent();
        				treeParent.removeChild(traceObject);
        				explorerView.refreshTreeObject(treeParent);
        			}
        			else {
        				throw new Exception("Unable to delete file \""+ file.getAbsolutePath() + "\"");
        			}
        		}
        	}
   			
   		}
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to delete the trace file!");
	}
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 45
Project: Hydrograph   File: FieldDialog.java   Source Code and License 5 votes vote down vote up
public FieldDialog(Shell parentShell, PropertyDialogButtonBar propertyDialogButtonBar) {
	super(parentShell);

	propertyList = new ArrayList<FilterProperties>();
	fieldNameList = new ArrayList<String>();
	this.propertyDialogButtonBar = propertyDialogButtonBar;
	setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL | SWT.RESIZE);
}
 
Example 46
Project: neoscada   File: DetailViewDialog.java   Source Code and License 5 votes vote down vote up
public DetailViewDialog ( final Shell parentShell, final String id, final Map<String, String> properties )
{
    this.parentShell = parentShell;
    this.id = id;
    this.properties = new HashMap<String, String> ( properties );
    this.session = SessionManager.getDefault ().getSession ();
}
 
Example 47
Project: Hydrograph   File: ViewExecutionHistoryDataDialog.java   Source Code and License 5 votes vote down vote up
/**
 * Create the dialog.
 * @param parentShell
 */
public ViewExecutionHistoryDataDialog(Shell parentShell, ViewExecutionHistoryHandler viewExecutionHistoryHandler, List<Job> jobDetails) {
	super(parentShell);
	setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE);
	this.jobDetails = jobDetails;
	this.viewExecutionHistoryHandler=viewExecutionHistoryHandler;
}
 
Example 48
Project: avro-schema-editor   File: SchemaViewerPreferencesDialog.java   Source Code and License 5 votes vote down vote up
@Override
protected void configureShell(Shell shell) {
	shell.setText("Schema Viewer Preferences");
	shell.setImage(AvroSchemaEditorActivator.getImage(AvroSchemaEditorImages.CONFIGURE));		
	shell.setBounds(bounds);
	super.configureShell(shell);
}
 
Example 49
Project: convertigo-eclipse   File: SequenceExecuteSelectedFromStubAction.java   Source Code and License 5 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			if ((treeObject != null) && (treeObject instanceof SequenceTreeObject)) {
   				
   				SequenceTreeObject sequenceTreeObject = (SequenceTreeObject)treeObject;
   				openEditors(explorerView, sequenceTreeObject);
   				
   				Sequence sequence = sequenceTreeObject.getObject();
   				ProjectTreeObject projectTreeObject = sequenceTreeObject.getProjectTreeObject();
   				SequenceEditor sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
   				if (sequenceEditor != null) {
   					getActivePage().activate(sequenceEditor);
   					sequenceEditor.getDocument(sequence.getName(), true);
   				}
   			}
   		}
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to execute the selected sequence!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 50
Project: CS360proj1   File: ViewGUI.java   Source Code and License 4 votes vote down vote up
public void actionPerformed(ActionEvent arg0) {
			
			//Test URL string for window
			//String url = "https://maps.googleapis.com/maps/api/staticmap?&size=500x500&markers=size:small%7ccolor:green%7cHammond+Gavit+High+School,IN&markers=size:small%7ccolor:blue%7clabel:S%7c41.5762616,-87.4875017%7c41.5545436,-87.5048099%7c41.5481653,-87.45544319999999%7c41.5864118,-87.4398167%7c41.60522599999999,-87.509568%7c41.6283089,-87.491937%7c41.6179983,-87.5235321%7c41.5327164,-87.436207%7c41.59385,-87.4078595%7c41.6403209,-87.4853127%7c41.5476375,-87.4092115%7c41.5977957,-87.39227699999999%7c41.6782559,-87.50683839999999%7c&maptype=roadmap";
			
			//Readme instructions for user(LEGEND)
			
			String message="Welcome to the map view!\n The host School"
					+ " is marked with a green label"
					+ " and \n the other schools in the sectional are marked "
					+ " with blue labels on the map.  ";
			JOptionPane.showMessageDialog(null, message);
			
			
			//build new MapBuilder Obj
			MapBuilder map = new MapBuilder(currentSect.getHostSchool(),currentSect.getSchools());
			
			map.BuildURL();
			
			String url = map.getFinalURL();

			Display display = new Display();
			
	        Shell shell = new Shell(display);
	        shell.setSize(552, 575);
	        
	        new MapGUI(shell, SWT.NONE, url);

//	         the layout manager handle the layout
//	         of the widgets in the container
	        shell.setLayout(new FillLayout());

	        //add some widgets to the Shell
	        shell.open();
	        while (!shell.isDisposed()) {
	            if (!display.readAndDispatch()) {
	                display.sleep();
	            }
	        }
	        display.dispose();			
		}
 
Example 51
Project: convertigo-eclipse   File: SqlConnectorDesignComposite.java   Source Code and License 4 votes vote down vote up
protected void createSqlTransactions(final TableItem[] items) {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	Shell shell = display.getActiveShell();
	if (shell != null) {
		try {
			shell.setCursor(waitCursor);
			for (int i=0; i < items.length; i++) {
				TableItem item = items[i];
				String callableName = item.getText(0);
				String callableDesc = item.getText(1);
				String specific_name = (String) item.getData("specific_name");
				ConvertigoPlugin.logDebug("Creating transaction for CALL '"+callableName+"' ...");
				
				if (specific_name.isEmpty()) {
					specific_name = callableName;
				}
				
				SqlTransaction sqlTransaction = SqlConnector.createSqlTransaction(sqlConnector, callableName, specific_name);
				if (sqlTransaction != null) {
					Transaction transaction = sqlConnector.getTransactionByName(sqlTransaction.getName());
					if (transaction != null) {
						try {
							File xsdFile = new File(transaction.getSchemaFilePath());
							if (xsdFile.exists()) {
								xsdFile.delete();
							}
						}
						catch (Exception e) {}
						sqlConnector.remove(transaction);			
					}
					sqlTransaction.setComment(callableDesc);
					sqlConnector.add(sqlTransaction);
					fireObjectChanged(new CompositeEvent(sqlConnector));
					ConvertigoPlugin.logDebug("Transaction added.");
				}
			}
		} catch (Exception ee) {
			ConvertigoPlugin.logException(ee, "Error while creating transaction(s)");
		} finally {
			shell.setCursor(null);
			waitCursor.dispose();
		}
	}
}
 
Example 52
Project: convertigo-eclipse   File: StatementAddVariableToTransactionAction.java   Source Code and License 4 votes vote down vote up
public void run() {
	Display display = Display.getDefault();
	Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);		
	
	Shell shell = getParentShell();
	shell.setCursor(waitCursor);
	
       try {
   		ProjectExplorerView explorerView = getProjectExplorerView();
   		if (explorerView != null) {
   			TreeObject treeObject = explorerView.getFirstSelectedTreeObject();
   			Object databaseObject = treeObject.getObject();
   			if ((databaseObject != null) && (databaseObject instanceof HTTPStatement)) {
   				HTTPStatement httpStatement = (HTTPStatement)databaseObject;
   				HtmlTransaction htmlTransaction = (HtmlTransaction)httpStatement.getParentTransaction();
   				
   				List<String> variables = new ArrayList<String>();
   				int i, size;
   				
   				/*size = htmlTransaction.getVariablesDefinitionSize();
   				for (i = 0 ; i < size ; i++) {
   					variables.add(htmlTransaction.getVariableDefinitionHttpName(i));
   				}*/
   				size = htmlTransaction.numberOfVariables();
   				for (i = 0 ; i < size ; i++) {
   					RequestableHttpVariable httpVariable = (RequestableHttpVariable)htmlTransaction.getVariable(i);
   					variables.add(httpVariable.getHttpName());
   				}
   				
   				String variableName, variableDescription, variableMethod;
   				Boolean variableType, variableRequired;
   				Object variableValue;
   				int variableVisibility;
   				size = httpStatement.numberOfVariables();
   				for (i = 0 ; i < size ; i++) {
   					HttpStatementVariable httpStatementVariable = (HttpStatementVariable)httpStatement.getVariable(i);
   					if (httpStatementVariable != null) {
       					variableName = httpStatementVariable.getName();
       					variableDescription = httpStatementVariable.getDescription();
       					variableRequired = httpStatementVariable.isRequired();
       					variableValue = httpStatementVariable.getValueOrNull();
       					variableType = httpStatementVariable.isMultiValued();
       					variableMethod = httpStatementVariable.getHttpMethod();
       					variableVisibility = httpStatementVariable.getVisibility();
       					
       					if (!variables.contains(variableName)) {
       						RequestableHttpVariable requestableVariable = (variableType ? new RequestableHttpMultiValuedVariable():new RequestableHttpVariable());
       						requestableVariable.setName(variableName);
       						requestableVariable.setDescription(variableDescription);
       						requestableVariable.setRequired(variableRequired);
       						requestableVariable.setValueOrNull(variableValue);
       						requestableVariable.setWsdl(Boolean.TRUE);
       						requestableVariable.setPersonalizable(Boolean.FALSE);
       						requestableVariable.setCachedKey(Boolean.TRUE);
       						requestableVariable.setHttpMethod(variableMethod);
       						requestableVariable.setHttpName("");
       						requestableVariable.setVisibility(variableVisibility);
       						
       						requestableVariable.bNew = true;
       						requestableVariable.hasChanged = true;
       						
       						htmlTransaction.add(requestableVariable);
       					}
   					}
   				}
   				
				htmlTransaction.hasChanged = true;
				
				explorerView.reloadDatabaseObject(htmlTransaction);
   			}
   		}
       	
       }
       catch (Throwable e) {
       	ConvertigoPlugin.logException(e, "Unable to add HTTP variables to transaction!");
       }
       finally {
		shell.setCursor(null);
		waitCursor.dispose();
       }
}
 
Example 53
Project: Hydrograph   File: XMLTextContainer.java   Source Code and License 4 votes vote down vote up
/**
 * Launches the component property editor window for Unknown components. It is used to display XML content of Unknown
 * components on property window.
 * 
 * @return XML content of component. 
 */

public String launchXMLTextContainerWindow() {
	try{
		String xmlText = this.xmlText;
		Shell shell = new Shell(Display.getDefault().getActiveShell(), SWT.WRAP | SWT.MAX | SWT.APPLICATION_MODAL);

		shell.setLayout(new GridLayout(1, false));
		shell.setText("XML Content");
		shell.setSize(439, 432);
		text = new Text(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
		text.setEditable(false);
		text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 250, 250, 250));
		if (this.xmlText != null) {
			xmlText = xmlText.substring(xmlText.indexOf('\n') + 1);
			xmlText = xmlText.substring(xmlText.indexOf('\n') + 1, xmlText.lastIndexOf('\n') - 13);

			text.setText(xmlText);
		} else
			text.setText(Messages.EMPTY_XML_CONTENT);
		GridData gd_text = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
		gd_text.widthHint = 360;
		gd_text.heightHint = 360;
		text.setLayoutData(gd_text);

		Monitor primary = shell.getDisplay().getPrimaryMonitor();
		Rectangle bounds = primary.getBounds();
		Rectangle rect = shell.getBounds();

		int x = bounds.x + (bounds.width - rect.width) / 2;
		int y = bounds.y + (bounds.height - rect.height) / 2;

		shell.setLocation(x, y);
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!shell.getDisplay().readAndDispatch()) {
				shell.getDisplay().sleep();
			}
		}
	}catch(Exception e)
	{
		LOGGER.error("Error occurred while creating XML text container widget", e);
	}
	return getXmlText();
}
 
Example 54
Project: BiglyBT   File: ManagerUtils.java   Source Code and License 4 votes vote down vote up
public static void stop(final DownloadManager dm, final Shell shell,
		final int stateAfterStopped) {
	if (dm == null) {
		return;
	}

	int state = dm.getState();

	if (state == DownloadManager.STATE_STOPPED
			|| state == DownloadManager.STATE_STOPPING
			|| state == stateAfterStopped) {
		
		if ( !dm.isPaused()){
			return;
		}
	}

	boolean stopme = true;
	if (state == DownloadManager.STATE_SEEDING) {

		if (dm.getStats().getShareRatio() >= 0
				&& dm.getStats().getShareRatio() < 1000
				&& COConfigurationManager.getBooleanParameter("Alert on close", false)) {
			if (!Utils.isThisThreadSWT()) {
				Utils.execSWTThread(new AERunnable() {
					@Override
					public void runSupport() {
						stop(dm, shell, stateAfterStopped);
					}
				});
				return;
			}
			Shell aShell = shell == null ? Utils.findAnyShell() : shell;
			MessageBox mb = new MessageBox(aShell, SWT.ICON_WARNING
					| SWT.YES | SWT.NO);
			mb.setText(MessageText.getString("seedmore.title"));
			mb.setMessage(MessageText.getString("seedmore.shareratio")
					+ (dm.getStats().getShareRatio() / 10) + "%.\n"
					+ MessageText.getString("seedmore.uploadmore"));
			int action = mb.open();
			stopme = action == SWT.YES;
		}
	}

	if (stopme) {
		asyncStop(dm, stateAfterStopped);
	}
}
 
Example 55
Project: applecommander   File: ExportFileDestinationPane.java   Source Code and License 4 votes vote down vote up
protected Shell getShell() {
	return control.getShell();
}
 
Example 56
Project: scanning   File: ModelDialog.java   Source Code and License 4 votes vote down vote up
public ModelDialog(Shell parentShell) {
	super(parentShell);
}
 
Example 57
Project: BiglyBT   File: ProgressWindow.java   Source Code and License 4 votes vote down vote up
public
ProgressWindow(
	Shell		_parent,
	String		_resource,
	int			_style,
	int			_delay_millis )
{
	resource = _resource;

	final Shell shell = new Shell( _parent, _style );

	if ( _delay_millis <= 0 ){

		showDialog( shell, null );

	}else{

		new DelayedEvent(
				"ProgWin",
				_delay_millis,
				new AERunnable()
				{
					@Override
					public void
					runSupport()
					{
						if ( !task_complete ){

							Utils.execSWTThread(
								new Runnable()
								{
									@Override
									public void
									run()
									{
										synchronized( ProgressWindow.this ){

											if ( !task_complete ){

												showDialog( shell, null );
											}
										}
									}
								},
								false );
						}
					}
				});
	}
}
 
Example 58
Project: com.onpositive.prefeditor   File: NewPlatformPreferenceDialog.java   Source Code and License 4 votes vote down vote up
public NewPlatformPreferenceDialog(Shell parentShell, String initialParent,
		String[] possibleParents) {
	super(parentShell, processInitialParent(initialParent), processParents(possibleParents));
	this.scope = getScope(initialParent);
}
 
Example 59
Project: BiglyBT   File: SkinnedDialog.java   Source Code and License 4 votes vote down vote up
public SkinnedDialog(String skinFile, String shellSkinObjectID, Shell parent, int style) {
	this(SkinnedDialog.class.getClassLoader(), "com/biglybt/ui/skin/",
			skinFile, shellSkinObjectID, parent, style);
}
 
Example 60
Project: APITools   File: ShortcutKeyExplain.java   Source Code and License 4 votes vote down vote up
public ShortcutKeyExplain(Shell parent, int style) {
	super(parent, style);
	setText("快捷键");
	logger.info("进入快捷键说明");
}