当前位置: 首页>>代码示例>>Java>>正文


Java SWT.CLOSE属性代码示例

本文整理汇总了Java中org.eclipse.swt.SWT.CLOSE属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.CLOSE属性的具体用法?Java SWT.CLOSE怎么用?Java SWT.CLOSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.swt.SWT的用法示例。


在下文中一共展示了SWT.CLOSE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 */
private void createShell(Shell parentShell, MugglClassLoader classLoader) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Options");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));
	
	final Image small = new Image(shell.getDisplay(),
	        OptionsWindow.class.getResourceAsStream("/images/tray_small.png"));
	final Image large = new Image(shell.getDisplay(),
			OptionsWindow.class.getResourceAsStream("/images/tray_large.png"));
	this.shell.setImages(new Image[] { small, large });
	
	// No need to read it later, so it is not assigned to a variable.
	new OptionsComposite(this, this.shell, SWT.NONE, classLoader);

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:26,代码来源:OptionsWindow.java

示例2: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parent The Composite which this Window is invoked by.
 * @param method The Method thats' parameters will be defined in this Window.
 */
private void createShell(FileSelectionComposite parent, Method method) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(
			Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR
			+ "Method Parameters and Variable Generators for " + method.getFullNameWithParameterTypesAndNames());
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));

	new MethodParametersComposite(parent, this, this.shell, this.display, SWT.NONE, method);

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parent.getShell());
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:21,代码来源:MethodParametersWindow.java

示例3: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param arrayModificationHandler The ArrayModificationHandler the holds the represented array.
 * @param myDimension The dimension of a probably multidimensional array this Window represents.
 * @param dimensionsIndexes Dimension indexes of the higher-level dimensions the array represented might be a part of.
 */
private void createShell(ArrayModificationHandler arrayModificationHandler, int myDimension, int[] dimensionsIndexes) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Array Entries");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));

	// Initialize the composite.
	new ArrayEntriesComposite(this, this.shell, this.display, SWT.NONE, arrayModificationHandler, myDimension, dimensionsIndexes);

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, this.parent.getShell());
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:21,代码来源:ArrayEntriesWindow.java

示例4: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param className The name of the class to inspect.
 * @param classFile The ClassFile to inspect.
 */
private void createShell(Shell parentShell, String className, ClassFile classFile) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Class File Inspection");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));

	// No need to read it later, so it is not assigned to a variable.
	new ClassInspectionComposite(this, this.shell, this.display, SWT.NONE, className, classFile);

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:21,代码来源:ClassInspectionWindow.java

示例5: FilterAdvancedComposite

public FilterAdvancedComposite ( final FilterChangedListener filterChangedListener, final Composite parent, final int style )
{
    // fields
    super ( parent, style );

    // widgets
    this.tabFolder = new CTabFolder ( this, SWT.TOP | SWT.BORDER | SWT.CLOSE );
    this.addOrConditionButton = creteAddOrConditionButton ();
    addOrCondition ();

    // layout
    final GridLayout layout = new GridLayout ( 1, true );
    layout.marginLeft = 6;
    layout.marginRight = 6;
    layout.marginTop = 6;
    layout.marginBottom = 6;
    layout.verticalSpacing = 12;
    this.setLayout ( layout );

    final GridData tabFolderLayoutData = new GridData ();
    tabFolderLayoutData.horizontalAlignment = GridData.FILL;
    tabFolderLayoutData.grabExcessHorizontalSpace = true;
    tabFolderLayoutData.verticalAlignment = GridData.FILL;
    tabFolderLayoutData.grabExcessVerticalSpace = true;
    this.tabFolder.setLayoutData ( tabFolderLayoutData );
    this.tabFolder.setBackgroundMode ( SWT.INHERIT_FORCE );

    final GridData addOrConditionButtonLayoutdata = new GridData ();
    addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END;
    this.addOrConditionButton.setLayoutData ( addOrConditionButtonLayoutdata );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:FilterAdvancedComposite.java

示例6: showSaveError

/**
 * Display the Save error dialog box.
 * @see #save
 * @see #saveAs
 */
protected void showSaveError(IOException ex) {
	Shell finalShell = shell;
	String errorMessage = ex.getMessage();
	if (errorMessage == null) {
		errorMessage = ex.getClass().getName();
	}
	MessageBox box = new MessageBox(finalShell, 
		SWT.ICON_ERROR | SWT.CLOSE);
	box.setText(textBundle.get("SaveDiskImageErrorTitle")); //$NON-NLS-1$
	box.setMessage(textBundle.format("SaveDiskImageErrorMessage", //$NON-NLS-1$
			new Object[] { getDisk(0).getFilename(), errorMessage }));
	box.open();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:18,代码来源:DiskExplorerTab.java

示例7: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param classPathEntries The class path entries.
 */
private void createShell(List<String> classPathEntries) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Class Path Entries");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));

	new ClassPathEntriesComposite(this, this.shell, this.display, SWT.NONE, classPathEntries);

	// Compute the needed size.
	Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
	point.x += 2;
	point.y += 2;
	int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, this.parent.getShell());
	this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:18,代码来源:ClassPathEntriesWindow.java

示例8: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 */
private void createShell() {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE
			+ Globals.WINDOWS_TITLE_CONNECTOR + "Select ");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:9,代码来源:GeneratorSelectionWindow.java

示例9: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 * @param classFile The classFile the initial Method belongs to.
 * @param method The initial Method.
 * @return true, if the shell could be setup properly, false otherwise.
 */
private boolean createShell(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Step by Step Execution");
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));
	try {
		// Compute and set the needed size. As there might be a MessageBox displayed, this has to be done now!
		Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		point.x += 2;
		point.y += 2;
		int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
		this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);

		// Show the composite.
		this.stepByStepExecutionComposite = new StepByStepExecutionComposite(this, this.shell, this.display, SWT.NONE, classLoader, classFile, method);

		// Compute and set the needed size.
		point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		point.x += 2;
		point.y += 2;
		posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
		this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
		return true;
	} catch (GUIException e) {
		// Only one (user-caused) exception will not be displayed for the user. In all other cases generate a message box to inform him what has happened.
		if (!e.getMessage().contains("Do not show this window!")) {
			StaticGuiSupport.showMessageBox(parentShell, "Error", "The step by step execution window could not be loaded.\n\nThe root cause is:\n" + e.getMessage(), SWT.OK | SWT.ICON_ERROR);
		}
		doExit();
		return false;
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:39,代码来源:StepByStepExecutionWindow.java

示例10: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 *
 * @throws IllegalStateException If the parent shell is unusable (null or disposed).
 */
private void createShell() {
	// Lock the parent shell for this operation.
	if (this.parentShell != null) {
		synchronized (this.parentShell) {
			if (this.parentShell.isDisposed()) {
				throw new IllegalStateException("The parent shell is unusable.");
			}

			// Continue building this shell.
			this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN | SWT.RESIZE);
			this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Log...");
			this.shell.setLayout(new FillLayout(SWT.VERTICAL));

			// No need to read it later, so it is not assigned to a variable.
			new LogComposite(this, this.shell, this.display, SWT.NONE);

			// Compute the needed size.
			Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
			point.x += 2;
			point.y += 2;
			int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, this.parentShell);
			this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
		}
	} else {
		throw new IllegalStateException("The parent shell is unusable.");
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:32,代码来源:LogWindow.java

示例11: createUnformattedViewTabItem

/**
 * 
 * Create unformatted view tab in data viewer tab folder
 * 
 */
public void createUnformattedViewTabItem() {
	if (isViewTabExist(Views.UNFORMATTED_VIEW_NAME)) {
		CTabItem item = getViewTabItem(Views.UNFORMATTED_VIEW_NAME);
		tabFolder.setSelection(item);
		dataViewLoader.reloadloadViews();
		return;
	}

	CTabItem tbtmUnformattedView = new CTabItem(tabFolder, SWT.CLOSE);
	tbtmUnformattedView.setData(Views.VIEW_NAME_KEY, Views.UNFORMATTED_VIEW_NAME);
	tbtmUnformattedView.setText(Views.UNFORMATTED_VIEW_DISPLAY_NAME);
	{
		Composite composite = new Composite(tabFolder, SWT.NONE);
		tbtmUnformattedView.setControl(composite);
		composite.setLayout(new GridLayout(1, false));
		{
			unformattedViewTextarea = new StyledText(composite, SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL
					| SWT.H_SCROLL);
			unformattedViewTextarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		}
	}

	tabFolder.setSelection(tbtmUnformattedView);
	dataViewLoader.setUnformattedViewTextarea(unformattedViewTextarea);
	dataViewLoader.reloadloadViews();
	actionFactory.getAction(SelectColumnAction.class.getName()).setEnabled(false);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:DebugDataViewer.java

示例12: createFormatedViewTabItem

/**
 * 
 * Create formatted view tab in data viewer tab folder
 * 
 */
public void createFormatedViewTabItem() {
	if (isViewTabExist(Views.FORMATTED_VIEW_NAME)) {
		CTabItem item = getViewTabItem(Views.FORMATTED_VIEW_NAME);
		tabFolder.setSelection(item);
		dataViewLoader.reloadloadViews();
		return;
	}

	CTabItem tbtmFormattedView = new CTabItem(tabFolder, SWT.CLOSE);
	tbtmFormattedView.setData(Views.VIEW_NAME_KEY, Views.FORMATTED_VIEW_NAME);
	tbtmFormattedView.setText(Views.FORMATTED_VIEW_DISPLAYE_NAME);
	{
		Composite composite = new Composite(tabFolder, SWT.NONE);
		tbtmFormattedView.setControl(composite);
		composite.setLayout(new GridLayout(1, false));
		{
			formattedViewTextarea = new StyledText(composite, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL
					| SWT.V_SCROLL);
			formattedViewTextarea.setFont(SWTResourceManager.getFont("Courier New", 9, SWT.NORMAL));
			formattedViewTextarea.setEditable(false);
			formattedViewTextarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		}
	}
	tabFolder.setSelection(tbtmFormattedView);
	dataViewLoader.setFormattedViewTextarea(formattedViewTextarea);
	dataViewLoader.reloadloadViews();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:32,代码来源:DebugDataViewer.java

示例13: showInvalidJavaHomeDialogAndExit

private static void showInvalidJavaHomeDialogAndExit() {
	logger.debug("Showing dialog for invalid JAVA_HOME");
	MessageBox box=new MessageBox(new Shell(),SWT.ICON_ERROR|SWT.CLOSE);
	box.setText("Invalid JAVA_HOME entry");
	box.setMessage("Invalid JAVA_HOME ("+System.getenv(JAVA_HOME)+") entry. Please update JAVA_HOME environment variable and relaunch tool again");
	box.open();
	System.exit(0);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:8,代码来源:PreStartActivity.java

示例14: Preferences

public Preferences(Shell parent) {
    super(parent);
    int style = SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL
            | getDefaultOrientation();
    style &= ~SWT.CLOSE;

    setShellStyle(style);

}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:9,代码来源:Preferences.java

示例15: createShell

/**
 * Create the Shell, setting up any elements that are not set up by the main Composite.
 * @param parentShell The parent windows' Shell.
 * @param classLoader The system MugglClassLoader.
 * @param classFile The classFile the initial Method belongs to.
 * @param method The initial Method.
 * @return true, if the shell could be setup properly, false otherwise.
 */
private boolean createShell(Shell parentShell, MugglClassLoader classLoader, ClassFile classFile, Method method) {
	this.shell = new Shell(this.display, SWT.BORDER | SWT.CLOSE | SWT.TITLE | SWT.MIN);
	this.shell.setText(Globals.WINDOWS_TITLE + Globals.WINDOWS_TITLE_CONNECTOR + "Execution of " + method.getFullName());
	this.shell.setLayout(new FillLayout(SWT.VERTICAL));

	final Image small = new Image(shell.getDisplay(),
			ExecutionWindow.class.getResourceAsStream("/images/tray_small.png"));
	final Image large = new Image(shell.getDisplay(),
			ExecutionWindow.class.getResourceAsStream("/images/tray_large.png"));
	this.shell.setImages(new Image[] { small, large });
	
	/*
	 * Listen for close events.
	 */
	this.shell.addListener(SWT.Close, new Listener() {
		public void handleEvent(Event event) {
	    	/*
			 * Make sure the execution is aborted right now. Children windows might still be
			 * opened and will inhibit running the finally block of the show-method.Make sure
			 * the execution is aborted right now. Children windows might still be opened and
			 * will
			 */
	    	if (ExecutionWindow.this.executionComposite != null)
	    		ExecutionWindow.this.executionComposite.abortExecution();

	    	// Close the window.
	        doExit();
	      }
	    });

	try {
		// Compute and set the needed size. As there might be a MessageBox displayed, this has to be done now!
		Point point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		point.x += 2;
		point.y += 2;
		int[] posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
		this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);

		// Show the composite.
		this.executionComposite = new ExecutionComposite(this, this.shell, this.display, SWT.NONE, classLoader, classFile, method);

		// Compute and set the needed size.
		point = this.shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		point.x += 2;
		point.y += 2;
		posXY = StaticGuiSupport.getCenteredPosition(point.x, point.y, parentShell);
		this.shell.setBounds(posXY[0], posXY[1], point.x, point.y);
		return true;
	} catch (GUIException e) {
		// Only one (user-caused) exception will not be displayed for the user. In all other cases generate a message box to inform him what has happened.
		if (!e.getMessage().contains("Do not show this window!")) {
			StaticGuiSupport.showMessageBox(parentShell, "Error", "The step by step execution window could not be loaded.\n\nThe root cause is:\n" + e.getMessage(), SWT.OK | SWT.ICON_ERROR);
		}
		doExit();
		return false;
	}
}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:65,代码来源:ExecutionWindow.java


注:本文中的org.eclipse.swt.SWT.CLOSE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。