本文整理汇总了Java中org.eclipse.pde.internal.ui.util.SWTUtil类的典型用法代码示例。如果您正苦于以下问题:Java SWTUtil类的具体用法?Java SWTUtil怎么用?Java SWTUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SWTUtil类属于org.eclipse.pde.internal.ui.util包,在下文中一共展示了SWTUtil类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createButtonContainer
import org.eclipse.pde.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
* @param parent
*/
private void createButtonContainer( Composite parent )
{
Composite composite = new Composite( parent, 0 );
GridLayout layout = new GridLayout( );
layout.marginHeight = layout.marginWidth = 0;
composite.setLayout( layout );
composite.setLayoutData( new GridData( 1040 ) );
fSelectAllButton = new Button( composite, 8 );
fSelectAllButton.setText( Messages.getString( "ReportAdvancedLauncherTab.SelectAllButtonText" ) ); //$NON-NLS-1$
fSelectAllButton.setLayoutData( new GridData( 770 ) );
SWTUtil.setButtonDimensionHint( fSelectAllButton );
fDeselectButton = new Button( composite, 8 );
fDeselectButton.setText( Messages.getString( "ReportAdvancedLauncherTab.DeselectButtonText" ) ); //$NON-NLS-1$
fDeselectButton.setLayoutData( new GridData( 768 ) );
SWTUtil.setButtonDimensionHint( fDeselectButton );
fDefaultsButton = new Button( composite, 8 );
fDefaultsButton.setText( Messages.getString( "ReportAdvancedLauncherTab.DefaultsButtonText" ) ); //$NON-NLS-1$
fDefaultsButton.setLayoutData( new GridData( 768 ) );
SWTUtil.setButtonDimensionHint( fDefaultsButton );
}
示例2: handleMove
import org.eclipse.pde.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
* Move the selected target to a workspace location
*/
private void handleMove() {
MoveTargetDefinitionWizard wizard = new MoveTargetDefinitionWizard(moved_TargetDefinitions.values());
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.create();
SWTUtil.setDialogSize(dialog, 400, 450);
if (dialog.open() == IDialogConstants.OK_ID) {
TableItem ti = fTableViewer.getTable().getItem(fTableViewer.getTable().getSelectionIndex());
IPath newTargetLoc = wizard.getTargetFileLocation();
IFile file = PDECore.getWorkspace().getRoot().getFile(newTargetLoc);
ti.setData(DATA_KEY_MOVED_LOCATION, file.getFullPath().toString());
IStructuredSelection selection = (IStructuredSelection) fTableViewer.getSelection();
moved_TargetDefinitions.put((ITargetDefinition) selection.getFirstElement(), wizard.getTargetFileLocation());
fTableViewer.refresh(true);
}
}
示例3: handleInsert
import org.eclipse.pde.internal.ui.util.SWTUtil; //导入依赖的package包/类
/**
* Handle action: insert new design pattern participant member
*/
void handleInsert() {
final RoleNode roleNode = (RoleNode) fActiveNode;
BusyIndicator.showWhile(fParticipantTree.getTree().getDisplay(), new Runnable() {
@Override
public void run() {
RoleMemberWizard wizard = new RoleMemberWizard(getDesignPatternInstance(), roleNode);
IWorkbench workbench = DesignPatternPlugin.getActiveWorkbenchWindow().getWorkbench();
wizard.init(workbench, null);
WizardDialog dialog = new WizardDialog(DesignPatternPlugin.getActiveWorkbenchShell(),
wizard);
dialog.create();
SWTUtil.setDialogSize(dialog, 300, 200);
// show member creation dialog
if (dialog.open() == Window.OK) {
// get code generator reference
final MemberCodeGenerator codeGen = wizard.getCodeGenerator();
// append new member node
MemberNode member = new MemberNode((RoleNode) fActiveNode, codeGen.getCreatedType());
// handle automatic code replacement
handleAutoReplacement(codeGen);
// show new member node
fParticipantTree.refresh(fActiveNode);
// select new member node
fParticipantTree.setSelection(new StructuredSelection(member));
// mark underlying model as dirty
getDesignPatternInstance().setDirty(true);
// fire model is changed
getPage().getEditor().editorDirtyStateChanged();
} // if
} // func run()
});
}