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


Java IDialogConstants类代码示例

本文整理汇总了Java中org.eclipse.jface.dialogs.IDialogConstants的典型用法代码示例。如果您正苦于以下问题:Java IDialogConstants类的具体用法?Java IDialogConstants怎么用?Java IDialogConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createButtonsForButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Create");
    ok.setEnabled(false);
    setButtonLayoutData(ok);

    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        function.setFunctionName(null);
        function.setPackageName(null);
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:18,代码来源:FunctionSWT.java

示例2: createButtonsForButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Apply");
    ok.setEnabled(false);
    setButtonLayoutData(ok);
    
    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        if (futureTask != null && ! futureTask.isDone()) {
            futureTask.cancel(true);
        }
        code.setFunctionName(null);
        code.setFunctionGivenName(null);
        code.setResultType(null);
        code.setReturnedType(null);
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:23,代码来源:CodeSWT.java

示例3: redrawTables

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
private void redrawTables() {
    Table sourceTable = sourceTableViewer.getTable();
    sourceTable.setRedraw(false);
    clean(sourceTable);
    source.sort(Plugin::compareTo);
    sourceTableViewer.setInput(source);
    btnSelectAll.setEnabled(source.size() > 0);
    sourceTable.setRedraw(true);
    checkSelection(sourceTable);

    Table targetTable = targetTableViewer.getTable();
    targetTable.setRedraw(false);
    clean(targetTable);
    target.sort(Plugin::compareTo);
    targetTableViewer.setInput(target);
    btnDeselectAll.setEnabled(target.size() > 0);
    targetTable.setRedraw(true);
    checkSelection(targetTable);

    if (getButton(IDialogConstants.OK_ID) != null) {
        getButton(IDialogConstants.OK_ID).setEnabled(! targetOriginal.equals(target));
    }
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:24,代码来源:PluginsSWT.java

示例4: createButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = new Composite(parent, SWT.NONE);
    buttonBar.setBackground(backColor);
    		
    final GridLayout layout = new GridLayout();
    layout.marginLeft = 10;
    layout.numColumns = 2;
    layout.makeColumnsEqualWidth = false;
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    buttonBar.setLayout(layout);

    final GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    data.grabExcessHorizontalSpace = true;
    data.grabExcessVerticalSpace = false;
    buttonBar.setLayoutData(data);

    buttonBar.setFont(parent.getFont());

    // add the dialog's button bar to the right
    buttonControl = super.createButtonBar(buttonBar);
    buttonControl.setBackground(backColor);
    buttonControl.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));

    return buttonBar;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:27,代码来源:PluginDialog.java

示例5: createButtonsForButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
    super.createButtonsForButtonBar(parent);

    Button ok = getButton(IDialogConstants.OK_ID);
    ok.setText("Apply");
    ok.setEnabled(false);
    setButtonLayoutData(ok);
    
    Button cancel = getButton(IDialogConstants.CANCEL_ID);
    cancel.setText("Cancel");
    setButtonLayoutData(cancel);
    cancel.addListener(SWT.Selection, e -> {
        if (futureTask != null && ! futureTask.isDone()) {
            futureTask.cancel(true);
        }
        credentials.setApplication(null); 
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:20,代码来源:ApplicationsSWT.java

示例6: chooseWorkspace

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
protected void chooseWorkspace ()
{
    final ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog ( getShell (), new WorkbenchLabelProvider (), new WorkbenchContentProvider () );
    dialog.setTitle ( "Select driver exporter configuration file" );
    dialog.setMessage ( "Choose a driver exporter file for the configuration" );
    dialog.setInput ( ResourcesPlugin.getWorkspace ().getRoot () );
    dialog.setComparator ( new ResourceComparator ( ResourceComparator.NAME ) );
    dialog.setAllowMultiple ( true );
    dialog.setDialogBoundsSettings ( getDialogBoundsSettings ( HiveTab.WORKSPACE_SELECTION_DIALOG ), Dialog.DIALOG_PERSISTSIZE );
    if ( dialog.open () == IDialogConstants.OK_ID )
    {
        final IResource resource = (IResource)dialog.getFirstResult ();
        if ( resource != null )
        {
            final String arg = resource.getFullPath ().toString ();
            final String fileLoc = VariablesPlugin.getDefault ().getStringVariableManager ().generateVariableExpression ( "workspace_loc", arg ); //$NON-NLS-1$
            this.fileText.setText ( fileLoc );
            makeDirty ();
        }
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:22,代码来源:HiveTab.java

示例7: okPressed

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void okPressed() {
	try {
		getButton(IDialogConstants.OK_ID).setEnabled(false);
		getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
		
		if (schemaObjectsDialogComposite != null) {
			qname = (QName)schemaObjectsDialogComposite.getValue(null);
		}
		
		Thread thread = new Thread(this);
		thread.start();
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to import objects");
	}
	finally {
		getButton(IDialogConstants.OK_ID).setEnabled(true);
		getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:SchemaObjectsDialog.java

示例8: okPressed

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void okPressed() {
	try {
		getButton(IDialogConstants.OK_ID).setEnabled(false);
		getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
		
		if (schemaObjectsDialogComposite != null) {
			xml = (String)schemaObjectsDialogComposite.getValue(null);
		}
		
		Thread thread = new Thread(this);
		thread.start();
	}
	catch (Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to import objects");
	}
	finally {
		getButton(IDialogConstants.OK_ID).setEnabled(true);
		getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:XmlStructureDialog.java

示例9: initGridLayout

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
private GridLayout initGridLayout(GridLayout layout, boolean margins)
{
	layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
	layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
	if( margins )
	{
		layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
		layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
	}
	else
	{
		layout.marginWidth = 0;
		layout.marginHeight = 0;
	}
	return layout;
}
 
开发者ID:equella,项目名称:Equella,代码行数:17,代码来源:NewJPFRegistryWizardPageOne.java

示例10: createButtonsForButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
    createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    Button btnReset = createButton(parent, IDialogConstants.NO_ID, Messages.FilterDialog_reset, false);
    createButton(parent, IDialogConstants.CANCEL_ID, Messages.FilterDialog_cancel, false);

    btnReset.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            text.setText(""); //$NON-NLS-1$
            btnRegEx.setSelection(false);
            objViewer.setAllChecked(false);
            chgViewer.setAllChecked(false);
        }
    });
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:18,代码来源:FilterDialog.java

示例11: buttonPressed

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
protected void buttonPressed(int buttonId) {
	if (IDialogConstants.OK_ID == buttonId) {
		okPressed();
	} else if (IDialogConstants.CANCEL_ID == buttonId) {
		cancelPressed();
	} else if (UPDATE_ID == buttonId) {

		Display.getDefault().asyncExec(new Runnable() {

			@Override
			public void run() {
				try {
					propEditor.updatePropertyBrowser();
					treeViewer.setInput(XmlReader.loadXmlReader(path));
				} catch (Exception e) {
					e.printStackTrace();
					// TODO: handle exception
				} finally {
					treeViewer.refresh();
				}
			}
		});
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:25,代码来源:PropertyBrowser.java

示例12: setErrorMessage

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
/**
 * Sets or clears the error message.
 * If not <code>null</code>, the OK button is disabled.
 * 
 * @param errorMessage
 *            the error message, or <code>null</code> to clear
 * @since 3.0
 */
public void setErrorMessage(String errorMessage) {
	this.errorMessage = errorMessage;
	if (errorMessageText != null && !errorMessageText.isDisposed()) {
		errorMessageText.setText(errorMessage == null ? " \n " : errorMessage); //$NON-NLS-1$
		// Disable the error message text control if there is no error, or
		// no error text (empty or whitespace only).  Hide it also to avoid
		// color change.
		// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=130281
		boolean hasError = errorMessage != null && (StringConverter.removeWhiteSpaces(errorMessage)).length() > 0;
		errorMessageText.setEnabled(hasError);
		errorMessageText.setVisible(hasError);
		errorMessageText.getParent().update();
		// Access the ok button by id, in case clients have overridden button creation.
		// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
		Control button = getButton(IDialogConstants.OK_ID);
		if (button != null) {
			button.setEnabled(errorMessage == null);
		}
	}
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:29,代码来源:FolderSelectionDialog.java

示例13: createButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	// create a layout with spacing and margins appropriate for the font
	// size.
	GridLayout layout = new GridLayout();
	layout.numColumns = 0; // this is incremented by createButton
	layout.makeColumnsEqualWidth = true;
	layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN );
	layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN - 4);
	layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
	layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING -2);
	
	composite.setLayout(layout);
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END
			| GridData.VERTICAL_ALIGN_CENTER);
	
	composite.setLayoutData(data);
	composite.setFont(parent.getFont());
	
	// Add the buttons to the button bar.
	createButtonsForButtonBar(composite);
	return composite;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:ParamterValueDialog.java

示例14: browseXMLSelectionDialog

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
/**
 * @param filterExtension
 * @param fileName
 * Open the dialog to browse .xml file for expression, operation or outputfields
 */
private void browseXMLSelectionDialog(String filterExtension, Text fileName) {
	String externalSchemaTextBoxValue = "";
	ExternalSchemaFileSelectionDialog dialog = new ExternalSchemaFileSelectionDialog("Project",
			"Select Input File (.xml)",  new String[]{filterExtension,Extensions.XML.toString()}, this);
	if (dialog.open() == IDialogConstants.OK_ID) {
		String file = fileNameTextBoxValue;
		IResource resource = (IResource) dialog.getFirstResult();
		String path[] = resource.getFullPath().toString().split("/");
		if (file.isEmpty()) {
			for (int i = 1; i < path.length; i++) {
				externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
			}
		} else {
			for (int i = 1; i < path.length; i++) {
				if (!path[i].endsWith(".xml")) {
					externalSchemaTextBoxValue = externalSchemaTextBoxValue + path[i] + "/";
				}
			}
			externalSchemaTextBoxValue = externalSchemaTextBoxValue + file;
		}
		fileName.setText(externalSchemaTextBoxValue);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:29,代码来源:FilterOperationClassUtility.java

示例15: createButtonsForButtonBar

import org.eclipse.jface.dialogs.IDialogConstants; //导入依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
	fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false);

	// XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425
	boolean HAS_BUG_279425 = true;
	fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425);
	fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425);

	createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:MultiElementListSelectionDialog.java


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