1 /*
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3 *
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * The contents of this file are subject to the terms of either the Universal Permissive License
7 * v 1.0 as shown at http://oss.oracle.com/licenses/upl
8 *
9 * or the following license:
10 *
11 * Redistribution and use in source and binary forms, with or without modification, are permitted
12 * provided that the following conditions are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
15 * and the following disclaimer.
16 *
17 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
18 * conditions and the following disclaimer in the documentation and/or other materials provided with
19 * the distribution.
20 *
21 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
22 * endorse or promote products derived from this software without specific prior written permission.
129 hideButton = getButton(IDialogConstants.CANCEL_ID);
130 } else {
131 // Windows
132 showButton = getButton(IDialogConstants.CANCEL_ID);
133 hideButton = getButton(IDialogConstants.FINISH_ID);
134 }
135 hideButton.setVisible(false);
136 showButton.setText(IDialogConstants.OK_LABEL);
137 showButton.setFocus();
138 }
139
140 return control;
141 }
142
143 public boolean performFinish() {
144 return getWizard().performFinish();
145 }
146
147 public static int open(IWizardPage wp, int width, int height) {
148 OnePageWizardDialog d = new OnePageWizardDialog(Display.getCurrent().getActiveShell(), wp);
149 d.setWidthConstraint(width, width);
150 d.setHeightConstraint(height, height);
151 return d.open();
152 }
153 }
|
1 /*
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2019, Red Hat Inc. All rights reserved.
4 *
5 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 *
7 * The contents of this file are subject to the terms of either the Universal Permissive License
8 * v 1.0 as shown at http://oss.oracle.com/licenses/upl
9 *
10 * or the following license:
11 *
12 * Redistribution and use in source and binary forms, with or without modification, are permitted
13 * provided that the following conditions are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
16 * and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
19 * conditions and the following disclaimer in the documentation and/or other materials provided with
20 * the distribution.
21 *
22 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
23 * endorse or promote products derived from this software without specific prior written permission.
130 hideButton = getButton(IDialogConstants.CANCEL_ID);
131 } else {
132 // Windows
133 showButton = getButton(IDialogConstants.CANCEL_ID);
134 hideButton = getButton(IDialogConstants.FINISH_ID);
135 }
136 hideButton.setVisible(false);
137 showButton.setText(IDialogConstants.OK_LABEL);
138 showButton.setFocus();
139 }
140
141 return control;
142 }
143
144 public boolean performFinish() {
145 return getWizard().performFinish();
146 }
147
148 public static int open(IWizardPage wp, int width, int height) {
149 OnePageWizardDialog d = new OnePageWizardDialog(Display.getCurrent().getActiveShell(), wp);
150 d.setWidthConstraint(width, width);
151 d.setHeightConstraint(height, height);
152 return d.open();
153 }
154
155 public static int openAndHideCancelButton(IWizardPage wp, int width, int height) {
156 OnePageWizardDialog d = new OnePageWizardDialog(Display.getCurrent().getActiveShell(), wp);
157 d.setHideCancelButton(true);
158 d.setWidthConstraint(width, width);
159 d.setHeightConstraint(height, height);
160 return d.open();
161 }
162 }
|